• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python ui.main函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中rabbitvcs.ui.main函数的典型用法代码示例。如果您正苦于以下问题:Python main函数的具体用法?Python main怎么用?Python main使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了main函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _

        self.action.append(self.action.set_status, _("Running Switch Command..."))
        self.action.append(rabbitvcs.util.helper.save_repository_path, url)
        self.action.append(
            self.svn.switch,
            self.path,
            url,
            revision=revision
        )
        self.action.append(self.action.set_status, _("Completed Switch"))
        self.action.append(self.action.finish)
        self.action.start()

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNSwitch
}

def switch_factory(path, revision=None):
    guess = rabbitvcs.vcs.guess(path)
    return classes_map[guess["vcs"]](path, revision)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT
    (options, args) = main(
        [REVISION_OPT],
        usage="Usage: rabbitvcs switch [url]"
    )
            
    window = switch_factory(args[0], revision=options.revision)
    window.register_gtk_quit()
    gtk.main()
开发者ID:CloCkWeRX,项目名称:rabbitvcs,代码行数:30,代码来源:switch.py


示例2: MessageBox

        if not from_url or not to_url:
            MessageBox(_("The from and to url fields are both required."))
            return
    
        self.hide()

        self.action = SVNAction(
            self.svn,
            register_gtk_quit=self.gtk_quit_is_set()
        )
        
        self.action.append(self.action.set_header, _("Relocate"))
        self.action.append(self.action.set_status, _("Running Relocate Command..."))
        self.action.append(
            self.svn.relocate, 
            from_url,
            to_url,
            self.path
        )
        self.action.append(self.action.set_status, _("Completed Relocate"))
        self.action.append(self.action.finish)
        self.action.start()

if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs relocate [path]")
            
    window = Relocate(paths[0])
    window.register_gtk_quit()
    gtk.main()
开发者ID:CloCkWeRX,项目名称:rabbitvcs-svn-mirror,代码行数:30,代码来源:relocate.py


示例3: _

            self.path,
            url,
            self.message.get_text(),
            ignore=ignore
        )
        self.action.append(self.action.set_status, _("Completed Import"))
        self.action.append(self.action.finish)
        self.action.start()

    def on_previous_messages_clicked(self, widget, data=None):
        dialog = rabbitvcs.ui.dialog.PreviousMessages()
        message = dialog.run()
        if message is not None:
            self.message.set_text(message)

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNImport
}

def import_factory(path):
    vcs = rabbitvcs.vcs.VCS_SVN    
    return classes_map[vcs](path)

if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs import [path]")
            
    window = import_factory(paths[0])
    window.register_gtk_quit()
    gtk.main()
开发者ID:kuznetz,项目名称:rabbitvcs,代码行数:30,代码来源:import.py


示例4: push_factory

                        rabbitvcs.util.helper.format_long_text(item.message.rstrip("\n"))
                    ])
                    has_commits = True
                else:
                    break

            except IndexError:
                break

        if not has_commits:
            self.get_widget("ok").set_sensitive(False)
            self.get_widget("status").set_text(_("No commits found"))

classes_map = {
    rabbitvcs.vcs.VCS_GIT: GitPush
}

def push_factory(path):
    guess = rabbitvcs.vcs.guess(path)
    return classes_map[guess["vcs"]](path)
    
if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(
        usage="Usage: rabbitvcs push [path]"
    )

    window = push_factory(paths[0])
    window.register_gtk_quit()
    gtk.main()
开发者ID:kuznetz,项目名称:rabbitvcs,代码行数:30,代码来源:push.py


示例5: diff_factory

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNDiff,
    rabbitvcs.vcs.VCS_GIT: GitDiff
}

def diff_factory(vcs, path1, revision_obj1, path2=None, revision_obj2=None, sidebyside=False):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path1)
        vcs = guess["vcs"]

    return classes_map[vcs](path1, revision_obj1, path2, revision_obj2, sidebyside)

if __name__ == "__main__":
    from rabbitvcs.ui import main, VCS_OPT
    (options, args) = main([
        (["-s", "--sidebyside"], {
            "help":     _("View diff as side-by-side comparison"), 
            "action":   "store_true", 
            "default":  False
        }), VCS_OPT],
        usage="Usage: rabbitvcs diff [[email protected]] [[email protected]]"
    )
    
    pathrev1 = rabbitvcs.util.helper.parse_path_revision_string(args.pop(0))
    pathrev2 = (None, None)
    if len(args) > 0:
        pathrev2 = rabbitvcs.util.helper.parse_path_revision_string(args.pop(0))

    diff_factory(options.vcs, pathrev1[0], pathrev1[1], pathrev2[0], pathrev2[1], sidebyside=options.sidebyside)
