repocribro.commands

assign_role

repocribro.commands.assign_role._assign_role(login, role_name)

check_config

repocribro.commands.check_config._check_config(style)

db_create

repocribro.commands.db_create._db_create()

repocheck

class repocribro.commands.repocheck.RepocheckCommand
__dict__ = mappingproxy({'__module__': 'repocribro.commands.repocheck', 'event2webhook': {'PushEvent': 'push', 'ReleaseEvent': 'release', 'RepositoryEvent': 'repository'}, 'run': <function RepocheckCommand.run>, '_do_check': <function RepocheckCommand._do_check>, '_process_event': <function RepocheckCommand._process_event>, '__dict__': <attribute '__dict__' of 'RepocheckCommand' objects>, '__weakref__': <attribute '__weakref__' of 'RepocheckCommand' objects>, '__doc__': None})
__module__ = 'repocribro.commands.repocheck'
__weakref__

list of weak references to the object (if defined)

_do_check(repo)

Perform single repository check for new events

Parameters:repo (repocribro.models.Repository) – Repository to be checked
Raises:SystemExit – if GitHub API request fails

Todo

handle pagination of GitHub events

_process_event(repo, event)

Process potentially new event for repository

Parameters:
  • repo (repocribro.models.Repository) – Repository related to event
  • event (dict) – GitHub event data
Returns:

If the event was new or already registered before

Return type:

bool

event2webhook = {'PushEvent': 'push', 'ReleaseEvent': 'release', 'RepositoryEvent': 'repository'}
run(full_name=None)

Run the repocheck command to check repo(s) new events

Obviously this procedure can check events only on public repositories. If name of repository is not specified, then procedure will be called on all registered public repositories in DB.

Parameters:full_name (str) – Name of repository to be checked (if None -> all)
Raises:SystemExit – If repository with given full_name does not exist
repocribro.commands.repocheck._repocheck(full_name=None)