mirror of
https://github.com/gryf/wicd.git
synced 2026-03-16 06:33:33 +01:00
Merged 1.7.1-probably, which contains 14 patches from Debian. Thanks to David Paleino and everyone else who contributed these patches.
This commit is contained in:
@@ -143,7 +143,7 @@ if options.network_details:
|
||||
# network properties
|
||||
|
||||
if options.network_property:
|
||||
options.network_property = option.network_property.lower()
|
||||
options.network_property = options.network_property.lower()
|
||||
if options.wireless:
|
||||
if options.network >= 0:
|
||||
is_valid_wireless_network_id(options.network)
|
||||
|
||||
@@ -1026,7 +1026,7 @@ setup_dbus()
|
||||
########################################
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello()))
|
||||
parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello()), prog="wicd-curses")
|
||||
except Exception, e:
|
||||
if "DBus.Error.AccessDenied" in e.get_dbus_name():
|
||||
print language['access_denied_wc'].replace('$A','\033[1;34m'+wpath.wicd_group+'\033[0m')
|
||||
|
||||
@@ -429,7 +429,7 @@ class appGui(object):
|
||||
gobject.idle_add(self.all_network_list.set_sensitive, True)
|
||||
gobject.idle_add(self.status_area.hide_all)
|
||||
if self.statusID:
|
||||
gobject.idle_add(self.status_bar.remove, 1, self.statusID)
|
||||
gobject.idle_add(self.status_bar.remove_message, 1, self.statusID)
|
||||
|
||||
def set_connecting_state(self, info):
|
||||
if not self.connecting:
|
||||
@@ -444,7 +444,7 @@ class appGui(object):
|
||||
gobject.idle_add(self.all_network_list.set_sensitive, False)
|
||||
gobject.idle_add(self.status_area.show_all)
|
||||
if self.statusID:
|
||||
gobject.idle_add(self.status_bar.remove, 1, self.statusID)
|
||||
gobject.idle_add(self.status_bar.remove_message, 1, self.statusID)
|
||||
if info[0] == "wireless":
|
||||
gobject.idle_add(self.set_status, str(info[1]) + ': ' +
|
||||
language[str(wireless.CheckWirelessConnectingMessage())])
|
||||
@@ -700,7 +700,7 @@ class appGui(object):
|
||||
cancel_button.set_sensitive(True)
|
||||
self.all_network_list.set_sensitive(False)
|
||||
if self.statusID:
|
||||
gobject.idle_add(self.status_bar.remove, 1, self.statusID)
|
||||
gobject.idle_add(self.status_bar.remove_message, 1, self.statusID)
|
||||
gobject.idle_add(self.set_status, language["disconnecting_active"])
|
||||
gobject.idle_add(self.status_area.show_all)
|
||||
self.wait_for_events()
|
||||
@@ -791,6 +791,7 @@ class appGui(object):
|
||||
|
||||
"""
|
||||
self.window.present()
|
||||
self.window.deiconify()
|
||||
self.wait_for_events()
|
||||
self.is_visible = True
|
||||
daemon.SetGUIOpen(True)
|
||||
|
||||
@@ -550,6 +550,7 @@ class TrayIcon(object):
|
||||
# Create labels
|
||||
self.label = gtk.Label()
|
||||
self.data = gtk.Label()
|
||||
self.data.set_selectable(True)
|
||||
self.label.show()
|
||||
self.data.show()
|
||||
self.list = []
|
||||
|
||||
@@ -118,6 +118,12 @@ This file contains settings related to the wireless interface.
|
||||
.br
|
||||
See this file's own man page for more information about it.
|
||||
|
||||
.B %ETC%dhclient.conf.template
|
||||
.br
|
||||
This is used to replace /etc/dhclient.conf during Wicd activity,
|
||||
if you're using dhclient(1) as DHCP client. See dhclient.conf(5)
|
||||
for more information.
|
||||
|
||||
.B %ENCRYPTION%
|
||||
.br
|
||||
This directory contains various templates for encrypted (WEP, WPA, etcetera)
|
||||
@@ -132,6 +138,12 @@ when the specified event is preformed upon connection or disconnect from
|
||||
or to any network. Please note that pre/post disconnect scripts may be
|
||||
executed multiple times on already-disconnected interfaces.
|
||||
.br
|
||||
The scripts will be passed different parameters, depending if Wicd is
|
||||
acting on a wired or a wireless network. In the former case, "wired
|
||||
wired wired" will be passed (three times, just for compatibility with
|
||||
the wireless case). If Wicd is acting on a wireless network, it will
|
||||
pass "wireless ESSID BSSID" to the script.
|
||||
.br
|
||||
Available directories are:
|
||||
.br
|
||||
%SCRIPTS%predisconnect
|
||||
@@ -156,6 +168,7 @@ log if you are having connection or other problems.
|
||||
.BR wicd-manager-settings.conf (5),
|
||||
.BR wicd-wired-settings.conf (5),
|
||||
.BR wicd-wireless-settings.conf (5),
|
||||
.BR dhclient.conf (5),
|
||||
.BR wicd-curses (8),
|
||||
.BR ifconfig (8),
|
||||
.BR iwconfig (8),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
BOLD=$(tput bold)
|
||||
BLUE=$(tput setaf 4)
|
||||
NC=$(tput sgr0)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
if [ ! -d "$HOME/.wicd" ]; then
|
||||
mkdir -p "$HOME/.wicd"
|
||||
fi
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
exec %PYTHON% -O %SHARE%daemon/wicd-daemon.py $@
|
||||
|
||||
8
setup.py
8
setup.py
@@ -436,7 +436,10 @@ class get_translations(Command):
|
||||
import urllib, shutil
|
||||
if os.path.exists('translations'):
|
||||
shutil.rmtree('translations/')
|
||||
if os.path.exists('po'):
|
||||
shutil.rmtree('po/')
|
||||
os.makedirs('translations')
|
||||
os.makedirs('po')
|
||||
filename, headers = urllib.urlretrieve('http://wicd.sourceforge.net/translator/idlist/')
|
||||
id_file = open(filename, 'r')
|
||||
lines = id_file.readlines()
|
||||
@@ -452,11 +455,10 @@ class get_translations(Command):
|
||||
except:
|
||||
print >> sys.stderr, 'error downloading language %s' % id
|
||||
else:
|
||||
shutil.move(pofile, lang_identifier+'.po')
|
||||
shutil.move(pofile, 'po/'+lang_identifier+'.po')
|
||||
os.makedirs('translations/'+lang_identifier+'/LC_MESSAGES')
|
||||
os.system('msgfmt --output-file=translations/' + lang_identifier +
|
||||
'/LC_MESSAGES/wicd.mo ' + lang_identifier + '.po')
|
||||
os.remove(lang_identifier+'.po')
|
||||
'/LC_MESSAGES/wicd.mo po/' + lang_identifier + '.po')
|
||||
|
||||
|
||||
class uninstall(Command):
|
||||
|
||||
@@ -26,7 +26,7 @@ reusable for other purposes as well.
|
||||
|
||||
import os, copy
|
||||
|
||||
from ConfigParser import RawConfigParser
|
||||
from ConfigParser import RawConfigParser, ParsingError
|
||||
|
||||
from wicd.misc import Noneify, to_unicode
|
||||
|
||||
@@ -39,7 +39,16 @@ class ConfigManager(RawConfigParser):
|
||||
self.config_file = path
|
||||
self.debug = debug
|
||||
self.mrk_ws = mark_whitespace
|
||||
self.read(path)
|
||||
try:
|
||||
self.read(path)
|
||||
except ParsingError, e:
|
||||
self.write()
|
||||
try:
|
||||
self.read(path)
|
||||
except ParsingError, p:
|
||||
import sys
|
||||
print "Could not start wicd: %s" % p.message
|
||||
sys.exit(1)
|
||||
|
||||
def __repr__(self):
|
||||
return self.config_file
|
||||
|
||||
@@ -186,6 +186,8 @@ def ExecuteScripts(scripts_dir, verbose=False, extra_parameters=()):
|
||||
if not os.path.exists(scripts_dir):
|
||||
return
|
||||
for obj in sorted(os.listdir(scripts_dir)):
|
||||
if obj.startswith(".") or obj.endswith(("~", ".new", ".orig")):
|
||||
continue
|
||||
obj = os.path.abspath(os.path.join(scripts_dir, obj))
|
||||
if os.path.isfile(obj) and os.access(obj, os.X_OK):
|
||||
ExecuteScript(os.path.abspath(obj), verbose=verbose,
|
||||
|
||||
@@ -948,12 +948,14 @@ class WicdDaemon(dbus.service.Object):
|
||||
os.chmod(app_conf.get_config(), 0600)
|
||||
os.chmod(wireless_conf, 0600)
|
||||
os.chmod(wired_conf, 0600)
|
||||
os.chmod(dhclient_conf, 0644)
|
||||
|
||||
# Make root own them
|
||||
print "chowning configuration files root:root..."
|
||||
os.chown(app_conf.get_config(), 0, 0)
|
||||
os.chown(wireless_conf, 0, 0)
|
||||
os.chown(wired_conf, 0, 0)
|
||||
os.chown(dhclient_conf, 0, 0)
|
||||
|
||||
print "Using wireless interface..." + self.GetWirelessInterface()
|
||||
print "Using wired interface..." + self.GetWiredInterface()
|
||||
@@ -1702,6 +1704,7 @@ def main(argv):
|
||||
# wicd exploded
|
||||
if not os.path.exists(backup_location):
|
||||
shutil.copy2('/etc/resolv.conf', backup_location)
|
||||
os.chmod(backup_location, 0644)
|
||||
except IOError:
|
||||
print 'error backing up resolv.conf'
|
||||
|
||||
@@ -1748,6 +1751,7 @@ def main(argv):
|
||||
# restore resolv.conf on quit
|
||||
try:
|
||||
shutil.move(wpath.varlib + 'resolv.conf.orig', '/etc/resolv.conf')
|
||||
os.chmod('/etc/resolv.conf', 0644)
|
||||
except IOError:
|
||||
print 'error restoring resolv.conf'
|
||||
|
||||
|
||||
@@ -325,6 +325,7 @@ class BaseInterface(object):
|
||||
|
||||
output_conf.close()
|
||||
dhclient_template.close()
|
||||
os.chmod(dhclient_conf_path, 0644)
|
||||
|
||||
if not client_name or not cmd:
|
||||
print "WARNING: Failed to find a valid dhcp client!"
|
||||
@@ -619,6 +620,7 @@ class BaseInterface(object):
|
||||
else:
|
||||
print "ERROR: no dhcp client found"
|
||||
ret = None
|
||||
self.dhcp_object.wait()
|
||||
return ret
|
||||
|
||||
@neediface(False)
|
||||
@@ -1088,9 +1090,7 @@ class BaseWirelessInterface(BaseInterface):
|
||||
bssid -- bssid of the network
|
||||
|
||||
"""
|
||||
cmd = ['iwconfig', self.iface, 'essid', essid]
|
||||
if self.verbose: print str(cmd)
|
||||
misc.Run(cmd)
|
||||
self.SetEssid(essid)
|
||||
base = "iwconfig %s" % self.iface
|
||||
if channel and str(channel).isdigit():
|
||||
cmd = "%s channel %s" % (base, str(channel))
|
||||
|
||||
Reference in New Issue
Block a user