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


Python RepositoryManager.notify方法代码示例

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


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

示例1: process_request

# 需要导入模块: from trac.versioncontrol import RepositoryManager [as 别名]
# 或者: from trac.versioncontrol.RepositoryManager import notify [as 别名]
    def process_request(self, request):
        payload = request.args.get('payload')

        if not payload:
            raise Exception('Payload not found')

        payload = simplejson.loads(payload)

        repository_name = payload['repository']['name']
        repository = self.env.get_repository(repository_name)

        if not repository:
            raise Exception('Repository "%s" not found' % repository_name)

        # CachedRepository
        if repository.repos:
            repository.repos.git.repo.remote('update')
        # Normal repository
        else:
            repository.git.repo.remote('update')

        manager = RepositoryManager(self.env)

        revision_ids = [ commit['id'] for commit in payload['commits'] ]

        try:
            self.env.log.debug('Adding changesets: %s' % revision_ids)
            manager.notify('changeset_added', repository_name, revision_ids)
        except Exception as exception:
            self.env.log.error(exception)

        request.send_response(204)
        request.send_header('Content-Length', 0)
        request.write('')
        raise RequestDone
开发者ID:klas-genestack,项目名称:github-trac,代码行数:37,代码来源:github.py

示例2: _do_changeset_modified

# 需要导入模块: from trac.versioncontrol import RepositoryManager [as 别名]
# 或者: from trac.versioncontrol.RepositoryManager import notify [as 别名]
 def _do_changeset_modified(self, reponame, *revs):
     if is_default(reponame):
         reponame = ''
     rm = RepositoryManager(self.env)
     errors = rm.notify('changeset_modified', reponame, revs)
     for error in errors:
         printout(error)
开发者ID:exocad,项目名称:exotrac,代码行数:9,代码来源:admin.py

示例3: _do_changeset_added

# 需要导入模块: from trac.versioncontrol import RepositoryManager [as 别名]
# 或者: from trac.versioncontrol.RepositoryManager import notify [as 别名]
 def _do_changeset_added(self, reponame, *revs):
     if is_default(reponame):
         reponame = ""
     rm = RepositoryManager(self.env)
     errors = rm.notify("changeset_added", reponame, revs)
     for error in errors:
         printout(error)
开发者ID:pkdevbox,项目名称:trac,代码行数:9,代码来源:admin.py

示例4: _do_changeset_modified

# 需要导入模块: from trac.versioncontrol import RepositoryManager [as 别名]
# 或者: from trac.versioncontrol.RepositoryManager import notify [as 别名]
 def _do_changeset_modified(self, reponame, *revs):
     if is_default(reponame):
         reponame = ''
     rm = RepositoryManager(self.env)
     rm.notify('changeset_modified', reponame, revs)
开发者ID:zjj,项目名称:trac_hack,代码行数:7,代码来源:admin.py

示例5: _do_changeset_added

# 需要导入模块: from trac.versioncontrol import RepositoryManager [as 别名]
# 或者: from trac.versioncontrol.RepositoryManager import notify [as 别名]
 def _do_changeset_added(self, reponame, *revs):
     if is_default(reponame):
         reponame = ""
     rm = RepositoryManager(self.env)
     rm.notify("changeset_added", reponame, revs)
开发者ID:moreati,项目名称:trac-gitsvn,代码行数:7,代码来源:admin.py


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