开发者ID:KaisarCode,项目名称:rabbitvcs,代码行数:29,代码来源:diff.py


示例6: main

                row[1],
                self.revision_obj,
                force=True
            )

        for row in self.table.get_items():
            self.action.append(
                self.svn.revpropset,
                row[1],
                row[2],
                self.path,
                self.revision_obj,
                force=True
            )

        self.action.schedule()

        self.close()

if __name__ == "__main__":
    from rabbitvcs.ui import main, VCS_OPT
    (options, args) = main(
        [VCS_OPT],
        usage="Usage: rabbitvcs revprops [[email protected]]"
    )

    pathrev = rabbitvcs.util.helper.parse_path_revision_string(args.pop(0))
    window = SVNRevisionProperties(pathrev[0], pathrev[1])
    window.register_gtk_quit()
    Gtk.main()
开发者ID:rabbitvcs,项目名称:rabbitvcs,代码行数:30,代码来源:revprops.py


示例7: on_treeview_cell_edited_event

        self.on_treeview_event(treeview, data)

    def on_treeview_cell_edited_event(self, cell, row, data, column):
        self.items_treeview.set_row_item(row, column, data)
        self.save(row, column, data)

    def on_treeview_event(self, treeview, data):
        selected = self.items_treeview.get_selected_row_items(0)
        if len(selected) > 0:
            if len(selected) == 1:
                self.show_edit(selected[0])
            self.get_widget("delete").set_sensitive(True)

    def show_add(self):
        self.state = STATE_ADD
        self.items_treeview.unselect_all()
        
        self.items_treeview.append(["", ""])
        self.items_treeview.focus(1, 0)
    
    def show_edit(self, remote_name):
        self.state = STATE_EDIT

if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs branch-manager path")
    
    window = GitRemotes(paths[0])
    window.register_gtk_quit()
    gtk.main()
开发者ID:CloCkWeRX,项目名称:rabbitvcs-svn-mirror,代码行数:30,代码来源:remotes.py


示例8: _

        )
        self.action.append(self.action.set_status, _("Completed Reset"))
        self.action.append(self.action.finish)
        self.action.schedule()

    def on_browse_clicked(self, widget, data=None):
        chooser = rabbitvcs.ui.dialog.FolderChooser()
        path = chooser.run()
        if path is not None:
            self.get_widget("path").set_text(path)

    def on_path_changed(self, widget, data=None):
        self.check_path()

    def check_path(self):
        path = self.get_widget("path").get_text()
        root = self.git.find_repository_path(path)
        if root != path:
            self.get_widget("none_opt").set_active(True)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, paths) = main(
        [REVISION_OPT, VCS_OPT],
        usage="Usage: rabbitvcs reset [-r REVISION] path"
    )

    window = GitReset(paths[0], options.revision)
    window.register_gtk_quit()
    Gtk.main()
开发者ID:rabbitvcs,项目名称:rabbitvcs,代码行数:30,代码来源:reset.py


示例9: _

            if fetch_all:
                git_function_params.append ("all")
                repository = ""
                branch = ""

            self.action.append(self.git.pull, repository, branch, git_function_params)

        self.action.append(self.action.set_status, _("Completed Update"))
        self.action.append(self.action.finish)
        self.action.start()


classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNUpdate, 
    rabbitvcs.vcs.VCS_GIT: GitUpdate
}

def update_factory(paths):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths)

if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs update [path1] [path2] ...")

    window = update_factory(paths)
    window.register_gtk_quit()
    if isinstance(window, SVNUpdate):
        window.start()
    gtk.main()
开发者ID:CloCkWeRX,项目名称:rabbitvcs-svn-mirror,代码行数:30,代码来源:update.py


示例10: _

        
            # Note: if we don't want to ignore errors here, we could define a
            # function that logs failures.
            shutil.rmtree(temp_dir, ignore_errors = True)
        
        self.action.append(create_patch_action, path, items, self.common)
        
        self.action.append(self.action.set_status, _("Patch File Created"))
        self.action.append(self.action.finish)
        self.action.start()

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNCreatePatch,
    rabbitvcs.vcs.VCS_GIT: GitCreatePatch
}

def createpatch_factory(paths, base_dir):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths, base_dir)

if __name__ == "__main__":
    from rabbitvcs.ui import main, BASEDIR_OPT
    (options, paths) = main(
        [BASEDIR_OPT],
        usage="Usage: rabbitvcs createpatch [path1] [path2] ..."
    )
        
    window = createpatch_factory(paths, options.base_dir)
    window.register_gtk_quit()
    gtk.main()
开发者ID:CloCkWeRX,项目名称:rabbitvcs-svn-mirror,代码行数:29,代码来源:createpatch.py


