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


Python Gittle.init方法代码示例

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


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

示例1: init

# 需要导入模块: from gittle import Gittle [as 别名]
# 或者: from gittle.Gittle import init [as 别名]
 def init(path):
     try:
         repo = Gittle.init(path)
         return repo
     except:
         AgentGitHandler.log.exception("Initializing local repo at %r failed" % path)
         raise Exception("Initializing local repo at %r failed" % path)
开发者ID:kasundsilva,项目名称:stratos,代码行数:9,代码来源:agentgithandler.py

示例2: init_repo_if_empty

# 需要导入模块: from gittle import Gittle [as 别名]
# 或者: from gittle.Gittle import init [as 别名]
 def init_repo_if_empty(self,repo_name):
     repopath=os.path.join(self.view['repo'].base,repo_name)
     self.g= Gittle.init(repopath,bare=False )
     self.g.commit('name','email','initial commit')
     self.view['repo'].text=repo_name
     console.hud_alert('Repo {} created'.format(repo_name))
     self.did_select_repo(self.view['repo'])
开发者ID:c0ns0le,项目名称:Pythonista,代码行数:9,代码来源:gitui.py

示例3: init_repo_if_empty

# 需要导入模块: from gittle import Gittle [as 别名]
# 或者: from gittle.Gittle import init [as 别名]
 def init_repo_if_empty(self,repo_name,gitpath):
     if not os.path.exists(gitpath):
         self.g= Gittle.init(gitpath,bare=False )
         self.g.commit('name','email','initial commit')
         self.view['repo'].text=repo_name
         console.hud_alert('Repo {} created'.format(repo_name))
         self.refresh()
开发者ID:jmassob,项目名称:gitview,代码行数:9,代码来源:gitui.py

示例4: __init__

# 需要导入模块: from gittle import Gittle [as 别名]
# 或者: from gittle.Gittle import init [as 别名]
    def __init__(self, path):
        try:
            self.gittle = Gittle(path)
        except NotGitRepository:
            self.gittle = Gittle.init(path)

        # Dulwich repo
        self.repo = self.gittle.repo

        self.path = path
开发者ID:tobegit3hub,项目名称:realms-wiki,代码行数:12,代码来源:models.py

示例5: push_directory_to_repo

# 需要导入模块: from gittle import Gittle [as 别名]
# 或者: from gittle.Gittle import init [as 别名]
def push_directory_to_repo(directory, github_repo):
    auth = FixedGittleAuth(pkey=open(settings.GITHUB_PRIVATE_KEY))
    repo = Gittle.init(directory, auth=auth)

    files = []
    with work_in(directory):
        for root, dirnames, filenames in os.walk("."):
            # remove the leading './'
            root = root[2:]
            # skip .git directories
            if ".git" in dirnames:
                dirnames.remove(".git")

            for f in filenames:
                path = os.path.join(root, f)
                files.append(str(path))

    repo.commit(name="bakehouse", message="Hello world", files=files)
    repo.push(github_repo.ssh_url, branch_name="master")
开发者ID:rollstudio,项目名称:djangodash-2013,代码行数:21,代码来源:utils.py

示例6: git_init

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

示例7: get_transport_and_path

# 需要导入模块: from gittle import Gittle [as 别名]
# 或者: from gittle.Gittle import init [as 别名]
print repos.name
print repos.get_commits()[0].sha



repo_path = 'data'
repo_url = 'git://github.com/rhocode/axis.git'




try:
	repo = Gittle.clone(repo_url, repo_path)
except OSError:
	repo = Gittle.init(repo_path)

repo.switch_branch(b'gh-pages')

repo.pull()

# client, host_path = get_transport_and_path("https://github.com/rhocode/axis.git")
# r = Repo.init("test", mkdir=True)
# remote_refs = client.fetch(host_path, r,
#     determine_wants=r.object_store.determine_wants_all,
#     progress=sys.stdout.write)

# branches = client.fetch(host_path, r)

# r["HEAD"] = remote_refs["HEAD"]
  
开发者ID:tehalexf,项目名称:PyDeploy,代码行数:31,代码来源:PyDeploy.py

示例8: init

# 需要导入模块: from gittle import Gittle [as 别名]
# 或者: from gittle.Gittle import init [as 别名]
 def init(self, repoPath):
 	self.repo = Gittle.init(repoPath)
 	print("Created Repo")
开发者ID:cmo8,项目名称:gpass-python,代码行数:5,代码来源:_gPassGit.py

示例9: mkdtemp

# 需要导入模块: from gittle import Gittle [as 别名]
# 或者: from gittle.Gittle import init [as 别名]
# -*- coding: utf8 -*-

import os
from gittle import Gittle
from tempfile import mkdtemp

path = mkdtemp()
fn = 'test.txt'
filename = os.path.join(path, fn)

name = 'Samy Pessé'
email = '[email protected]'
message = "C'est beau là bas"


def create_file():
    fd = open(filename, 'w+')
    fd.write('blabla\n BOOM BOOM\n à la montagne')
    fd.close()

repo = Gittle.init(path)
create_file()

repo.stage(fn)
repo.commit(name=name, email=email, message=message)


print('COMMIT_INFO =', repo.commit_info())

print('PATH =', path)
开发者ID:0asa,项目名称:gittle,代码行数:32,代码来源:commit.py


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