From fe7062371c1bd15e20b9bcb224292cd42bf3649f Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 21 Feb 2009 19:36:57 -0500 Subject: [PATCH] curses/wicd-curses.py: Console display defaults to raw_display now, added -c argument to select curses_display curses/README,in/man=wicd-curses.8.in: Updated stuff done in wicd-curses.py --- curses/README | 3 +-- curses/wicd-curses.py | 13 +++++++++---- in/man=wicd-curses.8.in | 11 +++++++++-- setup.py | 2 +- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/curses/README b/curses/README index 377b764..3e5df9d 100644 --- a/curses/README +++ b/curses/README @@ -44,8 +44,7 @@ What is wicd-curses? Why didn't you call it wicd-urwid? There is a hachoir-urwid package out there. I first called this "urwicd". However, due to the relative obscurity of the urwid package, and the fact that many more people know what "curses" - is, I named it wicd-curses. After all, it _does_ use curses (by default, - anyway). + is, I named it wicd-curses. Why don't you support lower-case keybindings for most of the commands? I was trying to prevent mass chaos from happening because of mashing keys. diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 0428085..01dc154 100644 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -865,12 +865,14 @@ def main(): # Import the screen based on whatever the user picked. # The raw_display will have some features that may be useful to users # later - if options.rawscreen: + parser.set_defaults(screen='raw') + if options.screen == 'raw': import urwid.raw_display ui = urwid.raw_display.Screen() - else: + elif options.screen is 'curses': import urwid.curses_display ui = urwid.curses_display.Screen() + # Default Color scheme. # Other potential color schemes can be found at: # http://excess.org/urwid/wiki/RecommendedPalette @@ -952,8 +954,11 @@ setup_dbus() ######################################## if __name__ == '__main__': parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REVNO,daemon.Hello())) - parser.add_option("-r", "--raw-screen",action="store_true",dest='rawscreen', - help="use urwid's raw screen controller") + # raw = True. curses = False + parser.set_defaults(screen='raw') + parser.add_option("-r", "--raw-screen",action="store_const",const='raw' + ,dest='screen',help="use urwid's raw screen controller (default)") + parser.add_option("-c", "--curses-screen",action="store_const",const='curses',dest='screen',help="use urwid's curses screen controller") (options,args) = parser.parse_args() main() # Make sure that the terminal does not try to overwrite the last line of diff --git a/in/man=wicd-curses.8.in b/in/man=wicd-curses.8.in index 9e0e549..99cfd68 100644 --- a/in/man=wicd-curses.8.in +++ b/in/man=wicd-curses.8.in @@ -1,5 +1,5 @@ .\" First revision was r203 -.TH WICD-CURSES "8" "January 2009" "wicd-curses-%CURSES_REVNO%" +.TH WICD-CURSES "8" "February 2009" "wicd-curses-%CURSES_REVNO%" .SH NAME .B wicd-curses \- curses-based wicd(8) controller @@ -12,7 +12,14 @@ This man page only documents the current status of wicd-curses. This may/may no .SH "ARGUMENTS" .TP .BR "\-r" , " \-\-raw\-screen" -Use Urwid's raw console display, instead of the (faster) curses-based one. This may be useful if you are experiencing unicode problems. +Use Urwid's raw console display. This is the default, and has several +advantages over the faster curses display, inculding fully functional unicode +and internationalization support. +.TP +.BR "\-c" , " \-\-curses\-screen" +Use Urwid's curses display. This may be faster than the default raw +display, but it lacks proper unicode support. This is fine to use if your +language of choice only uses Latin characters. .SH CONTROLS All of these are case sensitive. .TP diff --git a/setup.py b/setup.py index 1ab38bc..f55b4a4 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ import subprocess VERSION_NUM = '1.6.0a1' # REVISION_NUM is automatically updated REVISION_NUM = 'unknown' -CURSES_REVNO = 'r275' +CURSES_REVNO = 'r278' try: if not os.path.exists('vcsinfo.py'):