示例11: __init__

    def __init__(self, path, propdetails):
        self.path = path
        self.propdetails = propdetails
    
    def all_modified(self):
        return all([detail["status"] != "unchanged"
                       for (propname, detail) in self.propdetails.items()])
    
    def all_not_deleted(self):
        return all([detail["status"] != "deleted"
                       for (propname, detail) in self.propdetails.items()])
    
    def property_revert(self):
        return False
        # return self.all_modified()
    
    def property_delete(self):
        return self.all_not_deleted()
    
    def property_edit(self):
        return len(self.propdetails.keys()) == 1

if __name__ == "__main__":
    # These are some dumb tests before I add any functionality.
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs propedit [url_or_path]")
    
    window = PropEditor(paths[0])
    window.register_gtk_quit()
    gtk.main()
开发者ID:CloCkWeRX,项目名称:rabbitvcs-svn-mirror,代码行数:30,代码来源:property_editor.py


示例12: _

        self.action = rabbitvcs.ui.action.GitAction(
            self.git,
            register_gtk_quit=self.gtk_quit_is_set()
        )
        self.action.set_pbar_ticks(ticks)
        self.action.append(self.action.set_header, _("Apply Patch"))
        self.action.append(self.action.set_status, _("Applying Patch File..."))
        self.action.append(self.git.apply_patch, path, base_dir)
        self.action.append(self.action.set_status, _("Patch File Applied"))
        self.action.append(self.action.finish)
        self.action.start()

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNApplyPatch,
    rabbitvcs.vcs.VCS_GIT: GitApplyPatch
}

def applypatch_factory(paths):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths)

if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs applypatch [path1] [path2] ...")

    window = applypatch_factory(paths)
    window.register_gtk_quit()
    window.start()
    gtk.main()
    
开发者ID:primaryobjects,项目名称:rabbitvcs,代码行数:29,代码来源:applypatch.py


示例13: on_repo_browser_clicked

    def on_repo_browser_clicked(self, widget, data=None):
        from rabbitvcs.ui.browser import BrowserDialog
        BrowserDialog(self.from_urls.get_active_text(), 
            callback=self.on_repo_browser_closed)

    def on_repo_browser_closed(self, new_url):
        self.from_urls.set_child_text(new_url)

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNBranch
}

def branch_factory(vcs, path, revision=None):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path)
        vcs = guess["vcs"]
        
    return classes_map[vcs](path, revision)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, args) = main(
        [REVISION_OPT, VCS_OPT],
        usage="Usage: rabbitvcs branch [url_or_path]"
    )

    window = branch_factory(options.vcs, args[0], options.revision)
    window.register_gtk_quit()
    gtk.main()
开发者ID:kuznetz,项目名称:rabbitvcs,代码行数:29,代码来源:branch.py


示例14: show

            (MenuCompare, None),
            (MenuSeparator, None),
            (MenuUpdate, None)
        ]

    def show(self):
        if len(self.paths) == 0:
            return

        context_menu = GtkContextMenu(self.structure, self.conditions, self.callbacks)
        context_menu.show(self.event)

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNCheckForModifications
}

def checkmods_factory(paths, base_dir):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths, base_dir)

if __name__ == "__main__":
    from rabbitvcs.ui import main, BASEDIR_OPT
    (options, paths) = main(
        [BASEDIR_OPT],
        usage="Usage: rabbitvcs checkmods [url_or_path]"
    )

    window = checkmods_factory(paths, options.base_dir)
    window.register_gtk_quit()
    gtk.main()
开发者ID:KaisarCode,项目名称:rabbitvcs,代码行数:30,代码来源:checkmods.py


示例15: SystemExit

            relative_path = path[len(repo_path)+1:]
        
        dest_path = "%s/%s" % (dest_dir, relative_path)
        
        rabbitvcs.util.helper.open_item(dest_path)

        raise SystemExit()

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNOpen,
    rabbitvcs.vcs.VCS_GIT: GitOpen
}

def open_factory(vcs, path, revision):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path)
        vcs = guess["vcs"]
        
    return classes_map[vcs](path, revision)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, paths) = main(
        [REVISION_OPT, VCS_OPT],
        usage="Usage: rabbitvcs open path [-r REVISION]"
    )
    
    window = open_factory(options.vcs, paths[0], options.revision)
    window.register_gtk_quit()
    gtk.main()
开发者ID:kuznetz,项目名称:rabbitvcs,代码行数:30,代码来源:open.py


示例16: ignore_factory

        self.close()



classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNIgnore,
    rabbitvcs.vcs.VCS_GIT: GitIgnore
}

def ignore_factory(path, pattern):
    guess = rabbitvcs.vcs.guess(path)
    return classes_map[guess["vcs"]](path, pattern)

