setup.py (1786B)
1 import os 2 import glob 3 from setuptools import setup 4 from StringIO import StringIO 5 6 from distutils import log 7 from distutils.core import Command 8 from distutils.dep_util import newer 9 10 class build_ui(Command): 11 # Stolen from picard 12 description = "build Qt UI files" 13 user_options = [] 14 15 def initialize_options(self): 16 pass 17 18 def finalize_options(self): 19 pass 20 21 def run(self): 22 from PyQt4 import uic 23 for uifile in glob.glob("tombqt/*.ui"): 24 pyfile = "ui_%s.py" % os.path.splitext(os.path.basename(uifile))[0] 25 pyfile = os.path.join('tombqt', pyfile) 26 if newer(uifile, pyfile): 27 log.info("compiling %s -> %s", uifile, pyfile) 28 tmp = StringIO() 29 uic.compileUi(uifile, tmp) 30 source = tmp.getvalue() 31 f = open(pyfile, "w") 32 f.write(source) 33 f.close() 34 35 setup( 36 name = 'TombQt', 37 url = 'http://tomb.dyne.org/', 38 author = 'boyska', 39 author_email = 'piuttosto@logorroici.org', 40 version = '0.1', 41 packages = ['tombqt'], 42 cmdclass = { 43 'build_ui': build_ui 44 }, 45 entry_points = { 46 'gui_scripts': [ 47 'tomb-qt-create = tombqt.create:run_create_wizard', 48 'tomb-qt-open = tombqt.open:run_open_wizard' 49 ] 50 }, 51 classifiers = [ 52 'Topic :: Security :: Cryptography', 53 'Intended Audience :: End Users/Desktop', 54 'Operating System :: POSIX :: Linux', 55 'Environment :: X11 Applications :: Qt', 56 'License :: OSI Approved :: GNU General Public License (GPL)', 57 'Development Status :: 3 - Alpha' 58 ] 59 ) 60 61 62 63