deluge.ui.console package

Subpackages

Submodules

deluge.ui.console.colors module

exception deluge.ui.console.colors.BadColorString

Bases: exceptions.Exception

deluge.ui.console.colors.get_line_length(line, encoding='UTF-8')

Returns the string length without the color formatting.

deluge.ui.console.colors.get_line_width(line, encoding='UTF-8')

Get width of string considering double width characters

deluge.ui.console.colors.init_colors()
deluge.ui.console.colors.parse_color_string(s, encoding='UTF-8')

Parses a string and returns a list of 2-tuples (color, string).

:param s:, string to parse :param encoding: the encoding to use on output

deluge.ui.console.colors.replace_tabs(line)

Returns a string with tabs replaced with spaces.

deluge.ui.console.colors.strip_colors(line)

Returns a string with the color formatting removed.

deluge.ui.console.commander module

class deluge.ui.console.commander.Commander(cmds, interactive=False)
do_command(cmd)

Processes a command.

Parameters:cmd – str, the command string
exec_args(args, host, port, username, password)
write(line)

deluge.ui.console.eventlog module

class deluge.ui.console.eventlog.EventLog

Bases: deluge.component.Component

Prints out certain events as they are received from the core.

on_config_value_changed_event(key, value)
on_new_version_available_event(version)
on_plugin_disabled_event(name)
on_plugin_enabled_event(name)
on_session_paused_event()
on_session_resumed_event()
on_torrent_added_event(torrent_id, from_state)
on_torrent_finished_event(torrent_id)
on_torrent_removed_event(torrent_id)
on_torrent_state_changed_event(torrent_id, state)
write(s)

deluge.ui.console.main module

class deluge.ui.console.main.BaseCommand

Bases: object

aliases = []
complete(text, *args)
create_parser()
epilog
handle(*args, **options)
interactive_only = False
name
option_list = ()
split(text)
usage = 'usage'
class deluge.ui.console.main.Console

Bases: deluge.ui.ui._UI

help = 'Starts the Deluge console interface'
start()
class deluge.ui.console.main.ConsoleUI(args=None, cmds=None, daemon=None)

Bases: deluge.component.Component

get_torrent_name(torrent_id)
match_torrent(string)

Returns a list of torrent_id matches for the string. It will search both torrent_ids and torrent names, but will only return torrent_ids.

Parameters:string – str, the string to match on
Returns:list of matching torrent_ids. Will return an empty list if no matches are found.
on_client_disconnect()
run(stdscr)

This method is called by the curses.wrapper to start the mainloop and screen.

Parameters:stdscr – curses screen passed in from curses.wrapper
set_batch_write(batch)
set_mode(mode)
start()
tab_complete_path(line, type='file', ext='', sort='name', dirs_first=True)
tab_complete_torrent(line)
write(s)
write_event(s)
class deluge.ui.console.main.DelugeHelpFormatter(indent_increment=2, max_help_position=24, width=None, short_first=1)

Bases: optparse.IndentedHelpFormatter

Format help in a way suited to deluge Legacy mode - colors, format, indentation...

format_option(option)
format_usage(usage)
replace_dict = {'(?<![\\-a-z])(-[a-zA-Z0-9])': '{!red!}%s{!input!}', '<tab>': '{!white!}%s{!input!}', '\\s\\*\\s': '{!blue!}%s{!input!}', '<state>': '{!yellow!}%s{!input!}', '[_A-Z]{3,}': '{!cyan!}%s{!input!}', '(\\[|\\])': '{!info!}%s{!input!}', '<download-folder>': '{!yellow!}%s{!input!}', '<torrent-id>': '{!green!}%s{!input!}', '\\.\\.\\.': '{!yellow!}%s{!input!}', '--[_\\-a-zA-Z0-9]+': '{!green!}%s{!input!}', '<torrent-file>': '{!green!}%s{!input!}'}
class deluge.ui.console.main.OptionParser(**kwargs)

Bases: optparse.OptionParser

subclass from optparse.OptionParser so exit() won’t exit.

error(msg : string)

Print a usage message incorporating ‘msg’ to stderr and exit. If you override this in a subclass, it should not return – it should either exit or raise an exception.

exit(status=0, msg=None)
format_option_help(formatter=None)
print_help(file=None)
print_usage(file=None)
deluge.ui.console.main.load_commands(command_dir, exclude=[])
deluge.ui.console.main.start()

deluge.ui.console.statusbars module

class deluge.ui.console.statusbars.StatusBars

Bases: deluge.component.Component

start()
update()
update_statusbars()

Module contents