phabricator¶
Phabricator module.
-
exception
spicerack.phabricator.
PhabricatorError
[source]¶ Bases:
spicerack.exceptions.SpicerackError
Custom exception class for errors of the Phabricator class.
-
class
spicerack.phabricator.
Phabricator
(phabricator_client: phabricator.Phabricator, dry_run: bool = True)[source]¶ Bases:
object
Class to interact with a Phabricator website.
Initialize the Phabricator client from the bot config file.
- Parameters
phabricator_client (phabricator.Phabricator) -- a Phabricator client instance.
dry_run (bool, optional) -- whether this is a DRY-RUN.
-
spicerack.phabricator.
create_phabricator
(bot_config_file: str, section: str = 'phabricator_bot', dry_run: bool = True) → phabricator.Phabricator[source]¶ Initialize the Phabricator client from the bot config file.
- Parameters
bot_config_file (str) --
the path to the configuration file for the Phabricator bot, with the following structure:
[section_name] host = https://phabricator.example.com/api/ username = phab-bot token = api-12345
section (str, optional) -- the name of the section of the configuration file where to find the required parameters.
dry_run (bool, optional) -- whether this is a DRY-RUN.
- Returns
a Phabricator instance.
- Return type
- Raises
spicerack.phabricator.PhabricatorError -- if unable to get all the required parameters from the bot configuration file, or to initialize the Phabricator client.