From 10fdd76e3d2af66b27b6640c4339a86ff5d799c2 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sat, 8 Nov 2008 07:20:49 +0000 Subject: [PATCH] Rename 'null2' to 'console' --- deluge/ui/{null2 => console}/__init__.py | 0 deluge/ui/{null2 => console}/colors.py | 0 deluge/ui/{null2 => console}/commands/__init__.py | 0 deluge/ui/{null2 => console}/commands/add.py | 6 +++--- deluge/ui/{null2 => console}/commands/config.py | 4 ++-- deluge/ui/{null2 => console}/commands/connect.py | 4 ++-- deluge/ui/{null2 => console}/commands/debug.py | 4 ++-- deluge/ui/{null2 => console}/commands/halt.py | 6 +++--- deluge/ui/{null2 => console}/commands/help.py | 6 +++--- deluge/ui/{null2 => console}/commands/info.py | 6 +++--- deluge/ui/{null2 => console}/commands/pause.py | 6 +++--- deluge/ui/{null2 => console}/commands/quit.py | 2 +- deluge/ui/{null2 => console}/commands/resume.py | 6 +++--- deluge/ui/{null2 => console}/commands/rm.py | 6 +++--- deluge/ui/{null2 => console}/main.py | 10 +++++----- deluge/ui/{null2 => console}/mapping.py | 4 ++-- deluge/ui/ui.py | 8 ++++---- 17 files changed, 39 insertions(+), 39 deletions(-) rename deluge/ui/{null2 => console}/__init__.py (100%) rename deluge/ui/{null2 => console}/colors.py (100%) rename deluge/ui/{null2 => console}/commands/__init__.py (100%) rename deluge/ui/{null2 => console}/commands/add.py (88%) rename deluge/ui/{null2 => console}/commands/config.py (96%) rename deluge/ui/{null2 => console}/commands/connect.py (78%) rename deluge/ui/{null2 => console}/commands/debug.py (81%) rename deluge/ui/{null2 => console}/commands/halt.py (56%) rename deluge/ui/{null2 => console}/commands/help.py (90%) rename deluge/ui/{null2 => console}/commands/info.py (96%) rename deluge/ui/{null2 => console}/commands/pause.py (84%) rename deluge/ui/{null2 => console}/commands/quit.py (83%) rename deluge/ui/{null2 => console}/commands/resume.py (84%) rename deluge/ui/{null2 => console}/commands/rm.py (87%) rename deluge/ui/{null2 => console}/main.py (95%) rename deluge/ui/{null2 => console}/mapping.py (95%) diff --git a/deluge/ui/null2/__init__.py b/deluge/ui/console/__init__.py similarity index 100% rename from deluge/ui/null2/__init__.py rename to deluge/ui/console/__init__.py diff --git a/deluge/ui/null2/colors.py b/deluge/ui/console/colors.py similarity index 100% rename from deluge/ui/null2/colors.py rename to deluge/ui/console/colors.py diff --git a/deluge/ui/null2/commands/__init__.py b/deluge/ui/console/commands/__init__.py similarity index 100% rename from deluge/ui/null2/commands/__init__.py rename to deluge/ui/console/commands/__init__.py diff --git a/deluge/ui/null2/commands/add.py b/deluge/ui/console/commands/add.py similarity index 88% rename from deluge/ui/null2/commands/add.py rename to deluge/ui/console/commands/add.py index f7f22db39..cc5a91a2f 100644 --- a/deluge/ui/null2/commands/add.py +++ b/deluge/ui/console/commands/add.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -from deluge.ui.null2.main import BaseCommand, match_torrents -from deluge.ui.null2 import mapping -from deluge.ui.null2.colors import templates +from deluge.ui.console.main import BaseCommand, match_torrents +from deluge.ui.console import mapping +from deluge.ui.console.colors import templates from deluge.ui.client import aclient as client from optparse import make_option import os diff --git a/deluge/ui/null2/commands/config.py b/deluge/ui/console/commands/config.py similarity index 96% rename from deluge/ui/null2/commands/config.py rename to deluge/ui/console/commands/config.py index 8aa21748a..0a900283a 100644 --- a/deluge/ui/null2/commands/config.py +++ b/deluge/ui/console/commands/config.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -from deluge.ui.null2.main import BaseCommand, match_torrents -from deluge.ui.null2.colors import templates, default_style as style +from deluge.ui.console.main import BaseCommand, match_torrents +from deluge.ui.console.colors import templates, default_style as style from deluge.ui.client import aclient as client from optparse import make_option import re diff --git a/deluge/ui/null2/commands/connect.py b/deluge/ui/console/commands/connect.py similarity index 78% rename from deluge/ui/null2/commands/connect.py rename to deluge/ui/console/commands/connect.py index 7834164a3..4c9ddddd4 100644 --- a/deluge/ui/null2/commands/connect.py +++ b/deluge/ui/console/commands/connect.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -from deluge.ui.null2.main import BaseCommand -from deluge.ui.null2.colors import templates, default_style as style +from deluge.ui.console.main import BaseCommand +from deluge.ui.console.colors import templates, default_style as style from deluge.ui.client import aclient as client class Command(BaseCommand): diff --git a/deluge/ui/null2/commands/debug.py b/deluge/ui/console/commands/debug.py similarity index 81% rename from deluge/ui/null2/commands/debug.py rename to deluge/ui/console/commands/debug.py index 243d7d6b3..0531f71a1 100644 --- a/deluge/ui/null2/commands/debug.py +++ b/deluge/ui/console/commands/debug.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -from deluge.ui.null2.main import BaseCommand +from deluge.ui.console.main import BaseCommand from deluge.ui.client import aclient as client -from deluge.ui.null2.colors import templates, default_style as style +from deluge.ui.console.colors import templates, default_style as style import logging class Command(BaseCommand): diff --git a/deluge/ui/null2/commands/halt.py b/deluge/ui/console/commands/halt.py similarity index 56% rename from deluge/ui/null2/commands/halt.py rename to deluge/ui/console/commands/halt.py index c490a2dbf..001336004 100644 --- a/deluge/ui/null2/commands/halt.py +++ b/deluge/ui/console/commands/halt.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -from deluge.ui.null2.main import BaseCommand, match_torrents -from deluge.ui.null2 import mapping -from deluge.ui.null2.colors import templates +from deluge.ui.console.main import BaseCommand, match_torrents +from deluge.ui.console import mapping +from deluge.ui.console.colors import templates from deluge.ui.client import aclient as client class Command(BaseCommand): diff --git a/deluge/ui/null2/commands/help.py b/deluge/ui/console/commands/help.py similarity index 90% rename from deluge/ui/null2/commands/help.py rename to deluge/ui/console/commands/help.py index 3d71d6cd3..d4f86b5a6 100644 --- a/deluge/ui/null2/commands/help.py +++ b/deluge/ui/console/commands/help.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -from deluge.ui.null2 import UI_PATH -from deluge.ui.null2.main import BaseCommand, load_commands -from deluge.ui.null2.colors import templates +from deluge.ui.console import UI_PATH +from deluge.ui.console.main import BaseCommand, load_commands +from deluge.ui.console.colors import templates import os class Command(BaseCommand): diff --git a/deluge/ui/null2/commands/info.py b/deluge/ui/console/commands/info.py similarity index 96% rename from deluge/ui/null2/commands/info.py rename to deluge/ui/console/commands/info.py index e87cfb580..04c20264a 100644 --- a/deluge/ui/null2/commands/info.py +++ b/deluge/ui/console/commands/info.py @@ -1,8 +1,8 @@ #!/usr/bin/env python -from deluge.ui.null2.main import BaseCommand, match_torrents -from deluge.ui.null2 import mapping -from deluge.ui.null2.colors import templates +from deluge.ui.console.main import BaseCommand, match_torrents +from deluge.ui.console import mapping +from deluge.ui.console.colors import templates from deluge.ui.client import aclient as client import deluge.common as common from optparse import make_option diff --git a/deluge/ui/null2/commands/pause.py b/deluge/ui/console/commands/pause.py similarity index 84% rename from deluge/ui/null2/commands/pause.py rename to deluge/ui/console/commands/pause.py index 57605b11b..235534806 100644 --- a/deluge/ui/null2/commands/pause.py +++ b/deluge/ui/console/commands/pause.py @@ -1,8 +1,8 @@ #!/usr/bin/env python -from deluge.ui.null2.main import BaseCommand, match_torrents -from deluge.ui.null2 import mapping +from deluge.ui.console.main import BaseCommand, match_torrents +from deluge.ui.console import mapping from deluge.ui.client import aclient as client -from deluge.ui.null2.colors import templates, default_style as style +from deluge.ui.console.colors import templates, default_style as style class Command(BaseCommand): """Pause a torrent""" diff --git a/deluge/ui/null2/commands/quit.py b/deluge/ui/console/commands/quit.py similarity index 83% rename from deluge/ui/null2/commands/quit.py rename to deluge/ui/console/commands/quit.py index 8f850f6f1..ba3c06ce6 100644 --- a/deluge/ui/null2/commands/quit.py +++ b/deluge/ui/console/commands/quit.py @@ -1,6 +1,6 @@ #!/usr/bin/env python from deluge.ui.client import aclient as client -from deluge.ui.null2.main import BaseCommand +from deluge.ui.console.main import BaseCommand class Command(BaseCommand): """Exit from the client.""" diff --git a/deluge/ui/null2/commands/resume.py b/deluge/ui/console/commands/resume.py similarity index 84% rename from deluge/ui/null2/commands/resume.py rename to deluge/ui/console/commands/resume.py index dd5ec2a78..128195576 100644 --- a/deluge/ui/null2/commands/resume.py +++ b/deluge/ui/console/commands/resume.py @@ -1,8 +1,8 @@ #!/usr/bin/env python -from deluge.ui.null2.main import BaseCommand, match_torrents -from deluge.ui.null2 import mapping +from deluge.ui.console.main import BaseCommand, match_torrents +from deluge.ui.console import mapping from deluge.ui.client import aclient as client -from deluge.ui.null2.colors import templates, default_style as style +from deluge.ui.console.colors import templates, default_style as style class Command(BaseCommand): """Resume a torrent""" diff --git a/deluge/ui/null2/commands/rm.py b/deluge/ui/console/commands/rm.py similarity index 87% rename from deluge/ui/null2/commands/rm.py rename to deluge/ui/console/commands/rm.py index 4e470f177..1bb8c8e80 100644 --- a/deluge/ui/null2/commands/rm.py +++ b/deluge/ui/console/commands/rm.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -from deluge.ui.null2.main import BaseCommand, match_torrents -from deluge.ui.null2 import mapping -from deluge.ui.null2.colors import templates +from deluge.ui.console.main import BaseCommand, match_torrents +from deluge.ui.console import mapping +from deluge.ui.console.colors import templates from deluge.ui.client import aclient as client from optparse import make_option import os diff --git a/deluge/ui/null2/main.py b/deluge/ui/console/main.py similarity index 95% rename from deluge/ui/null2/main.py rename to deluge/ui/console/main.py index 0824498a5..7d845914d 100644 --- a/deluge/ui/null2/main.py +++ b/deluge/ui/console/main.py @@ -3,8 +3,8 @@ import logging logging.disable(logging.ERROR) import os, sys import optparse -from deluge.ui.null2 import UI_PATH -from deluge.ui.null2.colors import Template, make_style, templates, default_style as style +from deluge.ui.console import UI_PATH +from deluge.ui.console.colors import Template, make_style, templates, default_style as style from deluge.ui.client import aclient as client import shlex @@ -74,7 +74,7 @@ def match_torrents(array=None): def load_commands(command_dir, exclude=[]): def get_command(name): - return getattr(__import__('deluge.ui.null2.commands.%s' % name, {}, {}, ['Command']), 'Command')() + return getattr(__import__('deluge.ui.console.commands.%s' % name, {}, {}, ['Command']), 'Command')() try: commands = [] @@ -90,7 +90,7 @@ def load_commands(command_dir, exclude=[]): except OSError, e: return {} -class NullUI(object): +class ConsoleUI(object): prompt = '>>> ' def __init__(self, args=None): @@ -203,7 +203,7 @@ class NullUI(object): run = cmdloop if __name__ == '__main__': - ui = NullUI() + ui = ConsoleUI() ui.precmd() ui.onecmd(' '.join(sys.argv[1:])) ui.postcmd() diff --git a/deluge/ui/null2/mapping.py b/deluge/ui/console/mapping.py similarity index 95% rename from deluge/ui/null2/mapping.py rename to deluge/ui/console/mapping.py index 35ad110dd..4c7e75d9c 100644 --- a/deluge/ui/null2/mapping.py +++ b/deluge/ui/console/mapping.py @@ -1,6 +1,6 @@ #!/usr/bin/env python from deluge.ui.client import aclient as client -from deluge.ui.null2.main import match_torrents +from deluge.ui.console.main import match_torrents import re import logging @@ -10,7 +10,7 @@ _mapping = {} def _arg_is_id(arg): return bool(_idregex.match(arg)) - + def get_names(torrents): global names names = [] diff --git a/deluge/ui/ui.py b/deluge/ui/ui.py index e2278d5b7..23e32d40c 100644 --- a/deluge/ui/ui.py +++ b/deluge/ui/ui.py @@ -68,7 +68,7 @@ class UI: log.info("Starting NullUI..") from deluge.ui.null.deluge_shell import NullUI ui = NullUI(args) - elif selected_ui == "null2": - log.info("Starting NullUI2..") - from deluge.ui.null2.main import NullUI - ui = NullUI(ui_args).run() + elif selected_ui == "console": + log.info("Starting ConsoleUI..") + from deluge.ui.console.main import ConsoleUI + ui = ConsoleUI(ui_args).run()