From 852c4e888bc13edf35d4fccf85de46bc8e6d732c Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 8 May 2017 09:36:33 -0400 Subject: [PATCH] v0.1.0 --- flask_common.py | 8 ++++---- setup.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 setup.py diff --git a/flask_common.py b/flask_common.py index e15ad03..8f58a6a 100644 --- a/flask_common.py +++ b/flask_common.py @@ -98,13 +98,13 @@ class Common(object): """Initializes the Flask application with Common.""" if not hasattr(app, 'extensions'): app.extensions = {} - + if 'common' in app.extensions: - raise RuntimeError("Flask-common extension already initialized") - + raise RuntimeError("Flask-Common extension already initialized") + app.extensions['common'] = self self.app = app - + if not 'COMMON_FILESERVER_DISABLED' in app.config: with app.test_request_context() as c: diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..2ea9bec --- /dev/null +++ b/setup.py @@ -0,0 +1,48 @@ +""" +Flask-Common +------------- + +A Flask extension with lots of common time-savers (file-serving, favicons, etc). +""" +import os +import sys +from setuptools import setup + +if sys.argv[-1] == 'publish': + os.system('python setup.py sdist upload') + sys.exit() + +setup( + name='Flask-Common', + version='0.1.0', + url='https://github.com/kennethreitz/flask-common', + license='BSD', + author='Kenneth Reitz', + author_email='me@kennethreitz.org', + description='A Flask extension with lots of common time-savers (file-serving, favicons, etc).', + long_description=__doc__, + py_modules=['flask_common'], + # if you would be using a package instead use packages instead + # of py_modules: + # packages=['flask_sqlite3'], + zip_safe=False, + include_package_data=True, + platforms='any', + install_requires=[ + 'Flask', + 'Gunicorn', + 'WhiteNoise', + 'crayons', + 'maya', + 'flask_cache' + ], + classifiers=[ + 'Environment :: Web Environment', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', + 'Topic :: Software Development :: Libraries :: Python Modules' + ] +) \ No newline at end of file