if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, args) = main(usage="Usage: rabbitvcs ignore <folder> <pattern>")

    path = getcwd()
    pattern = ""
    if args:
        if len(args) == 1:
            pattern = args[0]
        else:
            if args[0] != ".":
                path = args[0]
            pattern = args[1]

    window = ignore_factory(path, pattern)
    window.register_gtk_quit()
    Gtk.main()
开发者ID:rabbitvcs,项目名称:rabbitvcs,代码行数:30,代码来源:ignore.py


示例17: on_log_dialog_button_clicked

            self.tag_entry.set_text(self.selected_tag.name)
            self.revision_label.set_text(self.selected_tag.sha)
            self.message_label.set_text(self.selected_tag.message.rstrip("\n"))
            self.tagger_label.set_text(self.selected_tag.tagger)
            self.date_label.set_text(rabbitvcs.util.helper.format_datetime(datetime.fromtimestamp(self.selected_tag.tag_time)))

            self.show_containers(self.view_containers)
            self.get_widget("detail_label").set_markup(_("<b>Tag Detail</b>"))


    def on_log_dialog_button_clicked(self, widget):
        log_dialog_factory(
            self.path,
            ok_callback=self.on_log_dialog_closed
        )
    
    def on_log_dialog_closed(self, data):
        if data:
            self.start_point_entry.set_text(data)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, paths) = main(
        [REVISION_OPT, VCS_OPT],
        usage="Usage: rabbitvcs tag-manager path"
    )
    
    window = GitTagManager(paths[0], options.revision)
    window.register_gtk_quit()
    gtk.main()
开发者ID:CloCkWeRX,项目名称:rabbitvcs-svn-mirror,代码行数:30,代码来源:tags.py


示例18: _

            from_branch
        )

        self.action.append(self.action.set_status, _("Completed Merge"))
        self.action.append(self.action.finish)
        self.action.start()

    def __revision_changed(self, widget):
        self.update_branch_info()

           

if __name__ == "__main__":
    from rabbitvcs.ui import main, VCS_OPT
    (options, args) = main(
        [VCS_OPT],
        usage="Usage: rabbitvcs merge path [revision/revision_range]"
    )

    path = args[0]

    vcs_name = options.vcs
    if not vcs_name:
        vcs_name = rabbitvcs.vcs.guess(path)["vcs"]    
    
    window = None
    revision_text = None
    if len(args) >= 2:
        revision_text = args[1]

    if vcs_name == rabbitvcs.vcs.VCS_SVN:
        window = SVNMerge(path, revision_text)
开发者ID:primaryobjects,项目名称:rabbitvcs,代码行数:32,代码来源:merge.py


示例19: annotate_factory

                item["revision"][:7],
                item["author"],
                rabbitvcs.util.helper.format_datetime(item["date"]),
                item["line"]
            )
        
        return text

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNAnnotate,
    rabbitvcs.vcs.VCS_GIT: GitAnnotate
}

def annotate_factory(vcs, path, revision=None):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path)
        vcs = guess["vcs"]
        
    return classes_map[vcs](path, revision)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, paths) = main(
        [REVISION_OPT, VCS_OPT], 
        usage="Usage: rabbitvcs annotate url [-r REVISION]"
    )

    window = annotate_factory(options.vcs, paths[0], options.revision)
    window.register_gtk_quit()
    gtk.main()
开发者ID:kuznetz,项目名称:rabbitvcs,代码行数:30,代码来源:annotate.py


示例20: clone_factory

        if self.get_widget("destination").get_text() == "":
            self.complete = False
        
        self.get_widget("ok").set_sensitive(self.complete)

classes_map = {
    rabbitvcs.vcs.VCS_GIT: GitClone
}

def clone_factory(classes_map, vcs, path=None, url=None):
    return classes_map[vcs](path, url)

if __name__ == "__main__":
    from rabbitvcs.ui import main, VCS_OPT
    (options, args) = main(
        [VCS_OPT],
        usage="Usage: rabbitvcs clone --vcs=git [url] [path]"
    )
    
    # Default to using git
    vcs = rabbitvcs.vcs.VCS_GIT
    if options.vcs:
        vcs = options.vcs
    
    # If two arguments are passed:
    #   The first argument is expected to be a url
    #   The second argument is expected to be a path
    # If one argument is passed:
    #   If the argument exists, it is a path
    #   Otherwise, it is a url
    path = url = None
    if len(args) == 2:
开发者ID:CloCkWeRX,项目名称:rabbitvcs-svn-mirror,代码行数:32,代码来源:clone.py



注:本文中的rabbitvcs.ui.main函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python ui.InterfaceView类代码示例发布时间:2022-05-26
下一篇:
Python rabbit_helper.RabbitHelper类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap