mirror of
https://github.com/gryf/wicd.git
synced 2026-02-25 19:55:58 +01:00
Load config, fix some options.
This commit is contained in:
@@ -76,6 +76,7 @@ from wicd.curses.netentry_curses import WiredSettingsDialog
|
|||||||
# import logging
|
# import logging
|
||||||
# import logging.handler
|
# import logging.handler
|
||||||
|
|
||||||
|
CFG.load()
|
||||||
CURSES_REV = wicd.curses.__version__
|
CURSES_REV = wicd.curses.__version__
|
||||||
|
|
||||||
# Fix strings in wicd-curses
|
# Fix strings in wicd-curses
|
||||||
@@ -1294,7 +1295,7 @@ def main():
|
|||||||
if "DBus.Error.AccessDenied" in e.get_dbus_name():
|
if "DBus.Error.AccessDenied" in e.get_dbus_name():
|
||||||
print(_('ERROR: wicd-curses was denied access to the wicd daemon: '
|
print(_('ERROR: wicd-curses was denied access to the wicd daemon: '
|
||||||
'please check that your user is in the "$A" group.')
|
'please check that your user is in the "$A" group.')
|
||||||
.replace('$A', '\033[1;34m' + CFG.wicd_group + '\033[0m'))
|
.replace('$A', '\033[1;34m' + CFG.wicdgroup + '\033[0m'))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ from wicd.translations import _
|
|||||||
# wicd imports
|
# wicd imports
|
||||||
from wicd.config import CFG
|
from wicd.config import CFG
|
||||||
|
|
||||||
|
|
||||||
|
CFG.load()
|
||||||
# Connection state constants
|
# Connection state constants
|
||||||
NOT_CONNECTED = 0
|
NOT_CONNECTED = 0
|
||||||
CONNECTING = 1
|
CONNECTING = 1
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ from wicd import misc
|
|||||||
from wicd.backend import BackendManager
|
from wicd.backend import BackendManager
|
||||||
|
|
||||||
|
|
||||||
|
CFG.load()
|
||||||
BACKEND = None
|
BACKEND = None
|
||||||
BACKEND_MGR = BackendManager()
|
BACKEND_MGR = BackendManager()
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ def get_gettext():
|
|||||||
"""Set up gettext for translations."""
|
"""Set up gettext for translations."""
|
||||||
# Borrowed from an excellent post on how to do this at
|
# Borrowed from an excellent post on how to do this at
|
||||||
# http://www.learningpython.com/2006/12/03/translating-your-pythonpygtk-application/
|
# http://www.learningpython.com/2006/12/03/translating-your-pythonpygtk-application/
|
||||||
|
CFG.load()
|
||||||
local_path = CFG.translations
|
local_path = CFG.translations
|
||||||
langs = []
|
langs = []
|
||||||
osLanguage = os.environ.get('LANGUAGE', None)
|
osLanguage = os.environ.get('LANGUAGE', None)
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ from wicd.logfile import ManagedStdio
|
|||||||
from wicd.configmanager import ConfigManager
|
from wicd.configmanager import ConfigManager
|
||||||
|
|
||||||
|
|
||||||
|
CFG.load()
|
||||||
misc.RenameProcess("wicd")
|
misc.RenameProcess("wicd")
|
||||||
|
|
||||||
wireless_conf = os.path.join(CFG.etc, "wireless-settings.conf")
|
wireless_conf = os.path.join(CFG.etc, "wireless-settings.conf")
|
||||||
@@ -1902,14 +1903,14 @@ def run(argv):
|
|||||||
output = ManagedStdio(logpath)
|
output = ManagedStdio(logpath)
|
||||||
if os.path.exists(logpath):
|
if os.path.exists(logpath):
|
||||||
try:
|
try:
|
||||||
os.chmod(logpath, int(CFG.log_perms, 8))
|
os.chmod(logpath, int(CFG.logperms, 8))
|
||||||
except OSError:
|
except OSError:
|
||||||
print('unable to chmod log file to %s' % CFG.log_perms)
|
print('unable to chmod log file to %s' % CFG.logperms)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if CFG.log_group:
|
if CFG.loggroup:
|
||||||
import grp
|
import grp
|
||||||
group = grp.getgrnam(CFG.log_group)
|
group = grp.getgrnam(CFG.loggroup)
|
||||||
os.chown(logpath, 0, group[2])
|
os.chown(logpath, 0, group[2])
|
||||||
except OSError:
|
except OSError:
|
||||||
print('unable to chown log file to %s' % group[2])
|
print('unable to chown log file to %s' % group[2])
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ from wicd import misc
|
|||||||
from wicd.misc import find_path
|
from wicd.misc import find_path
|
||||||
|
|
||||||
|
|
||||||
|
CFG.load()
|
||||||
|
|
||||||
# Regular expressions.
|
# Regular expressions.
|
||||||
_re_mode = (re.I | re.M | re.S)
|
_re_mode = (re.I | re.M | re.S)
|
||||||
essid_pattern = re.compile('.*ESSID:"?(.*?)".*\n', _re_mode)
|
essid_pattern = re.compile('.*ESSID:"?(.*?)".*\n', _re_mode)
|
||||||
|
|||||||
Reference in New Issue
Block a user