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