1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-09 07:14:13 +01:00

Merge r352 of mainline 1.6

This commit is contained in:
Andrew Psaltis
2009-04-12 12:12:38 -04:00
7 changed files with 30 additions and 33 deletions

View File

@@ -20,7 +20,6 @@ from distutils.core import setup, Command
from distutils.extension import Extension from distutils.extension import Extension
import os import os
import shutil import shutil
import sys
import subprocess import subprocess
# Be sure to keep this updated! # Be sure to keep this updated!
@@ -31,11 +30,10 @@ REVISION_NUM = 'unknown'
CURSES_REVNO = 'uimod' CURSES_REVNO = 'uimod'
try: try:
if not os.path.exists('vcsinfo.py'): try:
try: os.system('bzr version-info --python > vcsinfo.py')
os.system('bzr version-info --python > vcsinfo.py') except:
except: pass
pass
import vcsinfo import vcsinfo
REVISION_NUM = vcsinfo.version_info['revno'] REVISION_NUM = vcsinfo.version_info['revno']
except Exception, e: except Exception, e:
@@ -383,7 +381,6 @@ class uninstall(Command):
def run(self): def run(self):
os.system("./uninstall.sh") os.system("./uninstall.sh")
try: try:
import wpath import wpath
except ImportError: except ImportError:
@@ -477,13 +474,13 @@ except Exception, e:
python setup.py configure has not yet been run.''' python setup.py configure has not yet been run.'''
wpactrl_ext = Extension(name = 'wpactrl', wpactrl_ext = Extension(name='wpactrl',
sources = ['depends/python-wpactrl/wpa_ctrl.c', sources=['depends/python-wpactrl/wpa_ctrl.c',
'depends/python-wpactrl/wpactrl.c'], 'depends/python-wpactrl/wpactrl.c'],
extra_compile_args = ["-fno-strict-aliasing"]) extra_compile_args=["-fno-strict-aliasing"])
iwscan_ext = Extension(name = 'iwscan', libraries = ['iw'], iwscan_ext = Extension(name='iwscan', libraries=['iw'],
sources = ['depends/python-iwscan/pyiwscan.c']) sources=['depends/python-iwscan/pyiwscan.c'])
setup(cmdclass={'configure' : configure, 'get_translations' : get_translations, setup(cmdclass={'configure' : configure, 'get_translations' : get_translations,
'uninstall' : uninstall, 'test' : test, 'clear_generated' : clear_generated}, 'uninstall' : uninstall, 'test' : test, 'clear_generated' : clear_generated},
@@ -498,14 +495,13 @@ to easily add encryption methods used. It ships with some common
encryption types, such as WPA and WEP. Wicdl will automatically encryption types, such as WPA and WEP. Wicdl will automatically
connect at startup to any preferred network within range. connect at startup to any preferred network within range.
""", """,
author="Adam Blackburn, Dan O'Reilly", author="Adam Blackburn, Dan O'Reilly, Andrew Psaltis",
author_email="compwiz18@gmail.com, oreilldf@gmail.com", author_email="compwiz18@gmail.com, oreilldf@gmail.com, ampsaltis@gmail.com",
url="http://wicd.net", url="http://wicd.net",
license="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html", license="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html",
py_modules=['wicd.networking','wicd.misc','wicd.gui','wicd.wnettools', py_modules=['wicd.networking','wicd.misc','wicd.gui','wicd.wnettools',
'wicd.wpath','wicd.prefs','wicd.netentry','wicd.dbusmanager', 'wicd.wpath','wicd.prefs','wicd.netentry','wicd.dbusmanager',
'wicd.logfile','wicd.backend','wicd.configmanager', 'wicd.logfile','wicd.backend','wicd.configmanager',
'wicd.guiutil','wicd.translations'], 'wicd.guiutil','wicd.translations'],
ext_modules=[iwscan_ext, wpactrl_ext],
data_files=data data_files=data
) )

View File

@@ -131,8 +131,8 @@ class Interface(BaseInterface):
def CheckWirelessTools(self): def CheckWirelessTools(self):
""" Check for the existence needed wireless tools """ """ Check for the existence needed wireless tools """
# We don't need any external apps so just return if not WPACTRL_AVAIL:
pass BaseInterface.CheckWirelessTools(self)
@neediface("") @neediface("")
def GetIP(self, ifconfig=""): def GetIP(self, ifconfig=""):
@@ -264,6 +264,7 @@ class WirelessInterface(Interface, BaseWirelessInterface):
wpa_driver) wpa_driver)
Interface.__init__(self, iface, verbose) Interface.__init__(self, iface, verbose)
self.scan_iface = None self.scan_iface = None
self.CheckWirelessTools()
@neediface([]) @neediface([])
def GetNetworks(self): def GetNetworks(self):
@@ -425,6 +426,8 @@ class WirelessInterface(Interface, BaseWirelessInterface):
@neediface(False) @neediface(False)
def StopWPA(self): def StopWPA(self):
""" Terminates wpa_supplicant using its ctrl interface. """ """ Terminates wpa_supplicant using its ctrl interface. """
if not WPACTRL_AVAIL:
return BaseWirelessInterface.StopWPA(self)
wpa = self._connect_to_wpa_ctrl_iface() wpa = self._connect_to_wpa_ctrl_iface()
if not wpa: if not wpa:
return return

