Author: andar

Revision: 5996

Log:
        Fix using the console in Windows, but only in command-line mode

Diff:
Modified: branches/1.2_RC/ChangeLog
===================================================================
--- branches/1.2_RC/ChangeLog   2009-12-10 00:38:48 UTC (rev 5995)
+++ branches/1.2_RC/ChangeLog   2009-12-10 01:26:26 UTC (rev 5996)
@@ -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
 

Modified: branches/1.2_RC/deluge/ui/console/colors.py
===================================================================
--- branches/1.2_RC/deluge/ui/console/colors.py 2009-12-10 00:38:48 UTC (rev 
5995)
+++ branches/1.2_RC/deluge/ui/console/colors.py 2009-12-10 01:26:26 UTC (rev 
5996)
@@ -33,7 +33,10 @@
 #
 #
 
-import curses
+try:
+    import curses
+except ImportError:
+    pass
 
 colors = [
     'COLOR_BLACK',

Modified: branches/1.2_RC/deluge/ui/console/main.py
===================================================================
--- branches/1.2_RC/deluge/ui/console/main.py   2009-12-10 00:38:48 UTC (rev 
5995)
+++ branches/1.2_RC/deluge/ui/console/main.py   2009-12-10 01:26:26 UTC (rev 
5996)
@@ -185,11 +185,14 @@
         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()
 

Modified: branches/1.2_RC/deluge/ui/console/screen.py
===================================================================
--- branches/1.2_RC/deluge/ui/console/screen.py 2009-12-10 00:38:48 UTC (rev 
5995)
+++ branches/1.2_RC/deluge/ui/console/screen.py 2009-12-10 01:26:26 UTC (rev 
5996)
@@ -34,7 +34,10 @@
 #
 
 import sys
-import curses
+try:
+    import curses
+except ImportError:
+    pass
 import colors
 try:
     import signal

Modified: trunk/deluge/ui/console/colors.py
===================================================================
--- trunk/deluge/ui/console/colors.py   2009-12-10 00:38:48 UTC (rev 5995)
+++ trunk/deluge/ui/console/colors.py   2009-12-10 01:26:26 UTC (rev 5996)
@@ -33,7 +33,10 @@
 #
 #
 
-import curses
+try:
+    import curses
+except ImportError:
+    pass
 
 colors = [
     'COLOR_BLACK',

Modified: trunk/deluge/ui/console/main.py
===================================================================
--- trunk/deluge/ui/console/main.py     2009-12-10 00:38:48 UTC (rev 5995)
+++ trunk/deluge/ui/console/main.py     2009-12-10 01:26:26 UTC (rev 5996)
@@ -185,11 +185,14 @@
         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()
 

Modified: trunk/deluge/ui/console/screen.py
===================================================================
--- trunk/deluge/ui/console/screen.py   2009-12-10 00:38:48 UTC (rev 5995)
+++ trunk/deluge/ui/console/screen.py   2009-12-10 01:26:26 UTC (rev 5996)
@@ -34,7 +34,11 @@
 #
 
 import sys
-import curses
+try:
+    import curses
+except ImportError:
+    pass
+
 import colors
 try:
     import signal


--

You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.


Reply via email to