repo.py¶
- class mirrors.repo.Repo(name, config)[source]¶
- __init__(name, config)[source]¶
A repo object which stores info about a single repo.
Parameters: - name (str) – Name of repo
- config (ConfigParser.ConfigParser) – running config options
- __weakref__¶
list of weak references to the object (if defined)
- class rsync_thread(name, config)[source]¶
Extended threading.Thread class to control rsync via subprocess.
Parameters: - name (str) – Name of repo
- config (Configparser.Configparser) – Running config options
- Repo.running_time()[source]¶
Total running time of active sync.
Return type: int Returns: An int of total syncing time elapsed Return type: None Returns: None if not syncing
- class mirrors.repo.RepoManager(config)[source]¶
- __init__(config)[source]¶
Singleton manager of the repositories and threading.
Parameters: config (Configparser.Configparser) – Running config options
- __metaclass__¶
alias of Singleton
- __weakref__¶
list of weak references to the object (if defined)
- activate(name)[source]¶
Activate repo for syncing.
Parameters: name (str) – Name of Repo Raises Repo.RepoError: if no repo exists by given name
- add_repo(name)[source]¶
Create a repo for a section in the running config.
Parameters: name (str) – Name of repo Raises Repo.RepoConfigError: if no config exists for given repo name
- deactivate(name)[source]¶
Deactivate repo from syncing.
Parameters: name (str) – Name of repo Raises Repo.RepoError: if no repo exists by given name
- del_repo(name)[source]¶
Delete repo object from dict.
Parameters: name (str) – Name of repo Raises Repo.RepoError: if no repo exists by passed in name.
- enqueue(name)[source]¶
Add repo to the queue.
Parameters: name (str) – Name of repo Raises Repo.RepoError: if repo is already queued or doesn’t exist