1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-24 07:02:29 +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
import os
import shutil
import sys
import subprocess
# Be sure to keep this updated!
@@ -31,11 +30,10 @@ REVISION_NUM = 'unknown'
CURSES_REVNO = 'uimod'
try:
if not os.path.exists('vcsinfo.py'):
try:
os.system('bzr version-info --python > vcsinfo.py')
except:
pass
try:
os.system('bzr version-info --python > vcsinfo.py')
except:
pass
import vcsinfo
REVISION_NUM = vcsinfo.version_info['revno']
except Exception, e:
@@ -383,7 +381,6 @@ class uninstall(Command):
def run(self):
os.system("./uninstall.sh")
try:
import wpath
except ImportError:
@@ -477,13 +474,13 @@ except Exception, e:
python setup.py configure has not yet been run.'''
wpactrl_ext = Extension(name = 'wpactrl',
sources = ['depends/python-wpactrl/wpa_ctrl.c',
'depends/python-wpactrl/wpactrl.c'],
extra_compile_args = ["-fno-strict-aliasing"])
wpactrl_ext = Extension(name='wpactrl',
sources=['depends/python-wpactrl/wpa_ctrl.c',
'depends/python-wpactrl/wpactrl.c'],
extra_compile_args=["-fno-strict-aliasing"])
iwscan_ext = Extension(name = 'iwscan', libraries = ['iw'],
sources = ['depends/python-iwscan/pyiwscan.c'])
iwscan_ext = Extension(name='iwscan', libraries=['iw'],
sources=['depends/python-iwscan/pyiwscan.c'])
setup(cmdclass={'configure' : configure, 'get_translations' : get_translations,
'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
connect at startup to any preferred network within range.
""",
author="Adam Blackburn, Dan O'Reilly",
author_email="compwiz18@gmail.com, oreilldf@gmail.com",
author="Adam Blackburn, Dan O'Reilly, Andrew Psaltis",
author_email="compwiz18@gmail.com, oreilldf@gmail.com, ampsaltis@gmail.com",
url="http://wicd.net",
license="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html",
py_modules=['wicd.networking','wicd.misc','wicd.gui','wicd.wnettools',
'wicd.wpath','wicd.prefs','wicd.netentry','wicd.dbusmanager',
'wicd.logfile','wicd.backend','wicd.configmanager',
'wicd.guiutil','wicd.translations'],
ext_modules=[iwscan_ext, wpactrl_ext],
data_files=data
)

View File

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

View File

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

View File

@@ -57,7 +57,9 @@ def setup_dbus(force=True):
except DBusException:
if force:
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:
dbusmanager.connect_to_dbus()
except DBusException:

View File

@@ -155,6 +155,8 @@ def PromptToStartDaemon():
""" Prompt the user to start the daemon """
daemonloc = wpath.sbin + 'wicd'
sudo_prog = choose_sudo_prog()
if not sudo_prog:
return False
if "gksu" in sudo_prog or "ktsuss" in sudo_prog:
msg = '--message'
else:
@@ -163,6 +165,7 @@ def PromptToStartDaemon():
'Wicd needs to access your computer\'s network cards.',
daemonloc]
os.spawnvpe(os.P_WAIT, sudo_prog, sudo_args, os.environ)
return True
def RunRegex(regex, string):
""" runs a regex search on a string """
@@ -189,7 +192,7 @@ def ExecuteScript(script, verbose=False):
print "Executing %s" % script
ret = call("%s > /dev/null 2>&1" % script, shell=True)
if verbose:
"%s returned %s" % (script, ret)
print "%s returned %s" % (script, ret)
def ReadFile(filename):
""" 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:
if os.path.exists(path):
return path
return None
return ""
def find_path(cmd):
""" 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)
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()
# Build the encryption menu
@@ -879,8 +879,8 @@ class WirelessNetworkEntry(NetworkEntry):
class WirelessInformationDialog(gtk.Dialog):
def __init__(self, networkID):
gtk.Dialog.__init__(self)
def __init__(self, networkID, parent):
gtk.Dialog.__init__(self,parent=parent)
# Make the combo box.
self.lbl_strength = gtk.Label()

View File

@@ -1138,12 +1138,6 @@ class WirelessDaemon(dbus.service.Object):
ip = self.wifi.GetIP(ifconfig)
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')
def CheckWirelessConnectingMessage(self):
""" Returns the wireless interface's status message. """