Fix missing schemas in setup

This commit is contained in:
AnthorNet 2015-05-04 12:57:40 +02:00
parent 80445e19dd
commit 915aee107c
2 changed files with 10 additions and 4 deletions

View File

@ -1,13 +1,14 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
import re import re
import glob
VERSIONFILE = "src/eddn/_version.py" VERSIONFILE = "src/eddn/_version.py"
verstr = "unknown" verstr = "unknown"
try: try:
verstrline = open(VERSIONFILE, "rt").read() verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M) mo = re.search(VSRE, verstrline, re.M)
if mo: if mo:
verstr = mo.group(1) verstr = mo.group(1)
except EnvironmentError: except EnvironmentError:
@ -24,6 +25,7 @@ setup(
url='https://github.com/jamesremuscat/eddn', url='https://github.com/jamesremuscat/eddn',
packages=find_packages('src', exclude=["*.tests"]), packages=find_packages('src', exclude=["*.tests"]),
package_dir = {'':'src'}, package_dir = {'':'src'},
data_files=[('eddn/schemas', glob.glob("schemas/*.json"))],
long_description="""\ long_description="""\
The Elite: Dangerous Data Network allows E:D players to share data. Not affiliated with Frontier Developments. The Elite: Dangerous Data Network allows E:D players to share data. Not affiliated with Frontier Developments.
""", """,

View File

@ -10,6 +10,9 @@ import urlparse
import zlib import zlib
import zmq.green as zmq import zmq.green as zmq
from datetime import datetime from datetime import datetime
import os
from eddn._Conf.Settings import Settings, loadConfig from eddn._Conf.Settings import Settings, loadConfig
from eddn.Validator import Validator, ValidationSeverity from eddn.Validator import Validator, ValidationSeverity
@ -39,7 +42,8 @@ def configure():
sender.bind(binding) sender.bind(binding)
for schemaRef, schemaFile in Settings.GATEWAY_JSON_SCHEMAS.iteritems(): for schemaRef, schemaFile in Settings.GATEWAY_JSON_SCHEMAS.iteritems():
validator.addSchemaResource(schemaRef, schemaFile) #filename = resource_filename(Requirement.parse("eddn"), schemaFile)
validator.addSchemaResource(schemaRef, os.path.dirname(__file__) + '/' + schemaFile)
def push_message(string_message): def push_message(string_message):