Utilities¶
Note
The documentation in this section is aimed at people wishing to contribute
to hubugs
, and can be skipped if you are simply using the tool from
the command line.
-
hubugs.utils.
setup_environment
(__project, __host_url)¶ Configure execution environment for commands dispatch.
Convenience functions¶
-
hubugs.utils.
get_editor
()¶ Choose a suitable editor.
See git-var(1) for details.
Git/GitHub support¶
-
hubugs.utils.
get_github_api
()¶ Create a GitHub API instance.
- Returns
GitHub HTTP session
- Return type
httplib2.Http
-
hubugs.utils.
get_git_config_val
(__key, default=None, local_only=False)¶ Fetch a git configuration value.
-
hubugs.utils.
set_git_config_val
(__key, __value, local_only=False)¶ Set a git configuration value.
-
hubugs.utils.
get_repo
()¶ Extract GitHub project name from git/hg config.
We check the git config for
hubugs.project
, and then fall back toremote.origin.url
. If both of these fail we check a mercurial root, to satisfy thehg-git
users.- Return type
- Returns
GitHub project name, including user