threesixtyfive
changeset 4:f8623df33b61
Created setup.py script using setuptools
| author | Sybren Stüvel (laptop) <sybren@stuvel.eu> |
|---|---|
| date | Wed, 09 Apr 2008 22:02:09 +0200 |
| parents | bbc338baa675 |
| children | aa618ba0adb3 |
| files | setup.py threesixtyfive/GNUmakefile threesixtyfive/__init__.py threesixtyfive/main.py |
| diffstat | 4 files changed, 83 insertions(+), 52 deletions(-) [+] |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/setup.py Wed Apr 09 22:02:09 2008 +0200 1.3 @@ -0,0 +1,37 @@ 1.4 +# -*- encoding: utf-8 -*- 1.5 + 1.6 +from setuptools import setup, Distribution 1.7 +import os 1.8 +import sys 1.9 + 1.10 +from threesixtyfive import __version__ 1.11 + 1.12 +data = { 1.13 + 'name': 'threesixtyfive', 1.14 + 'version': __version__, 1.15 + 'author': u'Sybren Stüvel'.encode('utf-8'), 1.16 + 'author_email': 'sybren@stuvel.eu', 1.17 + 'maintainer': u'Sybren Stüvel'.encode('utf-8'), 1.18 + 'maintainer_email': 'sybren@stuvel.eu', 1.19 + 'description': 'GPhoto GUI frontent for self portrait shooters', 1.20 + 'long_description': 'Camera capturing tool, written to easily shoot ' 1.21 + 'photos controlled from a computer.', 1.22 + 'packages': ['threesixtyfive'], 1.23 + 'data_files': [], 1.24 + 'license': 'GPL', 1.25 + 'classifiers': [ 1.26 + 'Development Status :: 3 - Alpha', 1.27 + 'Intended Audience :: End Users/Desktop', 1.28 + 'License :: OSI Approved :: GNU General Public License (GPL)', 1.29 + 'Operating System :: OS Independent', 1.30 + 'Programming Language :: Python', 1.31 + 'Topic :: Multimedia :: Graphics :: Capture :: Digital Camera', 1.32 + 'Topic :: Artistic Software', 1.33 + 'Natural Language :: English', 1.34 + ], 1.35 + 'entry_points': { 1.36 + 'gui_scripts': ['threesixtyfive = threesixtyfive.main', ] 1.37 + } 1.38 +} 1.39 + 1.40 +setup(**data)
2.1 --- a/threesixtyfive/GNUmakefile Wed Apr 09 21:49:11 2008 +0200 2.2 +++ b/threesixtyfive/GNUmakefile Wed Apr 09 22:02:09 2008 +0200 2.3 @@ -1,20 +1,14 @@ 2.4 PY=$(wildcard *.py) 2.5 -PYC=$(patsubst %.py,%.pyc,${PY}) 2.6 - 2.7 UIS=$(patsubst %.ui,%.py,$(wildcard *.ui)) 2.8 2.9 all: threesixtyfive 2.10 2.11 -threesixtyfive: ${UIS} ${PYC} 2.12 +threesixtyfive: ${UIS} 2.13 2.14 %.py: %.ui 2.15 @echo "Generating $@ from $<" 2.16 @pyuic4 $< -o $@ 2.17 2.18 -%.pyc: %.py 2.19 - @echo "Compiling $<" 2.20 - @(echo 'import compiler'; echo 'compiler.compileFile("$<")') | python 2.21 - 2.22 clean: 2.23 @echo Cleaning up 2.24 @rm -f $(UIS) *.pyc
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/threesixtyfive/__init__.py Wed Apr 09 22:02:09 2008 +0200 3.3 @@ -0,0 +1,45 @@ 3.4 +#!/usr/bin/env python 3.5 +# -*- coding: utf-8 -*- 3.6 + 3.7 +'''GUI application for making self portraits. 3.8 + 3.9 +Uses the following CLI commands: 3.10 + - gphoto2 3.11 + - dcraw 3.12 +''' 3.13 + 3.14 +__author__ = 'Sybren Stüvel' 3.15 +__version__ = '0.1' 3.16 + 3.17 +import logging 3.18 +import sys 3.19 + 3.20 +import app 3.21 + 3.22 +logging.basicConfig() 3.23 +LOG = logging.getLogger('threesixtyfive') 3.24 +LOG.setLevel(logging.INFO) 3.25 + 3.26 +original_excepthook = sys.excepthook 3.27 +def handle_exception(cls, exception, traceback): 3.28 + '''Exception handler, shows popup''' 3.29 + 3.30 + message = "Sorry, something went wrong:\n%s: %s" % (cls.__name__, exception) 3.31 + mbox = QtGui.QMessageBox 3.32 + mbox.critical(None, "An error occurred", message) 3.33 + 3.34 + LOG.critical(message) 3.35 + 3.36 + original_excepthook(cls, exception, traceback) 3.37 + 3.38 + raise SystemExit() # IGNORE:W1010 3.39 + 3.40 +def main(): 3.41 + '''Main application method''' 3.42 + 3.43 + application = app.ThreeSixtyFive(sys.argv) 3.44 + sys.excepthook = handle_exception 3.45 + sys.exit(application.exec_()) 3.46 + 3.47 +if __name__ == '__main__': 3.48 + main()
4.1 --- a/threesixtyfive/main.py Wed Apr 09 21:49:11 2008 +0200 4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 4.3 @@ -1,45 +0,0 @@ 4.4 -#!/usr/bin/env python 4.5 -# -*- coding: utf-8 -*- 4.6 - 4.7 -'''GUI application for making self portraits. 4.8 - 4.9 -Uses the following CLI commands: 4.10 - - gphoto2 4.11 - - dcraw 4.12 -''' 4.13 - 4.14 -__revision__ = '0.1' 4.15 -__author__ = 'Sybren Stüvel' 4.16 - 4.17 -import logging 4.18 -import sys 4.19 - 4.20 -import app 4.21 - 4.22 -logging.basicConfig() 4.23 -LOG = logging.getLogger('threesixtyfive') 4.24 -LOG.setLevel(logging.INFO) 4.25 - 4.26 -original_excepthook = sys.excepthook 4.27 -def handle_exception(cls, exception, traceback): 4.28 - '''Exception handler, shows popup''' 4.29 - 4.30 - message = "Sorry, something went wrong:\n%s: %s" % (cls.__name__, exception) 4.31 - mbox = QtGui.QMessageBox 4.32 - mbox.critical(None, "An error occurred", message) 4.33 - 4.34 - LOG.critical(message) 4.35 - 4.36 - original_excepthook(cls, exception, traceback) 4.37 - 4.38 - raise SystemExit() # IGNORE:W1010 4.39 - 4.40 -def main(): 4.41 - '''Main application method''' 4.42 - 4.43 - application = app.ThreeSixtyFive(sys.argv) 4.44 - sys.excepthook = handle_exception 4.45 - sys.exit(application.exec_()) 4.46 - 4.47 -if __name__ == '__main__': 4.48 - main()
