当前位置: 首页>>代码示例>>Python>>正文


Python Gittle.stage方法代码示例

本文整理汇总了Python中gittle.Gittle.stage方法的典型用法代码示例。如果您正苦于以下问题:Python Gittle.stage方法的具体用法?Python Gittle.stage怎么用?Python Gittle.stage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gittle.Gittle的用法示例。


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

示例1: gitPush

# 需要导入模块: from gittle import Gittle [as 别名]
# 或者: from gittle.Gittle import stage [as 别名]
def gitPush():
    logging.info('*** Versioning files and pushing to remote repository ***')
    destinations = [dataDestination, PDFdestination]
    remotes = ['dataRemote', 'PDFRemote']
    for d, r in zip(destinations, remotes):
        repo = Gittle(d, origin_uri=config.get('Git', r))
        repo.stage(repo.pending_files)
        repo.commit(message=commitMessage)
        repo.push()
开发者ID:a-berish,项目名称:asExportIncremental,代码行数:11,代码来源:asExportIncremental.py

示例2: __init__

# 需要导入模块: from gittle import Gittle [as 别名]
# 或者: from gittle.Gittle import stage [as 别名]
class GPassGit:

    #Creates a Git object
    def __init__(self, repoPath):
        self.repoPath = repoPath
        self.repo = None
        if self.isRepoSet():
            self.repo = Gittle(self.repoPath)

    #Check For Git Repo
    def isRepoSet(self):
        if os.path.isfile(self.repoPath + '/.git/config'):
            return True
        return False

    def init(self, repoPath):
    	self.repo = Gittle.init(repoPath)
    	print("Created Repo")

    def add(self, filePath):
    	self.repo.stage([filePath])

    def commit(self, user, em, msg):
    	self.repo.commit(
            name=user,
            email=em,
            message=msg
        )

    # Authentication with RSA private key
    def auth(self, key):
        key_file = open(key)
        repo.auth(pkey=key_file)

    def push(self, key):
        self.auth(key)
        self.repo.push()

    def pull(self, key):
        self.auth(key)
        self.repo.pull()

    def acp(self, filepath, user, em, msg):
    	self.add(filepath)
    	self.commit(user, em, msg)
    	self.push(key)
        
开发者ID:cmo8,项目名称:gpass-python,代码行数:48,代码来源:_gPassGit.py

示例3: git_add

# 需要导入模块: from gittle import Gittle [as 别名]
# 或者: from gittle.Gittle import stage [as 别名]
		def git_add(args):
			if len(args) > 0:
				repo = Gittle('.')
				repo.stage(args)
			else:
				print command_help['add']
开发者ID:jsbain,项目名称:shellista,代码行数:8,代码来源:shellista.py


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