diff --git a/bin/librefi b/bin/librefi new file mode 100755 index 0000000..cf0db07 --- /dev/null +++ b/bin/librefi @@ -0,0 +1,6 @@ +#!/usr/bin/env python + +import librefi + +if __name__ == '__main__': + librefi.main() diff --git a/librefi/__init__.py b/librefi/__init__.py index 4aa355c..15e1cef 100644 --- a/librefi/__init__.py +++ b/librefi/__init__.py @@ -27,5 +27,4 @@ def main(argv=None): __all__ = [ 'LibreFi', 'main', - '_real_main', ] diff --git a/setup.py b/setup.py index 684ec3a..17670c7 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,13 @@ import os import sys from shutil import rmtree -from setuptools import find_packages, setup, Command +try: + from setuptools import setup, Command + setuptools_available = True +except ImportError: + from distutils.core import setup, Command + setuptools_available = False + NAME = 'librefi' DESCRIPTION = 'LibreFi logs into public Wi-Fis without user interaction. Just access the network!' @@ -35,6 +41,12 @@ try: except FileNotFoundError: long_description = DESCRIPTION +params = {} +if setuptools_available: + params['entry_points'] = {'console_scripts': ['librefi = librefi:main']} +else: + params['scripts'] = ['bin/librefi'] + class UploadCommand(Command): """Support setup.py upload.""" @@ -84,10 +96,12 @@ setup( author_email=EMAIL, python_requires=REQUIRES_PYTHON, url=URL, + packages=[ + 'librefi', + 'librefi.connectors', + 'librefi.fxckers', + ], py_modules=['librefi'], - entry_points={ - 'console_scripts': ['librefi=librefi:main'], - }, install_requires=REQUIRED, extras_require=EXTRAS, include_package_data=True, @@ -112,4 +126,5 @@ setup( cmdclass={ 'upload': UploadCommand, }, + **params, )