From ee4de9e7e8e8b4101c2d9f865e82d1be5b7086df Mon Sep 17 00:00:00 2001 From: "Alexander V. Nikolaev" Date: Sat, 9 Apr 2011 19:27:47 +0300 Subject: [PATCH] Export djangosphinx/config.py as console_script entrypoint --- djangosphinx/config.py | 7 ++++++- setup.py | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/djangosphinx/config.py b/djangosphinx/config.py index 4b8f69f..313ac3e 100644 --- a/djangosphinx/config.py +++ b/djangosphinx/config.py @@ -53,4 +53,9 @@ def relative_path(*args): 'DATABASE_NAME': settings.DATABASE_NAME, }) -print render_to_string(getattr(settings, 'SPHINX_CONFIG_TEMPLATE', 'conf/sphinx.conf'), context) +def main(): + print render_to_string(getattr(settings, + 'SPHINX_CONFIG_TEMPLATE', 'conf/sphinx.conf'), context) + +if __name__ == '__main__': + main() diff --git a/setup.py b/setup.py index 43b8582..c37c9c1 100755 --- a/setup.py +++ b/setup.py @@ -14,6 +14,10 @@ description = 'An integration layer bringing Django and Sphinx Search together.', packages=find_packages(), include_package_data=True, + entry_points=""" + [console_scripts] + django-sphinx-config=djangosphinx.config:main + """, classifiers=[ "Framework :: Django", "Intended Audience :: Developers",