aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-09-07 21:38:38 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-09-07 21:38:38 +0200
commit9eff7a9b1e32649c2addba488cef2323dcc92b9a (patch)
treea13d0a8a344681a1c384f65fe7220925d3c29aa6
parent1733547e0481f3dd2a500577126c5382dc6bb4f7 (diff)
downloadee-python-9eff7a9b1e32649c2addba488cef2323dcc92b9a.tar.gz
ee-python-9eff7a9b1e32649c2addba488cef2323dcc92b9a.tar.bz2
ee-python-9eff7a9b1e32649c2addba488cef2323dcc92b9a.tar.xz
ee-python-9eff7a9b1e32649c2addba488cef2323dcc92b9a.zip
o Adding a 'ee' binary entry point.
-rw-r--r--setup.py3
-rw-r--r--src/ee/__main__.py6
2 files changed, 7 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index e1a428f..1580612 100644
--- a/setup.py
+++ b/setup.py
@@ -10,4 +10,7 @@ setup(name='ee',
version='1.0',
packages=find_packages('src'),
package_dir={'': 'src'},
+ entry_points = {
+ 'console_scripts': ['ee=ee.__main__:main'],
+ },
)
diff --git a/src/ee/__main__.py b/src/ee/__main__.py
index 75688c0..6bb40b0 100644
--- a/src/ee/__main__.py
+++ b/src/ee/__main__.py
@@ -29,8 +29,7 @@ def find_tools():
tools.append(Tool(module_name, name))
return sorted(tools)
-if __name__ == "__main__":
-
+def main():
logging.basicConfig() # you need to initialize logging, otherwise you will not see anything from requests
logging.getLogger().setLevel(logging.DEBUG)
requests_log = logging.getLogger("requests.packages.urllib3")
@@ -51,3 +50,6 @@ if __name__ == "__main__":
eprint("No such tool: {}".format(name))
exit(1)
+
+if __name__ == "__main__":
+ main()