Bases: dict
Represents one item in feed. Must have url and title fields.
Stores automatically original_url key, which is necessary because plugins (eg. urlrewriters) may change url into something else and otherwise that information would be lost.
Entry will also transparently convert all ascii strings into unicode and raises EntryUnicodeError if conversion fails on any value being set. Such failures are catched by Feed and trigger abort().
Overridden so that our __getitem__ gets used for LazyFields
| Parameters: |
|
|---|---|
| Returns: | Value or given default |
| Parameters: | field (string) – Name of the field to check |
|---|---|
| Returns: | True if field is lazy loading. |
| Return type: | bool |
| Returns: | True if entry is valid. Return False if this cannot be used. |
|---|---|
| Return type: | bool |
Register a list of fields to be lazily loaded by callback func.
| Parameters: |
|
|---|
Renders a template string based on fields in the entry.
| Parameters: | template (string) – A template string that uses jinja2 or python string replacement format. |
|---|---|
| Returns: | The result of the rendering. |
| Return type: | string |
| Raises RenderError: | |
| If there is a problem. | |
Overridden so our __setitem__ is not avoided.
Takes a snapshot of the entry under name. Snapshots can be accessed via snapshots. :param string name: Snapshot name
| Parameters: |
|
|---|---|
| Returns: | Number of removed functions |
| Return type: | int |
Overridden so our __setitem__ is not avoided.
Populates entry fields from a source object using a dictionary that maps from entry field names to attributes (or keys) in the source object.
| Parameters: |
|
|---|
Bases: exceptions.Exception
This exception is thrown when trying to set non-unicode compatible field value to entry.
Bases: object
LazyField is a type of Entry field which is evaluated only when it’s value is requested. This way FlexGet can avoid doing heavy lookups from the internet or database for details that may not be needed ever.
Stores callback function(s) to which populates Entry fields. Callback is ran when it’s called or to get a string representation.
Provides small event framework
Bases: object
Represents one registered event.
| Parameters: |
|
|---|---|
| Returns: | Event created |
| Return type: | Event |
| Raises Exception: | |
If func is already registered in an event |
|
Register event to function with a decorator
Trigger an event with name. If event is not hooked by anything nothing happens.
| Parameters: |
|
|---|
| Parameters: | name (String) – event name |
|---|---|
| Returns: | List of Event for name ordered by priority |
Warning
Not implemented!
Bases: object
Represents one feed in the configuration.
Fires events:
feed.execute.before_plugin
Before a plugin is about to be executed. Note that since this will also include all builtin plugins the amount of calls can be quite high
parameters: feed, keyword
feed.execute.after_plugin
After a plugin has been executed.
parameters: feed, keyword
feed.execute.completed
After feed execution has been completed
parameters: feed
Abort this feed execution, no more plugins will be executed after the current one exists.
Accept entry immediately with optional but highly recommendable reason.
| Parameters: |
|
|---|
Disable phase from execution.
All disabled phases are re-enabled by Feed._reset() after feed execution has been completed.
| Parameters: | phase (string) – Name of phase |
|---|---|
| Raises ValueError: | |
| phase could not be found. | |
Executes the feed.
| Parameters: |
|
|---|
Fails entry immediately with optional but highly recommendable reason.
| Parameters: |
|
|---|
Find and return Entry with given attributes from feed or None
| Parameters: |
|
|---|---|
| Returns: | Entry or None |
Get currently enabled plugins.
| Parameters: | phase (string) – Optional, limits to plugins currently configured on given phase, sorted in phase order. |
|---|---|
| Returns: | An iterator over configured flexget.plugin.PluginInfo instances enabled on this feed. |
Purges rejected and failed entries. Failed entries will be removed from entries, accepted and rejected Rejected entries will be removed from entries and accepted
Reject entry immediately and permanently with optional but highly recommendable reason.
| Parameters: |
|
|---|
Immediately re-run the feed after execute has completed, feed can be re-run up to max_reruns times.
Add tracing message to entry.
Note
Not yet supported in any meaningful way
Iterate over undecided entries
Called during feed execution. Validates config, prints errors and aborts feed if invalid.
Plugin configuration validation. Return list of error messages that were detected.
Returns a validator for the ‘feeds’ key of config.
Bases: logging.Formatter
Custom formatter that can handle both regular log records and those created by FlexGetLogger
Bases: logging.Logger
Custom logger that adds feed and execution info to log records.
Log at TRACE level (more detailed than DEBUG).
Log at TRACE level (more detailed than DEBUG).
Log at VERBOSE level (displayed when FlexGet is run interactively.)
Bases: logging.Filter
Edits log messages and <hides> obviously private information.
Flushes memory logger to console
Prepare logging.
After initialization, start file logging.
Bases: object
Manager class for FlexGet
Fires events:
manager.startup
After manager has been initialized. This is when application becomes ready to use
manager.upgrade
Upgrade plugin database schemas etc
manager.execute.started
When execute is about the be started, this happens before any feed phases occur including on_process_start
manager.execute.completed
After manager has executed all Feeds
manager.shutdown
When the manager is exiting
Checks if there is already a lock, returns True if there is.
Creates instances of all configured feeds
Perform database cleanup if cleanup interval has been met.
Disables all feeds.
Enables all feeds.
Find the configuration file and then call load_config() to load it
Initialize SQLAlchemy
Separated from __init__ so that unit tests can modify options before loading config.
Warning
Calls sys.exit(1) if configuration file could not be loaded. This is something we probably want to change.
| Parameters: | config (string) – Path to configuration file |
|---|
Checks configuration file for common mistakes that are easily detectable
Execute process_end for all feeds.
| Parameters: | feeds (list) – Optional list of Feed instances, defaults to all. |
|---|
Execute process_start for feeds.
| Parameters: | feeds (list) – Optional list of Feed instances, defaults to all. |
|---|
Dumps current config to yaml config file
Set up the yaml loader to return unicode objects for strings by default
Application is being exited
Check all root level keywords are valid.
Registers a valid root level key for the config.
| Parameters: |
|
|---|
Bases: flexget.options.OptionParser
Contains all the options that should only be used when running without a ui
Bases: optparse.OptionParser
Contains all the options that both the core and webui should have
Plugin Loading & Management.
Bases: exceptions.Warning
Bases: exceptions.Exception
alias of PluginInfo
Adds a parser option to the global parser.
Adds a new feed phase to the available phases.
Get plugin by name, preferred way since this structure may be changed at some point.
Return an iterator over all plugins with in specified group.
Return iterator over all plugin keywords.
Return an iterator over all plugins that hook :phase:
Return all phases plugin :name: hooks
Bases: object
@internet decorator for plugin phase methods.
Catches all internet related exceptions and raises PluginError with relevant message. Feed handles PluginErrors by aborting the feed.
Priority decorator for phase methods
Bases: type
Metaclass for objects returned by versioned_base factory
Bases: sqlalchemy.ext.declarative.Base
Sets the schema version to most recent for a plugin when it’s tables are freshly created.
Used as a decorator to register a schema upgrade function.
The wrapped function will be passed the current schema version and a session object. The function should return the new version of the schema after the upgrade.
There is no need to commit the session, it will commit automatically if an upgraded schema version is returned.
Example:
from flexget import schema
@schema.upgrade('your_plugin')
def upgrade(ver, session):
if ver == 2:
# upgrade
ver = 3
return ver
Returns a class which can be used like Base, but automatically stores schema version when tables are created.
Bases: flexget.validator.Validator
Bases: flexget.validator.Validator
Bases: flexget.validator.Validator
| Parameters: |
|
|---|
Same as accept but with multiple values (list)
Bases: flexget.validator.Validator
Bases: flexget.validator.Validator
| Parameters: |
|
|---|---|
| Raises ValueError: | |
key was not specified |
|
Accepts any leftover keys in dictionary, which will be validated with value
Accepts keys that pass a given validator, and validates them using validator specified in value
| Parameters: |
|
|---|---|
| Raises ValueError: | |
If both key_type and key_validator are specified. |
|
Rejects a key
Reject list of keys
Flag key as mandatory
Bases: flexget.validator.Validator
Bases: object
Create and hold validator error messages.
Add new error message to current path.
Remove last num errors from list
Return number of errors.
Adds level into error message path
Removes level from path by depth number
Updates path level value
Bases: flexget.validator.TextValidator
Bases: flexget.validator.Validator
Bases: flexget.validator.RegexpMatchValidator
Bases: object
Acts as a wrapper for a Validator instance, but does not generate the instance until one of its attributes needs to be accessed. Used to create validators that may otherwise cause endless loops.
Return the schema of our instance if it has already been created, otherwise return ‘ondemand’ type.
Bases: flexget.validator.Validator
Bases: flexget.validator.Validator
Bases: flexget.validator.TextValidator
Bases: flexget.validator.Validator
Bases: flexget.validator.Validator
Bases: flexget.validator.Validator
Bases: flexget.validator.Validator
Bases: flexget.validator.TextValidator
Bases: object
Recursively return the Errors class from the root of the validator tree.
Returns a child validator of this one.
| Parameters: |
|
|---|
Return schema for validator
Validate given data and log errors, return True if passed and False if not.
Helper method. Validate item against list of rules (validators). Return True if item passed any of the rules, False if none of the rules pass item.
Return True if validator can be used to validate given data, False otherwise.
Factory method, returns validator instance.