本文整理汇总了Python中cola.widgets.archive.GitArchiveDialog类的典型用法代码示例。如果您正苦于以下问题:Python GitArchiveDialog类的具体用法?Python GitArchiveDialog怎么用?Python GitArchiveDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GitArchiveDialog类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_tarball
def create_tarball(self):
ref = self._clicked_item.commit.sha1
dlg = GitArchiveDialog.create(ref, parent=self)
if dlg is None:
return
self.emit(SIGNAL(archive), ref, dlg.fmt, dlg.prefix, dlg.filename)
qtutils.information('File Saved', 'File saved to "%s"' % dlg.filename)
示例2: save_archive
def save_archive(self):
ref = git.rev_parse('HEAD')[STDOUT]
shortref = ref[:7]
GitArchiveDialog.save_hashed_objects(ref, shortref, self)
示例3: create_tarball
def create_tarball(self):
sha1 = self.selected_sha1()
if sha1 is None:
return
short_sha1 = sha1[:7]
GitArchiveDialog.save_hashed_objects(sha1, short_sha1, self)
示例4: save_archive
def save_archive(self):
ref = git.rev_parse('HEAD')
shortref = ref[:7]
GitArchiveDialog.save(ref, shortref, self)
示例5: main
def main(context):
"""Parses the command-line arguments and starts git-cola
"""
setup_environment()
opts, args, context = parse_args(context)
repo = process_args(opts, args)
# Allow Ctrl-C to exit
signal.signal(signal.SIGINT, signal.SIG_DFL)
# Initialize the app
app = ColaApplication(sys.argv)
# Ensure that we're working in a valid git repository.
# If not, try to find one. When found, chdir there.
model = cola.model()
valid = model.set_worktree(repo) and not opts.prompt
while not valid:
startup_dlg = startup.StartupDialog(app.activeWindow())
gitdir = startup_dlg.find_git_repo()
if not gitdir:
sys.exit(-1)
valid = model.set_worktree(gitdir)
# Finally, go to the root of the git repo
os.chdir(model.git.worktree())
# Show the GUI
if context == "archive":
from cola.widgets.archive import GitArchiveDialog
model.update_status()
view = GitArchiveDialog(model.currentbranch)
elif context == "branch":
from cola.widgets.createbranch import create_new_branch
view = create_new_branch()
elif context in ("git-dag", "dag"):
from cola.dag import git_dag
ctl = git_dag(model, opts=opts, args=args)
view = ctl.view
elif context in ("classic", "browse"):
from cola.classic import cola_classic
view = cola_classic(update=False)
elif context == "config":
from cola.prefs import preferences
ctl = preferences()
view = ctl.view
elif context == "fetch":
# TODO: the calls to update_status() can be done asynchronously
# by hooking into the message_updated notification.
from cola.widgets import remote
model.update_status()
view = remote.fetch()
elif context == "grep":
from cola.widgets import grep
view = grep.run_grep(parent=None)
elif context == "pull":
from cola.widgets import remote
model.update_status()
view = remote.pull()
elif context == "push":
from cola.widgets import remote
model.update_status()
view = remote.push()
elif context == "remote":
from cola.widgets import editremotes
view = editremotes.edit()
elif context == "search":
from cola.widgets.search import search
view = search()
elif context == "stash":
from cola.stash import stash
model.update_status()
view = stash().view
elif context == "tag":
from cola.widgets.createtag import create_tag
view = create_tag()
else:
view = MainView(model, qtutils.active_window())
ctl = MainController(model, view)
# Install UI wrappers for command objects
cfgactions.install_command_wrapper()
guicmds.install_command_wrapper()
# Make sure that we start out on top
view.show()
view.raise_()
#.........这里部分代码省略.........
示例6: save_archive
def save_archive(self):
ref = git.rev_parse("HEAD")[STDOUT]
shortref = ref[:7]
GitArchiveDialog.save(ref, shortref, self)