poacher package

Module contents

class poacher.GithubPoacher(poll_delay_seconds=2.0, github_retries=10, github_retry_delay_seconds=2.0)

Bases: object

Base class containing functionality to poll github.com for new repositories. Extend this class and override poacher.GithubPoacher.on_repo to get information about new repositories as they are created.

authenticate(username, password)

Authenticate with Github

Parameters:
  • username (str) – Github username
  • password (str) – Github password
main_loop(start_id=99525181)

Find the latest repository on github.com and start polling to get new repositories as they become available. This method never returns.

Parameters:startid (int) – github repository ID for a known existing repository on github.com to start binary search for latest repository
on_lock(repo_id)

Override this method. This method will be called when the binary search for the latest repo ID in GithubPoacher.main_loop is complete

Parameters:repo_id (int) – result of binary search (latest repository ID)
on_repo(repo)

Override this method. This method will be called by GithubPoacher.main_loop whenever a new Github repo is created.

Parameters:repo (PyGithub.Repo) – Repo object for repository (see PyGithub documentation)
on_repos_processed(num)

Override this method. This method will be called in each iteration of GithubPoacher.main_loop, after GithubPoacher.on_repo has been called for all new repos returned by a request to github.com

Parameters:num (int) – the number of new repositories processed
on_search_iteration(lower, upper)

Override this method. This method will be called each time the search parameters are updated during the initial binary search for the latest repository ID in GithubPoacher.main_loop.

Parameters:
  • lower (int) – lowest repository ID in search area
  • upper (int) – highest repository ID in search area