1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-22 14:07:59 +01:00

Make style consistent across the file

This commit is contained in:
David Paleino
2011-10-17 23:56:28 +02:00
parent bebd0ef985
commit 0cc20c81da

141
setup.py
View File

@@ -248,15 +248,15 @@ class configure(Command):
self.logperms = '0600' self.logperms = '0600'
def distro_check(self): def distro_check(self):
print "Distro is: "+self.distro print "Distro is: " + self.distro
if self.distro in ['sles','suse']: if self.distro in ['sles', 'suse']:
self.init = '/etc/init.d/' self.init = '/etc/init.d/'
self.initfile = 'init/suse/wicd' self.initfile = 'init/suse/wicd'
elif self.distro in ['redhat','centos','fedora']: elif self.distro in ['redhat', 'centos', 'fedora']:
self.init = '/etc/rc.d/init.d/' self.init = '/etc/rc.d/init.d/'
self.initfile = 'init/redhat/wicd' self.initfile = 'init/redhat/wicd'
self.pidfile = '/var/run/wicd.pid' self.pidfile = '/var/run/wicd.pid'
elif self.distro in ['slackware','slamd64','bluewhite64']: elif self.distro in ['slackware', 'slamd64', 'bluewhite64']:
self.init = '/etc/rc.d/' self.init = '/etc/rc.d/'
self.initfile = 'init/slackware/rc.wicd' self.initfile = 'init/slackware/rc.wicd'
self.docdir = '/usr/doc/wicd-%s' % VERSION_NUM self.docdir = '/usr/doc/wicd-%s' % VERSION_NUM
@@ -285,7 +285,7 @@ class configure(Command):
self.initfile = 'init/lunar/wicd' self.initfile = 'init/lunar/wicd'
else : else :
if self.distro == 'auto': if self.distro == 'auto':
print "NOTICE: Automatic distro detection found: "+self.ddistro+", retrying with that..." print "NOTICE: Automatic distro detection found: " + self.ddistro + ", retrying with that..."
self.distro = self.ddistro self.distro = self.ddistro
self.distro_check() self.distro_check()
else: else:
@@ -479,6 +479,7 @@ 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:
@@ -487,10 +488,10 @@ message. It is probably because you haven't run python setup.py
configure yet or you are running it for the first time.''' configure yet or you are running it for the first time.'''
data = [] data = []
py_modules=['wicd.networking','wicd.misc','wicd.wnettools', py_modules = ['wicd.networking','wicd.misc','wicd.wnettools',
'wicd.wpath','wicd.dbusmanager', 'wicd.wpath','wicd.dbusmanager',
'wicd.logfile','wicd.backend','wicd.configmanager', 'wicd.logfile','wicd.backend','wicd.configmanager',
'wicd.translations'] 'wicd.translations']
# path to the file to put in empty directories # path to the file to put in empty directories
# fixes https://bugs.launchpad.net/wicd/+bug/503028 # fixes https://bugs.launchpad.net/wicd/+bug/503028
@@ -499,32 +500,39 @@ empty_file = 'other/.empty_on_purpose'
try: try:
print "Using init file",(wpath.init, wpath.initfile) print "Using init file",(wpath.init, wpath.initfile)
data = [ data = [
(wpath.dbus, ['other/wicd.conf']), (wpath.dbus, ['other/wicd.conf']),
(wpath.dbus_service, ['other/org.wicd.daemon.service']), (wpath.dbus_service, ['other/org.wicd.daemon.service']),
(wpath.systemd, ['other/wicd.service']), (wpath.systemd, ['other/wicd.service']),
(wpath.logrotate, ['other/wicd.logrotate']), (wpath.logrotate, ['other/wicd.logrotate']),
(wpath.log, [empty_file]), (wpath.log, [empty_file]),
(wpath.etc, ['other/dhclient.conf.template.default']), (wpath.etc, ['other/dhclient.conf.template.default']),
(wpath.encryption, [('encryption/templates/' + b) for b in (wpath.encryption, [('encryption/templates/' + b) for b in
os.listdir('encryption/templates') if not b.startswith('.')]), os.listdir('encryption/templates') if not b.startswith('.')]),
(wpath.networks, [empty_file]), (wpath.networks, [empty_file]),
(wpath.sbin, ['scripts/wicd']), (wpath.sbin, ['scripts/wicd']),
(wpath.daemon, ['wicd/monitor.py', 'wicd/wicd-daemon.py', (wpath.daemon, ['wicd/monitor.py', 'wicd/wicd-daemon.py',
'wicd/suspend.py', 'wicd/autoconnect.py']), 'wicd/suspend.py', 'wicd/autoconnect.py']),
(wpath.backends, ['wicd/backends/be-external.py', 'wicd/backends/be-ioctl.py']), (wpath.backends, ['wicd/backends/be-external.py', 'wicd/backends/be-ioctl.py']),
(wpath.scripts, [empty_file]), (wpath.scripts, [empty_file]),
(wpath.predisconnectscripts, [empty_file]), (wpath.predisconnectscripts, [empty_file]),
(wpath.postdisconnectscripts, [empty_file]), (wpath.postdisconnectscripts, [empty_file]),
(wpath.preconnectscripts, [empty_file]), (wpath.preconnectscripts, [empty_file]),
(wpath.postconnectscripts, [empty_file]), (wpath.postconnectscripts, [empty_file]),
] ]
if not wpath.no_install_gtk: if not wpath.no_install_gtk:
data.append((wpath.desktop, ['other/wicd.desktop'])) data.append((wpath.desktop, ['other/wicd.desktop']))
data.append((wpath.bin, ['scripts/wicd-client'])) data.append((wpath.bin, ['scripts/wicd-client']))
data.append((wpath.bin, ['scripts/wicd-gtk'])) data.append((wpath.bin, ['scripts/wicd-gtk']))
data.append((wpath.gtk, ['gtk/wicd-client.py', 'gtk/netentry.py', 'gtk/prefs.py', data.append((wpath.gtk, [
'gtk/gui.py', 'gtk/guiutil.py', 'data/wicd.ui', 'gtk/wicd-client.py',
'gtk/configscript.py'])) 'gtk/netentry.py',
'gtk/prefs.py',
'gtk/gui.py',
'gtk/guiutil.py',
'data/wicd.ui',
'gtk/configscript.py',
]))
data.append((wpath.autostart, ['other/wicd-tray.desktop'])) data.append((wpath.autostart, ['other/wicd-tray.desktop']))
if not wpath.no_install_man: if not wpath.no_install_man:
data.append((wpath.mandir + 'man1/', [ 'man/wicd-client.1' ])) data.append((wpath.mandir + 'man1/', [ 'man/wicd-client.1' ]))
@@ -575,23 +583,23 @@ try:
if not wpath.no_install_init: if not wpath.no_install_init:
data.append((wpath.init, [ wpath.initfile ])) data.append((wpath.init, [ wpath.initfile ]))
if not wpath.no_install_man: if not wpath.no_install_man:
data.append((wpath.mandir + 'man8/', [ 'man/wicd.8' ])) data.append((wpath.mandir + 'man8/', ['man/wicd.8']))
data.append((wpath.mandir + 'man5/', [ 'man/wicd-manager-settings.conf.5' ])) data.append((wpath.mandir + 'man5/', ['man/wicd-manager-settings.conf.5']))
data.append((wpath.mandir + 'man5/', [ 'man/wicd-wired-settings.conf.5' ])) data.append((wpath.mandir + 'man5/', ['man/wicd-wired-settings.conf.5']))
data.append((wpath.mandir + 'man5/', [ 'man/wicd-wireless-settings.conf.5' ])) data.append((wpath.mandir + 'man5/', ['man/wicd-wireless-settings.conf.5']))
data.append((wpath.mandir + 'man1/', [ 'man/wicd-client.1' ])) data.append((wpath.mandir + 'man1/', ['man/wicd-client.1']))
if not wpath.no_install_man and not wpath.no_install_i18n_man: if not wpath.no_install_man and not wpath.no_install_i18n_man:
# Dutch translations of the man # Dutch translations of the man
data.append((wpath.mandir + 'nl/man8/', [ 'man/nl/wicd.8' ])) data.append((wpath.mandir + 'nl/man8/', ['man/nl/wicd.8' ]))
data.append((wpath.mandir + 'nl/man5/', [ 'man/nl/wicd-manager-settings.conf.5' ])) data.append((wpath.mandir + 'nl/man5/', ['man/nl/wicd-manager-settings.conf.5']))
data.append((wpath.mandir + 'nl/man5/', [ 'man/nl/wicd-wired-settings.conf.5' ])) data.append((wpath.mandir + 'nl/man5/', ['man/nl/wicd-wired-settings.conf.5']))
data.append((wpath.mandir + 'nl/man5/', [ 'man/nl/wicd-wireless-settings.conf.5' ])) data.append((wpath.mandir + 'nl/man5/', ['man/nl/wicd-wireless-settings.conf.5']))
data.append((wpath.mandir + 'nl/man1/', [ 'man/nl/wicd-client.1' ])) data.append((wpath.mandir + 'nl/man1/', ['man/nl/wicd-client.1']))
if not wpath.no_install_acpi: if not wpath.no_install_acpi:
data.append((wpath.resume, ['other/80-wicd-connect.sh' ])) data.append((wpath.resume, ['other/80-wicd-connect.sh']))
data.append((wpath.suspend, ['other/50-wicd-suspend.sh' ])) data.append((wpath.suspend, ['other/50-wicd-suspend.sh']))
if not wpath.no_install_pmutils: if not wpath.no_install_pmutils:
data.append((wpath.pmutils, ['other/55wicd' ])) data.append((wpath.pmutils, ['other/55wicd']))
print 'Using pid path', os.path.basename(wpath.pidfile) print 'Using pid path', os.path.basename(wpath.pidfile)
print 'Language support for', print 'Language support for',
for language in os.listdir('translations/'): for language in os.listdir('translations/'):
@@ -605,22 +613,27 @@ 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(
'uninstall' : uninstall, 'test' : test, 'clear_generated' : cmdclass = {
clear_generated, 'update_translations_py' : 'configure' : configure,
update_translations_py}, 'get_translations' : get_translations,
name="Wicd", 'uninstall' : uninstall,
version=VERSION_NUM, 'test' : test,
description="A wireless and wired network manager", 'clear_generated' : clear_generated,
long_description="""A complete network connection manager 'update_translations_py' : update_translations_py,
},
name = "Wicd",
version = VERSION_NUM,
description = "A wireless and wired network manager",
long_description = """A complete network connection manager
Wicd supports wired and wireless networks, and capable of Wicd supports wired and wireless networks, and capable of
creating and tracking profiles for both. It has a creating and tracking profiles for both. It has a
template-based wireless encryption system, which allows the user template-based wireless encryption system, which allows the user
@@ -628,10 +641,10 @@ to easily add encryption methods used. It ships with some common
encryption types, such as WPA and WEP. Wicd will automatically encryption types, such as WPA and WEP. Wicd 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, Andrew Psaltis", author = "Adam Blackburn, Dan O'Reilly, Andrew Psaltis",
author_email="compwiz18@gmail.com, oreilldf@gmail.com, ampsaltis@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=py_modules, py_modules = py_modules,
data_files=data data_files = data,
) )