mirror of
https://github.com/gryf/wicd.git
synced 2025-12-19 20:38:00 +01:00
Merged r233 from mainline
This commit is contained in:
44
setup.py
44
setup.py
@@ -25,6 +25,19 @@ import subprocess
|
||||
# Be sure to keep this updated!
|
||||
# VERSIONNUMBER
|
||||
VERSION_NUM = '1.6.0'
|
||||
REVISION_NUM = 'unknown'
|
||||
|
||||
try:
|
||||
if not os.path.exists('vcsinfo.py'):
|
||||
try:
|
||||
os.system('bzr version-info --python > vcsinfo.py')
|
||||
except:
|
||||
pass
|
||||
import vcsinfo
|
||||
REVISION_NUM = vcsinfo.version_info['revno']
|
||||
except Exception, e:
|
||||
print 'failed to find revision number:'
|
||||
print e
|
||||
|
||||
class configure(Command):
|
||||
description = "configure the paths that Wicd will be installed to"
|
||||
@@ -232,6 +245,10 @@ class configure(Command):
|
||||
for line in item_in.readlines():
|
||||
for item, value in values:
|
||||
line = line.replace('%' + str(item.upper().replace('-','_')) + '%', str(value))
|
||||
|
||||
# other things to replace that aren't arguments
|
||||
line = line.replace('%VERSION%', str(VERSION_NUM))
|
||||
line = line.replace('%REVNO%', str(REVISION_NUM))
|
||||
|
||||
item_out.write(line)
|
||||
|
||||
@@ -239,6 +256,31 @@ class configure(Command):
|
||||
item_in.close()
|
||||
shutil.copymode(original_name, final_name)
|
||||
|
||||
class cleargenerated(Command):
|
||||
description = 'clears out files generated by configure'
|
||||
|
||||
user_options = []
|
||||
|
||||
def initialize_options(self):
|
||||
pass
|
||||
|
||||
def finalize_options(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
print 'Removing completed template files...'
|
||||
for item in os.listdir('in'):
|
||||
if item.endswith('.in'):
|
||||
print 'Removing completed',item,
|
||||
original_name = os.path.join('in',item)
|
||||
final_name = item[:-3].replace('=','/')
|
||||
print final_name, '...',
|
||||
if os.path.exists(final_name):
|
||||
os.remove(final_name)
|
||||
print 'Removed.'
|
||||
else:
|
||||
print 'Does not exist.'
|
||||
|
||||
class test(Command):
|
||||
description = "run Wicd's unit tests"
|
||||
|
||||
@@ -390,7 +432,7 @@ 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},
|
||||
setup(cmdclass={'configure' : configure, 'get_translations' : get_translations, 'uninstall' : uninstall, 'test' : test, 'cleargenerated' : cleargenerated},
|
||||
name="Wicd",
|
||||
version=VERSION_NUM,
|
||||
description="A wireless and wired network manager",
|
||||
|
||||
Reference in New Issue
Block a user