diff options
author | Andrew Resch <andrewresch@gmail.com> | 2009-12-10 01:26:26 +0000 |
---|---|---|
committer | Andrew Resch <andrewresch@gmail.com> | 2009-12-10 01:26:26 +0000 |
commit | 3c703d2ef75d3a2666813cc73c94a51026b0a85b (patch) | |
tree | ebaafa31ebe3daa530ad31d4c5c9ba561cf0ea0b | |
parent | 429f7064fa98e53885b8f6435a54df18b8827710 (diff) | |
download | deluge-3c703d2ef75d3a2666813cc73c94a51026b0a85b.tar.gz deluge-3c703d2ef75d3a2666813cc73c94a51026b0a85b.tar.bz2 deluge-3c703d2ef75d3a2666813cc73c94a51026b0a85b.zip |
Fix using the console in Windows, but only in command-line mode
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | deluge/ui/console/colors.py | 5 | ||||
-rw-r--r-- | deluge/ui/console/main.py | 5 | ||||
-rw-r--r-- | deluge/ui/console/screen.py | 5 |
4 files changed, 16 insertions, 4 deletions
@@ -1,7 +1,7 @@ === Deluge 1.2.0_rc5 (In Development) === ==== Web ==== * Swap order of buttons in Remove window (Closes #1083) - * Change the compressed js script to deluge-all.js to avoid naming + * Change the compressed js script to deluge-all.js to avoid naming conflicts on case-sensitive filesystems. * Apply patch from adios fixing the cookie date * Add tooltips to the statusbar items @@ -15,6 +15,9 @@ * Fix crash in Windows when creating a torrent * Add button to Other preferences to associate magnet links with Deluge +==== Console ==== + * Fix using the console in Windows, but only in command-line mode + ==== Label ==== * Fix #1085 only use ints for specific options to prevent unhandled exception diff --git a/deluge/ui/console/colors.py b/deluge/ui/console/colors.py index ab01915a1..3b9455446 100644 --- a/deluge/ui/console/colors.py +++ b/deluge/ui/console/colors.py @@ -33,7 +33,10 @@ # # -import curses +try: + import curses +except ImportError: + pass colors = [ 'COLOR_BLACK', diff --git a/deluge/ui/console/main.py b/deluge/ui/console/main.py index 11d74fee4..68fb3bba1 100644 --- a/deluge/ui/console/main.py +++ b/deluge/ui/console/main.py @@ -185,11 +185,14 @@ class ConsoleUI(component.Component): d.addCallback(on_connect) self.coreconfig = CoreConfig() - if self.interactive: + if self.interactive and not deluge.common.windows_check(): # We use the curses.wrapper function to prevent the console from getting # messed up if an uncaught exception is experienced. import curses.wrapper curses.wrapper(self.run) + elif self.interactive and deluge.common.windows_check(): + print "You cannot run the deluge-console in interactive mode in Windows.\ + Please use commands from the command line, eg: deluge-console config;help;exit" else: reactor.run() diff --git a/deluge/ui/console/screen.py b/deluge/ui/console/screen.py index 998a91f74..c978ec841 100644 --- a/deluge/ui/console/screen.py +++ b/deluge/ui/console/screen.py @@ -34,7 +34,10 @@ # import sys -import curses +try: + import curses +except ImportError: + pass import colors try: import signal |