mirror of
https://github.com/gryf/wicd.git
synced 2025-12-19 20:38:00 +01:00
Cleaned up the wicd-curses code, pruned the documentation of old stuff, and removed the -c/-r options from wicd-curses, since only -r works.
This commit is contained in:
@@ -10,10 +10,6 @@ to anything or not, all of which is updated in real time. Other features
|
|||||||
include the ability to connect to networks, global preferences controls, and
|
include the ability to connect to networks, global preferences controls, and
|
||||||
per-network settings for wireless networks.
|
per-network settings for wireless networks.
|
||||||
|
|
||||||
All features that I plan on implementing (that are not mentioned above) are
|
|
||||||
listed the TODO file in this same directory. If you want any other features,
|
|
||||||
ask me. I try to be on the #wicd Freenode IRC channel most of the time.
|
|
||||||
|
|
||||||
Controls (most of these should be viewable in wicd-curses itself):
|
Controls (most of these should be viewable in wicd-curses itself):
|
||||||
|
|
||||||
F5 : refresh wireless networks
|
F5 : refresh wireless networks
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
Things to do (in no particular order):
|
|
||||||
|
|
||||||
* Make keystrokes customizable (Probably not going to happen)
|
|
||||||
* Make color schemes customizable
|
|
||||||
* Perform a mass code cleanup
|
|
||||||
@@ -94,7 +94,6 @@ def wrap_exceptions(func):
|
|||||||
print >> sys.stderr, "\n"+language['terminated']
|
print >> sys.stderr, "\n"+language['terminated']
|
||||||
#raise
|
#raise
|
||||||
except DBusException:
|
except DBusException:
|
||||||
#gobject.source_remove(redraw_tag)
|
|
||||||
loop.quit()
|
loop.quit()
|
||||||
ui.stop()
|
ui.stop()
|
||||||
print >> sys.stderr,"\n"+language['dbus_fail']
|
print >> sys.stderr,"\n"+language['dbus_fail']
|
||||||
@@ -111,7 +110,6 @@ def wrap_exceptions(func):
|
|||||||
# backtrace
|
# backtrace
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
# Raise the exception
|
# Raise the exception
|
||||||
#sleep(2)
|
|
||||||
raise
|
raise
|
||||||
|
|
||||||
wrapper.__name__ = func.__name__
|
wrapper.__name__ = func.__name__
|
||||||
@@ -164,7 +162,7 @@ def check_for_wireless(iwconfig, wireless_ip, set_status):
|
|||||||
|
|
||||||
# Generate the list of networks.
|
# Generate the list of networks.
|
||||||
# Mostly borrowed/stolen from wpa_cli, since I had no clue what all of those
|
# Mostly borrowed/stolen from wpa_cli, since I had no clue what all of those
|
||||||
# DBUS interfaces do. ^_^
|
# DBUS interfaces do. :P
|
||||||
# Whatever calls this must be exception-wrapped if it is run if the UI is up
|
# Whatever calls this must be exception-wrapped if it is run if the UI is up
|
||||||
def gen_network_list():
|
def gen_network_list():
|
||||||
wiredL = wired.GetWiredProfileList()
|
wiredL = wired.GetWiredProfileList()
|
||||||
@@ -498,7 +496,6 @@ class AdHocDialog(Dialog2):
|
|||||||
self.use_ics_chkb.get_state(),
|
self.use_ics_chkb.get_state(),
|
||||||
self.use_encrypt_chkb.get_state(),
|
self.use_encrypt_chkb.get_state(),
|
||||||
self.key_edit.get_edit_text())
|
self.key_edit.get_edit_text())
|
||||||
|
|
||||||
return exitcode, data
|
return exitcode, data
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
@@ -786,8 +783,6 @@ class appGUI():
|
|||||||
self.update_ui()
|
self.update_ui()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# Yeah, I'm copying code. Anything wrong with that?
|
|
||||||
#@wrap_exceptions
|
|
||||||
def dbus_scan_finished(self):
|
def dbus_scan_finished(self):
|
||||||
# I'm pretty sure that I'll need this later.
|
# I'm pretty sure that I'll need this later.
|
||||||
#if not self.connecting:
|
#if not self.connecting:
|
||||||
@@ -795,8 +790,6 @@ class appGUI():
|
|||||||
self.unlock_screen()
|
self.unlock_screen()
|
||||||
self.scanning = False
|
self.scanning = False
|
||||||
|
|
||||||
# Same, same, same, same, same, same
|
|
||||||
#@wrap_exceptions
|
|
||||||
def dbus_scan_started(self):
|
def dbus_scan_started(self):
|
||||||
self.scanning = True
|
self.scanning = True
|
||||||
if self.diag_type == 'conf':
|
if self.diag_type == 'conf':
|
||||||
@@ -949,10 +942,6 @@ class appGUI():
|
|||||||
def connect(self, nettype, networkid, networkentry=None):
|
def connect(self, nettype, networkid, networkentry=None):
|
||||||
""" Initiates the connection process in the daemon. """
|
""" Initiates the connection process in the daemon. """
|
||||||
if nettype == "wireless":
|
if nettype == "wireless":
|
||||||
#if not self.check_encryption_valid(networkid,
|
|
||||||
# networkentry.advanced_dialog):
|
|
||||||
# self.edit_advanced(None, None, nettype, networkid, networkentry)
|
|
||||||
# return False
|
|
||||||
wireless.ConnectWireless(networkid)
|
wireless.ConnectWireless(networkid)
|
||||||
elif nettype == "wired":
|
elif nettype == "wired":
|
||||||
wired.ConnectWired()
|
wired.ConnectWired()
|
||||||
@@ -964,18 +953,11 @@ class appGUI():
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
global ui, dlogger
|
global ui, dlogger
|
||||||
# We are _not_ python.
|
# We are not python.
|
||||||
misc.RenameProcess('wicd-curses')
|
misc.RenameProcess('wicd-curses')
|
||||||
|
|
||||||
# Import the screen based on whatever the user picked.
|
import urwid.raw_display
|
||||||
# The raw_display will have some features that may be useful to users
|
ui = urwid.raw_display.Screen()
|
||||||
# later
|
|
||||||
if options.screen == 'raw':
|
|
||||||
import urwid.raw_display
|
|
||||||
ui = urwid.raw_display.Screen()
|
|
||||||
elif options.screen == 'curses':
|
|
||||||
import urwid.curses_display
|
|
||||||
ui = urwid.curses_display.Screen()
|
|
||||||
|
|
||||||
#if options.debug:
|
#if options.debug:
|
||||||
# dlogger = logging.getLogger("Debug")
|
# dlogger = logging.getLogger("Debug")
|
||||||
@@ -1020,7 +1002,6 @@ def run():
|
|||||||
ui.set_mouse_tracking()
|
ui.set_mouse_tracking()
|
||||||
app = appGUI()
|
app = appGUI()
|
||||||
|
|
||||||
|
|
||||||
# Connect signals and whatnot to UI screen control functions
|
# Connect signals and whatnot to UI screen control functions
|
||||||
bus.add_signal_receiver(app.dbus_scan_finished, 'SendEndScanSignal',
|
bus.add_signal_receiver(app.dbus_scan_finished, 'SendEndScanSignal',
|
||||||
'org.wicd.daemon.wireless')
|
'org.wicd.daemon.wireless')
|
||||||
@@ -1029,8 +1010,6 @@ def run():
|
|||||||
# I've left this commented out many times.
|
# I've left this commented out many times.
|
||||||
bus.add_signal_receiver(app.update_netlist, 'StatusChanged',
|
bus.add_signal_receiver(app.update_netlist, 'StatusChanged',
|
||||||
'org.wicd.daemon')
|
'org.wicd.daemon')
|
||||||
# Update what the interface looks like as an idle function
|
|
||||||
#gobject.idle_add(app.update_ui)
|
|
||||||
# Update the connection status on the bottom every 1.5 s.
|
# Update the connection status on the bottom every 1.5 s.
|
||||||
gobject.timeout_add(2000,app.update_status)
|
gobject.timeout_add(2000,app.update_status)
|
||||||
# This will make sure that it is updated on the second.
|
# This will make sure that it is updated on the second.
|
||||||
@@ -1045,7 +1024,7 @@ def run():
|
|||||||
|
|
||||||
# Mostly borrowed from gui.py
|
# Mostly borrowed from gui.py
|
||||||
def setup_dbus(force=True):
|
def setup_dbus(force=True):
|
||||||
global bus, daemon, wireless, wired, DBUS_AVAIL
|
global bus, daemon, wireless, wired
|
||||||
try:
|
try:
|
||||||
dbusmanager.connect_to_dbus()
|
dbusmanager.connect_to_dbus()
|
||||||
except DBusException:
|
except DBusException:
|
||||||
@@ -1059,8 +1038,6 @@ def setup_dbus(force=True):
|
|||||||
daemon = dbus_ifaces['daemon']
|
daemon = dbus_ifaces['daemon']
|
||||||
wireless = dbus_ifaces['wireless']
|
wireless = dbus_ifaces['wireless']
|
||||||
wired = dbus_ifaces['wired']
|
wired = dbus_ifaces['wired']
|
||||||
DBUS_AVAIL = True
|
|
||||||
|
|
||||||
|
|
||||||
netentry_curses.dbus_init(dbus_ifaces)
|
netentry_curses.dbus_init(dbus_ifaces)
|
||||||
return True
|
return True
|
||||||
@@ -1079,14 +1056,7 @@ if __name__ == '__main__':
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
parser.set_defaults(screen='raw',debug=False)
|
|
||||||
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")
|
|
||||||
#parser.add_option("-d", "--debug",action="store_true"
|
#parser.add_option("-d", "--debug",action="store_true"
|
||||||
# ,dest='debug',help="enable logging of wicd-curses (currently does nothing)")
|
# ,dest='debug',help="enable logging of wicd-curses (currently does nothing)")
|
||||||
(options,args) = parser.parse_args()
|
(options,args) = parser.parse_args()
|
||||||
main()
|
main()
|
||||||
# Make sure that the terminal does not try to overwrite the last line of
|
|
||||||
# the program, so that everything looks pretty.
|
|
||||||
#print ""
|
|
||||||
|
|||||||
@@ -9,17 +9,6 @@ wicd-curses is a curses-based network controller that uses the Wired/Wireless In
|
|||||||
It is designed to imitate the GTK-based wicd-client(1) as much as possible, and uses the Urwid (http://excess.org/urwid) console widget library to vastly simplify development.
|
It is designed to imitate the GTK-based wicd-client(1) as much as possible, and uses the Urwid (http://excess.org/urwid) console widget library to vastly simplify development.
|
||||||
|
|
||||||
This man page only documents the current status of wicd-curses. This may/may not be the most up-to-date document.
|
This man page only documents the current status of wicd-curses. This may/may not be the most up-to-date document.
|
||||||
.SH "ARGUMENTS"
|
|
||||||
.TP
|
|
||||||
.BR "\-r" , " \-\-raw\-screen"
|
|
||||||
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
|
.SH CONTROLS
|
||||||
All of these are case sensitive.
|
All of these are case sensitive.
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
1
setup.py
1
setup.py
@@ -520,7 +520,6 @@ try:
|
|||||||
data.append(( wpath.mandir + 'man8/', ['man/wicd-curses.8']))
|
data.append(( wpath.mandir + 'man8/', ['man/wicd-curses.8']))
|
||||||
if not wpath.no_install_docs:
|
if not wpath.no_install_docs:
|
||||||
data.append(( wpath.docdir, ['curses/README.curses']))
|
data.append(( wpath.docdir, ['curses/README.curses']))
|
||||||
data.append(( wpath.docdir, ['curses/TODO.curses']))
|
|
||||||
if not wpath.no_install_cli:
|
if not wpath.no_install_cli:
|
||||||
data.append((wpath.lib, ['cli/wicd-cli.py']))
|
data.append((wpath.lib, ['cli/wicd-cli.py']))
|
||||||
data.append((wpath.bin, ['scripts/wicd-cli']))
|
data.append((wpath.bin, ['scripts/wicd-cli']))
|
||||||
|
|||||||
Reference in New Issue
Block a user