mirror of
https://github.com/gryf/wicd.git
synced 2025-12-21 21:38:06 +01:00
Made wicd-curses.py spit out an error if a dbus access denied error appears on startup.
This commit is contained in:
@@ -38,7 +38,6 @@ at least get a network connection. Or those who don't like using X. ;-)
|
|||||||
import warnings
|
import warnings
|
||||||
warnings.filterwarnings("ignore","The popen2 module is deprecated. Use the subprocess module.")
|
warnings.filterwarnings("ignore","The popen2 module is deprecated. Use the subprocess module.")
|
||||||
# UI stuff
|
# UI stuff
|
||||||
# This library is the only reason why I wrote this program.
|
|
||||||
import urwid
|
import urwid
|
||||||
|
|
||||||
# DBus communication stuff
|
# DBus communication stuff
|
||||||
@@ -64,6 +63,7 @@ import netentry_curses
|
|||||||
from netentry_curses import WirelessSettingsDialog, WiredSettingsDialog,AdvancedSettingsDialog
|
from netentry_curses import WirelessSettingsDialog, WiredSettingsDialog,AdvancedSettingsDialog
|
||||||
|
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
from os import system
|
||||||
|
|
||||||
# Stuff about getting the script configurer running
|
# Stuff about getting the script configurer running
|
||||||
#from grp import getgrgid
|
#from grp import getgrgid
|
||||||
@@ -72,7 +72,7 @@ from optparse import OptionParser
|
|||||||
#import logging
|
#import logging
|
||||||
#import logging.handler
|
#import logging.handler
|
||||||
|
|
||||||
CURSES_REVNO=wpath.curses_revision
|
CURSES_REV=wpath.curses_revision
|
||||||
|
|
||||||
# Fix strings in wicd-curses
|
# Fix strings in wicd-curses
|
||||||
from wicd.translations import language
|
from wicd.translations import language
|
||||||
@@ -1047,7 +1047,17 @@ setup_dbus()
|
|||||||
##### MAIN ENTRY POINT
|
##### MAIN ENTRY POINT
|
||||||
########################################
|
########################################
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REVNO,daemon.Hello()))
|
try:
|
||||||
|
parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello()))
|
||||||
|
except Exception as ex:
|
||||||
|
if "Rejected send message" in ex.args[0]:
|
||||||
|
print ""
|
||||||
|
system("\
|
||||||
|
echo ERROR: wicd-curses was denied access to the wicd daemon, make sure that \
|
||||||
|
your user is in the group \\'$(tput bold)$(tput setaf 4)"+ wpath.wicd_group+"$(tput sgr0)\\'.")
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
raise
|
||||||
parser.set_defaults(screen='raw',debug=False)
|
parser.set_defaults(screen='raw',debug=False)
|
||||||
parser.add_option("-r", "--raw-screen",action="store_const",const='raw'
|
parser.add_option("-r", "--raw-screen",action="store_const",const='raw'
|
||||||
,dest='screen',help="use urwid's raw screen controller (default)")
|
,dest='screen',help="use urwid's raw screen controller (default)")
|
||||||
|
|||||||
Reference in New Issue
Block a user