A configuration option.
Attr value: | The default value for the option or a list of available options if :attr selectable: is True |
---|---|
Attr docstring: | A string explaining the configuration option |
Attr selectable: | |
Make the PluginOption a selectable, i.e. value contains a list or tuple of acceptable values for this option, with the first member being the default selection. |
Plugin base class.
Allows a plugin to define its configuration keys.
The returned dictionary has to be flat (i.e. no nested dicts) and contain a PluginOption object for each key.
Example:
{
'a_setting': PluginOption(value='default_value'),
'another_setting': PluginOption(value=[1, 2, 3],
docstring="A list of things"),
# In this case, 'full-fat' would be the default value
'milk': PluginOption(value=('full-fat', 'skim'),
docstring="Type of milk",
selectable=True),
}
Returns: | dict with unicode: PluginOption(value, docstring, selection) |
---|
Initialize the plugin.
Parameters: | config (confit.ConfigView) – The global configuration object, by default only the section with plugin-specific values gets stored in the config attribute, if the plugin has a __name__ attribute. |
---|
Base class for devices.
Subclass to implement support for different devices.
Tuple of DeviceFeatures constants that designate the features the device offers.
Set connection information and other properties.
Parameters: |
|
---|
Set the device target page, if applicable.
Parameters: | target_page (unicode in (u”odd”, u”even”)) – The target page |
---|
Prepare device for scanning.
What this means exactly is up to the implementation and the type, of device, usually it involves things like switching into record mode, path and applying all relevant settings.
Parameters: | path (pathlib.Path) – Project base path |
---|
Capture a single image with the device.
Parameters: | path (pathlib.Path) – Path for the image |
---|
Add functionality to any of spreads’ commands by implementing one or more of the available hooks.
Parameters: | rootparser (argparse.ArgumentParser) – The root parser that this plugin should add a subparser to. |
---|
Perform some action before capturing begins.
Parameters: |
|
---|
Perform some action after each successful capture.
Parameters: |
|
---|
Perform some action after capturing has finished.
Parameters: |
|
---|
Parameters: | path (pathlib.Path) – Project path |
---|
Assemble an output file from the postprocessed images.
Parameters: | path (pathlib.Path) – Project path |
---|
Initialize the plugin.
Parameters: | config (confit.ConfigView) – The global configuration object, by default only the section with plugin-specific values gets stored in the config attribute, if the plugin has a __name__ attribute. |
---|
Allows a plugin to define its configuration keys.
The returned dictionary has to be flat (i.e. no nested dicts) and contain a PluginOption object for each key.
Example:
{
'a_setting': PluginOption(value='default_value'),
'another_setting': PluginOption(value=[1, 2, 3],
docstring="A list of things"),
# In this case, 'full-fat' would be the default value
'milk': PluginOption(value=('full-fat', 'skim'),
docstring="Type of milk",
selectable=True),
}
Returns: | dict with unicode: PluginOption(value, docstring, selection) |
---|
Initialize configured devices.
Find all extensions that implement certain hooks.
Parameters: | hooks (list(unicode)) – A list of hook method names |
---|---|
Returns: | A generator that yields relevant extensions |
Return type: | generator(Extension) |
Various utility functions.
Find executable in $PATH.
Parameters: | name (unicode) – name of the executable |
---|---|
Returns: | bool – True if name is found or False |
New decorator class that implements the @abstractclassmethod decorator added in Python 3.3 for Python 2.7.
Kudos to http://stackoverflow.com/a/13640018/487903
A colorized output SteamHandler Kudos to Leigh MacDonald: http://leigh.cudd.li/article/Cross_Platform_Colorized_Logger_Output_Using_Pythons_logging_Module_And_Colorama
Check if we are using a “real” TTY. If we are not using a TTY it means that the colour output should be disabled.
Returns: | Using a TTY status |
---|---|
Return type: | bool |