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:
object
Decorator for interactive commands.
-
QUIT_RC
= 75¶
-
-
class
pyrocore.scripts.base.
ScriptBase
[source]¶ Bases:
object
Base class for command line interfaces.
-
ADDITIONAL_HELP
= []¶
-
ARGS_HELP
= '<log-base>...'¶
-
COPYRIGHT
= 'Copyright (c) 2009 - 2018 Pyroscope Project'¶
-
LOGGING_CFG
= '~/.pyroscope/logging.%s.ini'¶
-
STD_LOG_LEVEL
= 20¶
-
VERSION
= None¶
-
-
class
pyrocore.scripts.base.
ScriptBaseWithConfig
[source]¶ Bases:
pyrocore.scripts.base.ScriptBase
CLI tool with configuration support.
-
CONFIG_DIR_DEFAULT
= '~/.pyroscope'¶
-
OPTIONAL_CFG_FILES
= []¶
-
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.ScriptBaseWithConfig
Change 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.ScriptBaseWithConfig
Check 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.ScriptBase
List 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.ScriptBaseWithConfig
Create 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.ScriptBaseWithConfig
Support for administrative tasks.
-
ARGS_HELP
= u''¶
-
CONFIG_DIRS
= [u'log', u'data', u'run', u'htdocs']¶
-
OPTIONAL_CFG_FILES
= [u'torque.ini']¶
-
RC_CONTINUATION_THRESHOLD
= 50¶
-
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:
object
Collect statistical values for the fields of a search result.
-
average
¶ Calculate average
-
-
class
pyrocore.scripts.rtcontrol.
RtorrentControl
[source]¶ Bases:
pyrocore.scripts.base.ScriptBaseWithConfig
Control 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.']¶
-
ALTER_MODES
= ('append', 'remove')¶
-
ARGS_HELP
= '<filter>...'¶
-
FORMATTER_DEFAULTS
= {'now': 1631572075.478669}¶
-
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.ScriptBaseWithConfig
Handle 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.ScriptBaseWithConfig
Move data actively seeded in rTorrent.
-
ARGS_HELP
= '<source>... <target>'¶
-
PREFETCH_FIELDS
= ['hash', 'name', 'size', 'path', 'is_complete']¶
-
pyrocore.scripts.rtsweep module¶
Rtorrent disk space management.
Copyright (c) 2018 The PyroScope Project <pyroscope.project@gmail.com>
-
class
pyrocore.scripts.rtsweep.
RtorrentSweep
[source]¶ Bases:
pyrocore.scripts.base.ScriptBaseWithConfig
Manage disk space by deleting items loaded into rTorrent, including their data, following configured rules that define an order of what to remove first.
The required space is passed as the first argument, either in bytes or qualified with a unit character (K=KiB, M=MiB, G=GiB). Alternatively, you can pass a metafile path, with the requirement calculated from its content size.
Use “show” instead to list the active rules, ordered by their priority.
-
ARGS_HELP
= '<space requirement>|SHOW'¶
-
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.ScriptBaseWithConfig
Perform raw rTorrent XMLRPC calls, like “rtxmlrpc throttle.global_up.max_rate”. To enter a XMLRPC REPL, pass no arguments at all.
Start arguments with “+” or “-” to indicate they’re numbers (type i4 or i8). Use “[1,2,…” for arrays. Use “@” to indicate binary data, which can be followed by a file path (e.g. “@/path/to/file”), a URL (https, http, ftp, and file are supported), or ‘-’ to read from stdin.
-
ARGS_HELP
= '<method> <args>... |\n -i <commands>... | -i @<filename> | -i @- |\n --session <session-file>... | --session <directory> |\n --session @<filename-list> | --session @-'¶
-
STD_LOG_LEVEL
= 10¶
-