# HG changeset patch # User ymh # Date 1420360996 -3600 # Node ID e3affd6625d612368b87c7177e03bc0ceb5c89ab # Parent e839084fb54a8869cc088355b1e0e95364f6219f add packaging diff -r e839084fb54a -r e3affd6625d6 .hgignore --- a/.hgignore Tue Jan 06 15:53:09 2015 +0100 +++ b/.hgignore Sun Jan 04 09:43:16 2015 +0100 @@ -5,4 +5,7 @@ src/catedit/config.py src/catedit/log/ run/log/ -run/files/ \ No newline at end of file +run/files/ +dist/ +src/catedit.egg-info +catedit.egg-info diff -r e839084fb54a -r e3affd6625d6 MANIFEST.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MANIFEST.in Sun Jan 04 09:43:16 2015 +0100 @@ -0,0 +1,1 @@ +recursive-include src/catedit/static * diff -r e839084fb54a -r e3affd6625d6 setup.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setup.py Sun Jan 04 09:43:16 2015 +0100 @@ -0,0 +1,28 @@ +from setuptools import setup, find_packages + +setup( + name='catedit', + version="0.1.0", + url='http://www.iri.centrepompidou.fr', + author='I.R.I.', + author_email='dev@iri.centrepompidou.fr', + description='Category editor', + license='CECILL-B', + packages=find_packages('src'), + package_dir={'catedit':'src/catedit'}, + include_package_data=True, +# scripts=['src/catedit/bin/manage.py'], + zip_safe=False, + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Web Environment', + 'Framework :: Flask', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Topic :: Internet :: WWW/HTTP', + ], +) diff -r e839084fb54a -r e3affd6625d6 src/catedit/__init__.py --- a/src/catedit/__init__.py Tue Jan 06 15:53:09 2015 +0100 +++ b/src/catedit/__init__.py Sun Jan 04 09:43:16 2015 +0100 @@ -4,20 +4,33 @@ """ from logging import FileHandler, Formatter +import os from flask import Flask, session from flask.ext.github import GitHub from flask.ext.cache import Cache from flask.ext.restful import Api -from catedit.config import AppConfig from catedit.settings import AppSettings # set up app and database app = Flask(__name__) app.config.from_object(AppSettings) cache = Cache(app, config={"CACHE_TYPE": "simple"}) -app.config.from_object(AppConfig) +app_configured = False +try: + from catedit.config import AppConfig + app.config.from_object(AppConfig) + app_configured = True +except ImportError: + pass + +if 'CATEDIT_SETTINGS' in os.environ: + app.config.from_envvar('CATEDIT_SETTINGS') + app_configured = True + +if not app_configured: + raise Exception("Catedit not configured") #github github = GitHub(app)