pyrocore.scripts package¶
Basic Command Line Scripts.
Copyright (c) 2009 The PyroScope Project <pyroscope.project@gmail.com>
Submodules¶
pyrocore.scripts.base module¶
Command Line Script Support.
Copyright (c) 2009, 2010 The PyroScope Project <pyroscope.project@gmail.com>
-
class
pyrocore.scripts.base.PromptDecorator(script_obj)[source]¶ Bases:
objectDecorator for interactive commands.
-
QUIT_RC= 75¶
-
-
class
pyrocore.scripts.base.ScriptBase[source]¶ Bases:
objectBase class for command line interfaces.
-
ADDITIONAL_HELP= []¶
-
ARGS_HELP= '<log-base>...'¶
-
COPYRIGHT= 'Copyright (c) 2009 - 2017 Pyroscope Project'¶
-
LOGGING_CFG= '~/.pyroscope/logging.%s.ini'¶
-
STD_LOG_LEVEL= 20¶
-
VERSION= None¶
-
pyrocore.scripts.chtor module¶
Metafile Editor.
Copyright (c) 2010 The PyroScope Project <pyroscope.project@gmail.com>
-
class
pyrocore.scripts.chtor.MetafileChanger[source]¶ Bases:
pyrocore.scripts.base.ScriptBaseWithConfigChange attributes of a bittorrent metafile.
-
ARGS_HELP= '<metafile>...'¶
-
RT_RESUMT_KEYS= ('libtorrent_resume', 'log_callback', 'err_callback', 'rtorrent')¶
-
pyrocore.scripts.hashcheck module¶
Metafile Checker.
Copyright (c) 2011 The PyroScope Project <pyroscope.project@gmail.com>
-
class
pyrocore.scripts.hashcheck.MetafileChecker[source]¶ Bases:
pyrocore.scripts.base.ScriptBaseWithConfigCheck a bittorrent metafile.
-
ARGS_HELP= '<metafile> [<data-dir-or-file>]'¶
-
pyrocore.scripts.lstor module¶
Metafile Lister.
Copyright (c) 2009, 2010, 2011 The PyroScope Project <pyroscope.project@gmail.com>
-
class
pyrocore.scripts.lstor.MetafileLister[source]¶ Bases:
pyrocore.scripts.base.ScriptBaseList contents of a bittorrent metafile.
-
ARGS_HELP= '<metafile>...'¶
-
pyrocore.scripts.mktor module¶
Metafile Creator.
Copyright (c) 2009, 2010, 2011 The PyroScope Project <pyroscope.project@gmail.com>
-
class
pyrocore.scripts.mktor.MetafileCreator[source]¶ Bases:
pyrocore.scripts.base.ScriptBaseWithConfigCreate a bittorrent metafile.
If passed a magnet URI as the only argument, a metafile is created in the directory specified via the configuration value ‘magnet_watch’, loadable by rTorrent. Which means you can register ‘mktor’ as a magnet: URL handler in Firefox.
-
ARGS_HELP= '<dir-or-file> <tracker-url-or-alias>... | <magnet-uri>'¶
-
ENTROPY_BITS= 512¶
-
pyrocore.scripts.pyroadmin module¶
Administration Tool.
Copyright (c) 2010 The PyroScope Project <pyroscope.project@gmail.com>
-
class
pyrocore.scripts.pyroadmin.AdminTool[source]¶ Bases:
pyrocore.scripts.base.ScriptBaseWithConfigSupport for administrative tasks.
-
ARGS_HELP= ''¶
-
CONFIG_DIRS= ['log', 'data', 'run', 'htdocs']¶
-
OPTIONAL_CFG_FILES= ['torque.ini']¶
-
RC_CONTINUATION_THRESHOLD= 55¶
-
pyrocore.scripts.pyrotorque module¶
rTorrent queue manager & daemon.
Copyright (c) 2012 The PyroScope Project <pyroscope.project@gmail.com>
pyrocore.scripts.rtcontrol module¶
rTorrent Control.
Copyright (c) 2010, 2011 The PyroScope Project <pyroscope.project@gmail.com>
-
class
pyrocore.scripts.rtcontrol.FieldStatistics(size)[source]¶ Bases:
objectCollect statistical values for the fields of a search result.
-
average¶ Calculate average
-
-
class
pyrocore.scripts.rtcontrol.RtorrentControl[source]¶ Bases:
pyrocore.scripts.base.ScriptBaseWithConfigControl and inspect rTorrent from the command line.
Filter expressions take the form “<field>=<value>”, and all expressions must be met (AND). If a field name is omitted, “name” is assumed. You can also use uppercase OR to build a list of alternative conditions.
For numeric fields, a leading “+” means greater than, a leading “-” means less than. For string fields, the value is a glob pattern (*, ?, [a-z], [!a-z]), or a regex match enclosed by slashes. All string comparisons are case-ignoring. Multiple values separated by a comma indicate several possible choices (OR). ”!” in front of a filter value negates it (NOT).
See https://pyrocore.readthedocs.io/en/latest/usage.html#rtcontrol for more.
- Examples:
- All 1:1 seeds ratio=+1
- All active torrents xfer=+0
- All seeding torrents up=+0
- Slow torrents down=+0 down=-5k
- Older than 2 weeks completed=+2w
- Big stuff size=+4g
- 1:1 seeds not on NAS ratio=+1 ‘realpath=!/mnt/*‘
- Music kind=flac,mp3
-
ACTION_MODES= (Bunch(help='start torrent', name='start', options=('--start',)), Bunch(help='stop torrent', method='stop', name='close', options=('--close', '--stop')), Bunch(help='hash-check torrent', interactive=True, label='HASH', name='hash_check', options=('-H', '--hash-check')), Bunch(help='remove torrent from client', interactive=True, name='delete', options=('--delete',)), Bunch(help='delete PARTIAL data files and remove torrent from client', interactive=True, name='purge', options=('--purge', '--delete-partial')), Bunch(help='delete ALL data files and remove torrent from client', interactive=True, name='cull', options=('--cull', '--exterminate', '--delete-all')), Bunch(argshelp='NAME', help='assign to named throttle group (NULL=unlimited, NONE=global)', interactive=True, method='set_throttle', name='throttle', options=('-T', '--throttle')), Bunch(argshelp='"TAG +TAG -TAG..."', help='add or remove tag(s)', interactive=False, name='tag', options=('--tag',)), Bunch(argshelp='KEY=VALUE', help="set value of 'custom_KEY' field (KEY might also be 1..5)", interactive=False, label='SET_CUSTOM', method='set_custom', name='custom', options=('--custom',)), Bunch(argshelp='CMD', help='execute XMLRPC command pattern', interactive=True, label='EXEC', method='execute', name='exec', options=('--exec', '--xmlrpc')))¶
-
ADDITIONAL_HELP= ['', '', 'Use --help to get a list of all options.', 'Use --help-fields to list all fields and their description.']¶
-
ARGS_HELP= '<filter>...'¶
-
FORMATTER_DEFAULTS= {'now': 1497295925.405155}¶
-
IGNORE_OPTIONS= ('0', '1')¶
-
PRIO_OPTIONS= ('0', '1', '2', '3')¶
-
anneal(mode, matches, orig_matches)[source]¶ Perform post-processing.
Return True when any changes were applied.
pyrocore.scripts.rtevent module¶
Rtorrent event handler.
Copyright (c) 2011 The PyroScope Project <pyroscope.project@gmail.com>
-
class
pyrocore.scripts.rtevent.RtorrentEventHandler[source]¶ Bases:
pyrocore.scripts.base.ScriptBaseWithConfigHandle rTorrent events.
-
ARGS_HELP= '<event> <infohash> [<args>...]'¶
-
pyrocore.scripts.rtmv module¶
Move seeding data.
Copyright (c) 2010, 2011 The PyroScope Project <pyroscope.project@gmail.com>
-
class
pyrocore.scripts.rtmv.RtorrentMove[source]¶ Bases:
pyrocore.scripts.base.ScriptBaseWithConfigMove data actively seeded in rTorrent.
-
ARGS_HELP= '<source>... <target>'¶
-
PREFETCH_FIELDS= ['hash', 'name', 'size', 'path', 'is_complete']¶
-
pyrocore.scripts.rtxmlrpc module¶
Perform raw XMLRPC calls.
Copyright (c) 2010 The PyroScope Project <pyroscope.project@gmail.com>
-
class
pyrocore.scripts.rtxmlrpc.RtorrentXmlRpc[source]¶ Bases:
pyrocore.scripts.base.ScriptBaseWithConfigPerform raw rTorrent XMLRPC calls, like “rtxmlrpc throttle.global_up.max_rate”.
Start arguments with “+” or “-” to indicate they’re numbers (type i4 or i8). Use “[1,2,...” for arrays.
-
ARGS_HELP= '<method> <args>...'¶
-
STD_LOG_LEVEL= 10¶
-