本文整理汇总了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()
示例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)
示例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']