View File

@@ -33,10 +33,10 @@ import ConfigParser
import gtk.glade import gtk.glade
from wicd import wpath from wicd import wpath
from wicd import misc from wicd import translations
from wicd import dbusmanager from wicd import dbusmanager
_ = misc.get_gettext() _ = translations.get_gettext()
language = {} language = {}
language['configure_scripts'] = _("Configure Scripts") language['configure_scripts'] = _("Configure Scripts")

View File

@@ -57,7 +57,9 @@ def setup_dbus(force=True):
except DBusException: except DBusException:
if force: if force:
print "Can't connect to the daemon, trying to start it automatically..." print "Can't connect to the daemon, trying to start it automatically..."
misc.PromptToStartDaemon() if not misc.PromptToStartDaemon():
print "Failed to find a graphical sudo program, cannot continue."
return False
try: try:
dbusmanager.connect_to_dbus() dbusmanager.connect_to_dbus()
except DBusException: except DBusException:

View File

@@ -155,6 +155,8 @@ def PromptToStartDaemon():
""" Prompt the user to start the daemon """ """ Prompt the user to start the daemon """
daemonloc = wpath.sbin + 'wicd' daemonloc = wpath.sbin + 'wicd'
sudo_prog = choose_sudo_prog() sudo_prog = choose_sudo_prog()
if not sudo_prog:
return False
if "gksu" in sudo_prog or "ktsuss" in sudo_prog: if "gksu" in sudo_prog or "ktsuss" in sudo_prog:
msg = '--message' msg = '--message'
else: else:
@@ -163,6 +165,7 @@ def PromptToStartDaemon():
'Wicd needs to access your computer\'s network cards.', 'Wicd needs to access your computer\'s network cards.',
daemonloc] daemonloc]
os.spawnvpe(os.P_WAIT, sudo_prog, sudo_args, os.environ) os.spawnvpe(os.P_WAIT, sudo_prog, sudo_args, os.environ)
return True
def RunRegex(regex, string): def RunRegex(regex, string):
""" runs a regex search on a string """ """ runs a regex search on a string """
@@ -189,7 +192,7 @@ def ExecuteScript(script, verbose=False):
print "Executing %s" % script print "Executing %s" % script
ret = call("%s > /dev/null 2>&1" % script, shell=True) ret = call("%s > /dev/null 2>&1" % script, shell=True)
if verbose: if verbose:
"%s returned %s" % (script, ret) print "%s returned %s" % (script, ret)
def ReadFile(filename): def ReadFile(filename):
""" read in a file and return it's contents as a string """ """ read in a file and return it's contents as a string """
@@ -453,8 +456,7 @@ def choose_sudo_prog(prog_num=0):
for path in paths: for path in paths:
if os.path.exists(path): if os.path.exists(path):
return path return path
return ""
return None
def find_path(cmd): def find_path(cmd):
""" Try to find a full path for a given file name. """ Try to find a full path for a given file name.

View File

@@ -309,7 +309,7 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
information_button = gtk.Button(stock=gtk.STOCK_INFO) information_button = gtk.Button(stock=gtk.STOCK_INFO)
self.button_hbox.pack_start(information_button, False, False) self.button_hbox.pack_start(information_button, False, False)
information_button.connect('clicked', lambda *a, **k: WirelessInformationDialog(networkID)) information_button.connect('clicked', lambda *a, **k: WirelessInformationDialog(networkID, self))
information_button.show() information_button.show()
# Build the encryption menu # Build the encryption menu
@@ -879,8 +879,8 @@ class WirelessNetworkEntry(NetworkEntry):
class WirelessInformationDialog(gtk.Dialog): class WirelessInformationDialog(gtk.Dialog):
def __init__(self, networkID): def __init__(self, networkID, parent):
gtk.Dialog.__init__(self) gtk.Dialog.__init__(self,parent=parent)
# Make the combo box. # Make the combo box.
self.lbl_strength = gtk.Label() self.lbl_strength = gtk.Label()

View File

@@ -1138,12 +1138,6 @@ class WirelessDaemon(dbus.service.Object):
ip = self.wifi.GetIP(ifconfig) ip = self.wifi.GetIP(ifconfig)
return ip return ip
@dbus.service.method('org.wicd.daemon.wireless')
def GetOperationalMode(self, ifconfig=""):
""" Returns the IP associated with the wireless interface. """
ip = self.wifi.GetOperationalMode(ifconfig)
return ip
@dbus.service.method('org.wicd.daemon.wireless') @dbus.service.method('org.wicd.daemon.wireless')
def CheckWirelessConnectingMessage(self): def CheckWirelessConnectingMessage(self):
""" Returns the wireless interface's status message. """ """ Returns the wireless interface's status message. """