Github-tools Models.

class github.tools.gh_pages.Credentials(user=None, token=None)

User credential for Github API.

classmethod get_credentials(repo=None)
Get credentials from the github.user and github.token config values
class github.tools.gh_pages.GitHubProject(name=None, owner=None, description=None, is_public=None)

GitHub project class

classmethod create(project_name, credentials, description='', is_public=True)
Create a new GitHub project.
classmethod get_project(project_name, owner)
Fetch the project details from GitHub
class github.tools.gh_pages.GitHubRepo(path=None)

GitHubRepo instance for a repository cloned to/from GitHub.

Allow to manage gh-pages as a submodule.

add_gh_pages_submodule(gh_pages_path, remote_name='origin')

Add the gh-pages submodule, as a root branch of the GitHub repository.

Parameters:
  • gh_pages_path – Path to gh-pages submodule.
  • remote_name – Remote name of the GitHub repository.
register(project_name, credentials=None, description='', is_public=True, remote_name='origin', master_branch='master')

Create a repository on GitHub, push your local copy to it, and add a remote alias name for it to your local copy.

Parameters:
  • project_name – Name of the repository to create at GitHub.
  • credentials – GitHub API credentials, used to create a new GitHub repository.
  • description – Repository description.
  • is_public – Should the GitHub repository be public.
  • remote_name – GitHub repository remote name for your local copy (default to “origin”).
  • master_branch – Name of the branch to push to GitHub (default to “master”)
class github.tools.gh_pages.GitmoduleReader

Extends file to trim the start of each read line (with readline()).

Used by SubmoduleDict to parse .gitmodule files. RawConfigParser doesn’t seems to be able to parse those .gitmodule lines that start a tab.

class github.tools.gh_pages.ProjectUrl(project)

Holds the different GitHub urls of a project.

gh_pages
Url for the project’s gh-pages.
git
Git url of the repository for read access.
http
Url to project home page.
issue
Url to issue tracker
ssh
SSH url to of the repository for read/write access.
class github.tools.gh_pages.Repo(path=None)

Overwrite git.Repo to add submodule support and create repository with working copy.

classmethod create(path=None, mk_dir=False)
Initialise the repository WITH a working copy
class github.tools.gh_pages.Submodule(repo, url, module_path, sha=None, status=None)

A repository submodule.

Hold its details: the module path, its repository url, sha and status.

class github.tools.gh_pages.SubmoduleDict(repo)

List the submodules of a repository.

The keys are submodules name (and path).

This Page