1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-19 12:28:08 +01:00

Removed files that are generated by python setup.py configure

Added command to setup.py to clean out generated files ('cleargenerated')
Added the revision number to wicd-daemon.py --help
This commit is contained in:
Adam Blackburn
2008-12-30 10:31:06 -06:00
parent 1a98bf6890
commit ea69f2710e
18 changed files with 31 additions and 1066 deletions

View File

@@ -27,15 +27,16 @@ VERSION_NUM = '1.6.0'
REVISION_NUM = 'unknown'
try:
if not os.exists('vcsinfo.py'):
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:
print 'failed to find revision number'
except Exception, e:
print 'failed to find revision number:'
print e
class configure(Command):
description = "configure the paths that Wicd will be installed to"
@@ -236,6 +237,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"
@@ -387,7 +413,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",