Merge remote-tracking branch 'origin/master'

This commit is contained in:
James Muscat 2015-04-15 15:02:37 +01:00
commit 1d270c112f
4 changed files with 91 additions and 17 deletions

View File

@ -5,32 +5,26 @@
"additionalProperties": false,
"properties": {
"$schemaRef": {
"id": "#$schemaRef",
"type": "string",
"additionalProperties": false
},
"header": {
"id": "#header",
"type": "object",
"additionalProperties": true,
"properties": {
"uploaderID": {
"id": "#uploaderID",
"type": "string",
"additionalProperties": false
},
"softwareName": {
"id": "#softwareName",
"type": "string",
"additionalProperties": false
},
"softwareVersion": {
"id": "#softwareVersion",
"type": "string",
"additionalProperties": false
},
"gatewayTimestamp": {
"id": "#gatewayTimestamp",
"type": "string",
"format": "date-time",
"description": "Timestamp upon receipt at the gateway. If present, this property will be overwritten by the gateway; submitters are not intended to populate this property.",
@ -39,33 +33,27 @@
}
},
"message": {
"id": "#message",
"type": "object",
"additionalProperties": true,
"properties": {
"systemName": {
"id": "#systemName",
"type": "string",
"additionalProperties": false
},
"stationName": {
"id": "#stationName",
"type": "string",
"additionalProperties": false
},
"itemName": {
"id": "#itemName",
"type": "string",
"additionalProperties": false
},
"buyPrice": {
"id": "#buyPrice",
"type": "integer",
"description": "Price to buy from the market",
"additionalProperties": false
},
"stationStock": {
"id": "#stationStock",
"type": "integer",
"additionalProperties": false
},
@ -73,13 +61,11 @@
"$ref": "#/definitions/levelType"
},
"sellPrice": {
"id": "#sellPrice",
"type": "integer",
"description": "Price to sell to the market",
"additionalProperties": false
},
"demand": {
"id": "#demand",
"type": "integer",
"additionalProperties": false
},
@ -87,7 +73,6 @@
"$ref": "#/definitions/levelType"
},
"timestamp": {
"id": "#timestamp",
"type": "string",
"format": "date-time",
"additionalProperties": false

View File

@ -0,0 +1,88 @@
{
"$schema" : "http://json-schema.org/draft-04/schema#",
"id" : "http://schemas.elite-markets.net/eddn/commodity/2#",
"type" : "object",
"additionalProperties" : false,
"required" : [ "$schemaRef", "header", "message" ],
"properties" : {
"$schemaRef" : { "type": "string" },
"header" : {
"type" : "object",
"additionalProperties" : true,
"properties" : {
"uploaderID" : { "type": "string" },
"softwareName" : { "type": "string" },
"softwareVersion" : { "type": "string" },
"gatewayTimestamp" : {
"type": "string",
"format": "date-time",
"description": "Timestamp upon receipt at the gateway. If present, this property will be overwritten by the gateway; submitters are not intended to populate this property."
}
}
},
"message": {
"type": "object",
"additionalProperties": false,
"required": [ "systemName", "stationName", "timestamp", "commodities" ],
"properties": {
"systemName": {
"type" : "string"
},
"stationName": {
"type" : "string"
},
"timestamp": {
"type" : "string",
"format" : "date-time"
},
"commodities": {
"type" : "array",
"minItems" : 1,
"items" : {
"oneOf": [
{
"type" : "object",
"additionalProperties" : false,
"required" : [ "name", "buyPrice", "supply", "sellPrice", "demand" ],
"properties" : {
"name": {
"type" : "string",
"minLength" : 1
},
"buyPrice": {
"type": "integer",
"description": "Price to buy from the market"
},
"supply": {
"type": "integer"
},
"supplyLevel": {
"$ref": "#/definitions/levelType"
},
"sellPrice": {
"type": "integer",
"description": "Price to sell to the market"
},
"demand": {
"type": "integer"
},
"demandLevel": {
"$ref": "#/definitions/levelType"
}
}
}
]
}
}
}
}
},
"definitions" : {
"levelType" : {
"enum": ["Low", "Med", "High"]
}
}
}

View File

@ -27,7 +27,7 @@ setup(
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"],
install_requires=["argparse", "bottle", "enum34", "gevent", "jsonschema", "pyzmq", "simplejson"],
entry_points={
'console_scripts': [
'eddn-gateway = eddn.Gateway:main',

View File

@ -35,7 +35,8 @@ class _Settings(object):
GATEWAY_JSON_SCHEMAS = {
"http://schemas.elite-markets.net/eddn/commodity/1": "schemas/commodity-v0.1.json",
"http://schemas.elite-markets.net/eddn/commodity/1/test": "schemas/commodity-v0.1.json"
"http://schemas.elite-markets.net/eddn/commodity/1/test": "schemas/commodity-v0.1.json",
"http://schemas.elite-markets.net/eddn/commodity/2": "schemas/commodity-v2.0-draft.json"
}
def loadFrom(self, fileName):