Permalink
Browse files

Build an egg, and create an eddn-gateway script.

Currently can only be run from a directory where ../schemas exists
and is populated...
  • Loading branch information...
1 parent 2bddaec commit 608ff4972321c2ee167dc480e7fcf26eda99adb2 @jamesremuscat committed Apr 3, 2015
Showing with 44 additions and 3 deletions.
  1. +2 −0 setup.cfg
  2. +36 −0 setup.py
  3. +6 −3 src/eddn/Gateway.py
View
@@ -0,0 +1,2 @@
+[egg_info]
+tag_build = .dev
View
@@ -0,0 +1,36 @@
+from setuptools import setup, find_packages
+import re
+
+
+VERSIONFILE = "src/eddn/__init__.py"
+verstr = "unknown"
+try:
+ verstrline = open(VERSIONFILE, "rt").read()
+ VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
+ mo = re.search(VSRE, verstrline, re.M)
+ if mo:
+ verstr = mo.group(1)
+except EnvironmentError:
+ print "unable to find version in %s" % (VERSIONFILE,)
+ raise RuntimeError("if %s exists, it is required to be well-formed" % (VERSIONFILE,))
+
+
+setup(
+ name='eddn',
+ version=verstr,
+ description='Elite: Dangerous Data Network',
+ author='James Muscat',
+ author_email='muscaat@elite-markets.net',
+ url='https://github.com/jamesremuscat/eddn',
+ packages=find_packages('src', exclude=["*.tests"]),
+ package_dir = {'':'src'},
+ long_description="""\
+ The Elite: Dangerous Data Network allows E:D players to share data. Not affiliated with Frontier Developments.
+ """,
+ install_requires=["bottle", "enum34", "gevent", "jsonschema", "pyzmq", "simplejson"],
+ entry_points={
+ 'console_scripts': [
+ 'eddn-gateway = eddn.Gateway:main',
+ ],
+ }
+ )
View
@@ -10,7 +10,6 @@
import zlib
import zmq.green as zmq
from datetime import datetime
-from eddn import __version__ as EDDN_VERSION
from eddn.conf import Settings
from eddn.Validator import Validator, ValidationSeverity
@@ -169,7 +168,7 @@ def health_check():
to detect whether the gateway is still alive, and whether it should remain
in the DNS rotation.
"""
- return EDDN_VERSION
+ return Settings.EDDN_VERSION
class MalformedUploadError(Exception):
@@ -181,5 +180,9 @@ class MalformedUploadError(Exception):
pass
-if __name__ == '__main__':
+def main():
run(host='0.0.0.0', port=8080, server='gevent')
+
+
+if __name__ == '__main__':
+ main()

0 comments on commit 608ff49

Please sign in to comment.