ghia package

Submodules

ghia.cli module

ghia.common module

class ghia.common.GHIA(token, rules, fallback_label, dry_run, ghia_strategy, is_async=False)[source]

Bases: object

DEFAULT_STRATEGY = 'append'
ENVVAR_CONFIG = 'GHIA_CONFIG'
ENVVAR_DRYRUN = 'GHIA_DRYRUN'
ENVVAR_STRATEGY = 'GHIA_STRATEGY'
MATCHERS = {'any': <function _match_any>, 'label': <function _match_label>, 'text': <function _match_text>, 'title': <function _match_title>}
STRATEGIES = {'append': <function _strategy_append>, 'change': <function _strategy_change>, 'set': <function _strategy_set>}
add_observer(name, observer)[source]
call_observers(method, *args, **kwargs)[source]
remove_observer(name)[source]
run(slugs)[source]
run_inner(owner, repo)[source]
run_issue(owner, repo, issue)[source]
class ghia.common.PrinterObserver[source]

Bases: object

static assignees(old, new)[source]
static error(message, of_issue=False)[source]
static fallbacked(label, added=True, enabled=True)[source]
static issue(owner, repo, issue)[source]
ghia.common.get_rules(ctx, param, config_rules)[source]

Extract labels from labels config and do the checks config_rules: ConfigParser with loaded configuration of labels

ghia.common.get_token(ctx, param, config_auth)[source]

Extract token from auth config and do the checks config_auth: ConfigParser with loaded configuration of auth

ghia.common.parse_rules(cfg)[source]

Parse labels to dict where label is key and list of patterns is corresponding value cfg: ConfigParser with loaded configuration of labels

ghia.github module

class ghia.github.GitHub(token, session=None, is_async=False)[source]

Bases: object

This class can communicate with the GitHub API just give it a token and go.

API = 'https://api.github.com'
issues(owner, repo, state='open', assignee=None)[source]

Get issues of a repo owner: GitHub user or org repo: repo name state: open, closed, all (default open) assignee: optional filter for assignees (None, “none”, “<username>”, or “*”)

set_issue_assignees(owner, repo, number, assignees)[source]

Sets assignees for the issue. Replaces all existing assignees. owner: GitHub user or org repo: repo name number: issue id assignees: list of usernames (as strings)

set_issue_assignees_async(owner, repo, number, assignees)[source]

Sets assignees for the issue. Replaces all existing assignees. owner: GitHub user or org repo: repo name number: issue id assignees: list of usernames (as strings)

set_issue_labels(owner, repo, number, labels)[source]

Sets labels for the issue. Replaces all existing labels. owner: GitHub user or org repo: repo name number: issue id labels: list of labels (as strings)

set_issue_labels_async(owner, repo, number, labels)[source]

Sets assignees for the issue. Replaces all existing assignees. owner: GitHub user or org repo: repo name number: issue id assignees: list of usernames (as strings)

user()[source]

Get current user authenticated by token

ghia.web module

ghia.web.create_app(*args, **kwargs)[source]
ghia.web.index()[source]
ghia.web.load_config_web(app)[source]
ghia.web.process_webhook_issues(payload)[source]

Process webhook event “issue” payload: event payload

ghia.web.process_webhook_ping(payload)[source]

Process webhook event “ping” payload: event payload

ghia.web.webhook_listener()[source]
ghia.web.webhook_verify_signature(payload, signature, secret, encoding='utf-8')[source]

Verify the payload with given signature against given secret see https://developer.github.com/webhooks/securing/ payload: received data as dict signature: included SHA1 signature of payload (with secret) secret: secret to verify signature encoding: encoding for secret (optional)

Module contents