當前位置: 首頁>>代碼示例>>Python>>正文


Python Repository.users方法代碼示例

本文整理匯總了Python中repository.Repository.users方法的典型用法代碼示例。如果您正苦於以下問題:Python Repository.users方法的具體用法?Python Repository.users怎麽用?Python Repository.users使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在repository.Repository的用法示例。


在下文中一共展示了Repository.users方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _run_create

# 需要導入模塊: from repository import Repository [as 別名]
# 或者: from repository.Repository import users [as 別名]
def _run_create(self, options, args):
    """
    Create the repository.
    Save the yaml descriptor.
    """

    prefix, name = __parse_prefix_name(args[0])
    print "Name = %s" % name
    if prefix:
        print "Prefix = %s" % prefix
    print "Fisheye = %s" % options.fisheye

    repo = Repository(prefix, name, options.fisheye)
    if Repository.exists(repo.path_to_repo):
        raise CommandError('A repository named "%s" already exists.' % repo.path)
    try:
        __check_path_dir(repo)
        print 'Creating the repository ...'
        repo.create()
        print 'Created the repository'
        print repo.apache_conf
        apache_conf.process_to_file(repo.apache_conf,
                                    {'repopath' : repo.path,
                                     'users' : ', '.join(repo.users()),
                                     'apache_authz_path' : repo.apache_authz})
        print "Created apache conf"
        __write_repository_yaml(repo)
        print "CREATED repository at %s." % repo.path

        if options.fisheye:
            __write_repository_fisheyeauth(repo)
            fisheye_admin = FisheyeAdmin(password=config.FISHEYE_ADMIN_PW)
            if fisheye_admin.create_repository(repo, __get_description()):
                print "Successfully created a fisheye instance for %s" % repo.name

    except Exception, e:
        raise CommandError("Failed to create the repository at %s\n" % repo.path_to_repo,
                           "The original error was: %s: %s" % (type(e), e))
開發者ID:efroese,項目名稱:svnsh,代碼行數:40,代碼來源:command.py


注:本文中的repository.Repository.users方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。