Esempio n. 1
0
def gh_register():
    """Create a repository at GitHub and push it your local repository."""
    _adjust_options()
    repo = _get_repo(os.getcwd())
    project_name = options.setup.name
    project_description = options.setup.get('description','')
    remote_name = options.gh_pages.remote_name
    master_branch = options.gh_pages.master_branch
    credentials = Credentials.get_credentials(repo)
    if not credentials:
        sys.exit('Your github name and token git config are not set.'
                 'Check http://github.com/blog/170-token-authentication' % os.getcwd())
    project = dry(
        "Create a repository called %s at %s's GitHub account..." % (
            project_name, credentials.user),
        repo.register,
        project_name,
        credentials,
        description=project_description,
        is_public=True,
        remote_name=remote_name,
        master_branch=master_branch)
    if project is not None:
        info('Opening your project home pages:%s', project.url.http)
        webbrowser.open(project.url.http)
Esempio n. 2
0
def gh_register():
    """Create a repository at GitHub and push it your local repository."""
    _adjust_options()
    repo = _get_repo(os.getcwd())
    project_name = options.setup.name
    project_description = options.setup.get('description', '')
    remote_name = options.gh_pages.remote_name
    master_branch = options.gh_pages.master_branch
    credentials = Credentials.get_credentials(repo)
    if not credentials:
        sys.exit('Your github name and token git config are not set.'
                 'Check http://github.com/blog/170-token-authentication' %
                 os.getcwd())
    project = dry("Create a repository called %s at %s's GitHub account..." %
                  (project_name, credentials.user),
                  repo.register,
                  project_name,
                  credentials,
                  description=project_description,
                  is_public=True,
                  remote_name=remote_name,
                  master_branch=master_branch)
    if project is not None:
        info('Opening your project home pages:%s', project.url.http)
        webbrowser.open(project.url.http)
Esempio n. 3
0
 def test_get_credential(self):
     with TempDir() as tmp:
         repo = Repo.init_bare(path(tmp) / 'repo.git')
         repo.git.config('github.user', 'damien')
         repo.git.config('github.token', 'xyz')
         c = Credentials.get_credentials(repo)
         eq_('damien', c.user)
         eq_('xyz', c.token)
Esempio n. 4
0
 def test_get_credential(self):
     with TempDir() as tmp:
         repo = Repo.init_bare(path(tmp) / 'repo.git')
         repo.git.config('github.user', 'damien')
         repo.git.config('github.token', 'xyz')
         c = Credentials.get_credentials(repo)
         eq_('damien', c.user)
         eq_('xyz', c.token)
Esempio n. 5
0
def gh_register():
    """Create a repository at GitHub and push it your local repository."""
    repo = _get_repo(os.getcwd())
    project_name = options.setup.name
    project_description = options.setup.get('description','')
    remote_name = options.gh_pages.remote_name
    master_branch = options.gh_pages.master_branch
    credentials = Credentials.get_credentials(repo)
    project = dry(
        "Create a repository called %s at %s's GitHub account..." % (
            project_name, credentials.user),
        repo.register,
        project_name,
        credentials,
        description=project_description,
        is_public=True,
        remote_name=remote_name,
        master_branch=master_branch)
    if project is not None:
        info('Opening your project home pages:%s', project.url.http)
        webbrowser.open(project.url.http)
Esempio n. 6
0
def gh_register():
    """Create a repository at GitHub and push it your local repository."""
    _adjust_options()
    repo = _get_repo(os.getcwd())
    project_name = options.setup.name
    project_description = options.setup.get('description', '')
    remote_name = options.gh_pages.remote_name
    master_branch = options.gh_pages.master_branch
    credentials = Credentials.get_credentials(repo)
    project = dry("Create a repository called %s at %s's GitHub account..." %
                  (project_name, credentials.user),
                  repo.register,
                  project_name,
                  credentials,
                  description=project_description,
                  is_public=True,
                  remote_name=remote_name,
                  master_branch=master_branch)
    if project is not None:
        info('Opening your project home pages:%s', project.url.http)
        webbrowser.open(project.url.http)