From 4caec73a885854a5f312392c6b31a0eb63a32bc8 Mon Sep 17 00:00:00 2001 From: AnthorNet Date: Thu, 18 Jun 2015 07:52:25 +0200 Subject: [PATCH 01/15] EDDB now handles commodity v2 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f8da53b..5ad58f9 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ EDDN Status: http://eddn-gateway.elite-markets.net/ | http://eddn.ed-td.space/ | -------------------------------------------------------------------------------------- | ------------- | --------------- | --------------- | | [**E:D Market Connector**](https://github.com/Marginal/EDMarketConnector) | Otis B. | No | **Yes** (v1/v2) | | [**edce-client**](https://github.com/Andargor/edce-client/) | Andargor | No | **Yes** (v1/v2) | -| [**EDDB**](http://eddb.io/) | themroc | **Yes** (v1) | No | +| [**EDDB**](http://eddb.io/) | themroc | **Yes** (v1/v2) | No | | [**ED-TD**](http://ed-tb.space/) | AnthorNet | **Yes** (v1/v2) | **Yes** (v2) | | [**EliteOCR**](https://forums.frontier.co.uk/showthread.php?t=68771) | seeebek | No | **Yes** (v1) | -| [**Maddavo's Market Data**](http://www.davek.com.au/td/) | maddavo | **Yes** (v1/v2) | **Yes** (v1/v2) | +| [**Maddavo's Market Data**](http://www.davek.com.au/td/) | maddavo | **Yes** (v1/v2) | **Yes** (v1/v2) | | [**RegulatedNoise DJ-version**](https://forums.frontier.co.uk/showthread.php?t=137732) | Duke | **Yes** (v1) | **Yes** (v1) | From c0d4f4c8b01dadf3ad1f3fe396087fc9667a5de4 Mon Sep 17 00:00:00 2001 From: AnthorNet Date: Fri, 19 Jun 2015 22:23:20 +0200 Subject: [PATCH 02/15] Add outdated schema functionnality. Also added shipyard to release. --- contrib/monitor/index.html | 6 ++++++ contrib/monitor/js/eddn.js | 9 +++++++-- ...{shipyard-v1.0-draft.json => shipyard-v1.0.json} | 0 src/eddn/Gateway.py | 6 ++++++ src/eddn/conf/Settings.py | 13 +++++++++---- src/eddn/conf/Version.py | 2 +- 6 files changed, 29 insertions(+), 7 deletions(-) rename schemas/{shipyard-v1.0-draft.json => shipyard-v1.0.json} (100%) diff --git a/contrib/monitor/index.html b/contrib/monitor/index.html index be45c70..753a421 100644 --- a/contrib/monitor/index.html +++ b/contrib/monitor/index.html @@ -100,6 +100,12 @@ - - + + Outdated messages + - + - + - + Messages passed to relay - diff --git a/contrib/monitor/js/eddn.js b/contrib/monitor/js/eddn.js index 3a76909..b502f67 100644 --- a/contrib/monitor/js/eddn.js +++ b/contrib/monitor/js/eddn.js @@ -451,6 +451,10 @@ var showStats = function(type, currentItem){ el.find(".invalid_1min").html((currentItemStats["invalid"] || {})['1min'] || 0); el.find(".invalid_5min").html((currentItemStats["invalid"] || {})['5min'] || 0); el.find(".invalid_60min").html((currentItemStats["invalid"] || {})['60min'] || 0); + + el.find(".outdated_1min").html((currentItemStats["outdated"] || {})['1min'] || 0); + el.find(".outdated_5min").html((currentItemStats["outdated"] || {})['5min'] || 0); + el.find(".outdated_60min").html((currentItemStats["outdated"] || {})['60min'] || 0); } if(type == 'relays') @@ -525,8 +529,9 @@ var start = function(){ credits: { enabled: false }, exporting: { enabled: false }, series: [ - {id: 'inbound', data: [], name: 'Messages received', zIndex: 300}, - {id: 'invalid', data: [], name: 'Invalid messages', zIndex: 1}, + {id: 'inbound', data: [], name: 'Messages received', zIndex: 300}, + {id: 'invalid', data: [], name: 'Invalid messages', zIndex: 1}, + {id: 'outdated', data: [], name: 'Outdated messages', zIndex: 1}, {id: 'outbound', data: [], name: 'Messages passed to relay', zIndex: 200} ] }).hide(); diff --git a/schemas/shipyard-v1.0-draft.json b/schemas/shipyard-v1.0.json similarity index 100% rename from schemas/shipyard-v1.0-draft.json rename to schemas/shipyard-v1.0.json diff --git a/src/eddn/Gateway.py b/src/eddn/Gateway.py index fe0e39d..1656ce0 100644 --- a/src/eddn/Gateway.py +++ b/src/eddn/Gateway.py @@ -130,6 +130,12 @@ def parse_and_error_handle(data): logger.error("Error to %s: %s" % (get_remote_address(), exc.message)) return str(exc) + # Here we check if an outdated schema has been passed + if parsed_message["$schemaRef"] in Settings.GATEWAY_OUTDATED_SCHEMAS.keys(): + response.status = 426 + statsCollector.tally("outdated") + return "FAIL: The schema you have used need an upgrade. Update your software." + validationResults = validator.validate(parsed_message) if validationResults.severity <= ValidationSeverity.WARN: diff --git a/src/eddn/conf/Settings.py b/src/eddn/conf/Settings.py index 1d436c7..6e7f86e 100644 --- a/src/eddn/conf/Settings.py +++ b/src/eddn/conf/Settings.py @@ -38,11 +38,16 @@ class _Settings(object): GATEWAY_IP_KEY_SALT = None 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/2": "schemas/commodity-v2.0.json", - "http://schemas.elite-markets.net/eddn/commodity/2/test": "schemas/commodity-v2.0.json" + "http://schemas.elite-markets.net/eddn/commodity/2/test": "schemas/commodity-v2.0.json", + + "http://schemas.elite-markets.net/eddn/shipyard/1": "schemas/shipyard-v1.0.json", + "http://schemas.elite-markets.net/eddn/shipyard/1/test": "schemas/shipyard-v1.0.json" + } + + GATEWAY_OUTDATED_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" } ############################################################################### diff --git a/src/eddn/conf/Version.py b/src/eddn/conf/Version.py index 5b67b06..576116a 100644 --- a/src/eddn/conf/Version.py +++ b/src/eddn/conf/Version.py @@ -1,3 +1,3 @@ # coding: utf8 -__version__ = "0.4" +__version__ = "0.5 BETA" From 1f85be3beb146387070cc57060fe6328212dbd26 Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Sat, 20 Jun 2015 00:28:50 +0100 Subject: [PATCH 03/15] Add reason text to reply for outdated schemas. --- src/eddn/Gateway.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eddn/Gateway.py b/src/eddn/Gateway.py index 1656ce0..4367f62 100644 --- a/src/eddn/Gateway.py +++ b/src/eddn/Gateway.py @@ -132,7 +132,7 @@ def parse_and_error_handle(data): # Here we check if an outdated schema has been passed if parsed_message["$schemaRef"] in Settings.GATEWAY_OUTDATED_SCHEMAS.keys(): - response.status = 426 + response.status = '426 Upgrade Required' # Bottle (and underlying httplib) don't know this one statsCollector.tally("outdated") return "FAIL: The schema you have used need an upgrade. Update your software." From 37b58bb2890a685e61e615a135a871f7d5b7c931 Mon Sep 17 00:00:00 2001 From: James Muscat Date: Wed, 24 Jun 2015 16:36:16 +0100 Subject: [PATCH 04/15] Fix spelling. --- contrib/monitor/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/monitor/index.html b/contrib/monitor/index.html index 514d62a..e0bc807 100644 --- a/contrib/monitor/index.html +++ b/contrib/monitor/index.html @@ -39,7 +39,7 @@ @@ -223,10 +223,10 @@ -
+
-

Softwares

+

Software

@@ -391,4 +391,4 @@ - \ No newline at end of file + From 0a4ccbb2f605d6f085fca29bbe59b7d153decc2c Mon Sep 17 00:00:00 2001 From: AnthorNet Date: Wed, 24 Jun 2015 18:31:57 +0200 Subject: [PATCH 05/15] Fix spelling #27 --- contrib/monitor/js/eddn.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/contrib/monitor/js/eddn.js b/contrib/monitor/js/eddn.js index b502f67..5dcfd66 100644 --- a/contrib/monitor/js/eddn.js +++ b/contrib/monitor/js/eddn.js @@ -76,7 +76,7 @@ var doUpdateSoftwares = function() dataType: "json", url: monitorEndPoint + 'getTotalSoftwares/', success: function(softwaresTotalData){ - var chart = $('#softwares .chart').highcharts(), + var chart = $('#software .chart').highcharts(), series = chart.get('softwares'); // Count total by software, all versions included @@ -99,13 +99,13 @@ var doUpdateSoftwares = function() tmp.sort(function(a,b) { return b.total - a.total; }); softwaresTotal = tmp; - $('#softwares .table tbody').empty(); + $('#software .table tbody').empty(); // Prepare drilldowns $.each(softwaresTotalData, function(software, hits){ softwareSplit = software.split(' | '); - $('#softwares .table tbody').append( + $('#software .table tbody').append( newTr = $('').attr('data-type', 'drilldown').attr('data-parent', softwareSplit[0]).attr('data-name', software).on('mouseover', function(){ chart.get('software-' + makeSlug(software)).setState('hover'); chart.tooltip.refresh(chart.get('software-' + makeSlug(software))); @@ -144,7 +144,7 @@ var doUpdateSoftwares = function() // Add main softwares $.each(softwaresTotal, function(key, values){ - $('#softwares .table tbody').append( + $('#software .table tbody').append( newTr = $('').attr('data-type', 'parent').attr('data-name', values.name).on('click', function(event){ event.stopImmediatePropagation(); currentSoftware = $(this).attr('data-name'); @@ -153,22 +153,22 @@ var doUpdateSoftwares = function() { currentDrillDown = currentSoftware; - $('#softwares .table thead th:eq(0)').html('') + $('#software .table thead th:eq(0)').html('') .css('cursor','pointer') .on('click', function(){ currentDrillDown = false; chart.showDrillUpButton(); - $('#softwares .table thead th:eq(0)').html(''); - $('#softwares .table thead th:eq(1)').html(''); - $('#softwares .table tbody tr[data-type=parent]').show(); - $('#softwares .table tbody tr[data-type=drilldown]').hide(); + $('#software .table thead th:eq(0)').html(''); + $('#software .table thead th:eq(1)').html(''); + $('#software .table tbody tr[data-type=parent]').show(); + $('#software .table tbody tr[data-type=drilldown]').hide(); drillDownSoftware = !drillDownSoftware; doUpdateSoftwares(); chart.drillUp(); }); - $('#softwares .table thead th:eq(1)').html(currentSoftware); - $('#softwares .table tbody tr[data-type=parent]').hide(); - $('#softwares .table tbody tr[data-type=drilldown][data-parent="' + currentSoftware + '"]').show(); + $('#software .table thead th:eq(1)').html(currentSoftware); + $('#software .table tbody tr[data-type=parent]').hide(); + $('#software .table tbody tr[data-type=drilldown][data-parent="' + currentSoftware + '"]').show(); var currentData = []; @@ -191,7 +191,7 @@ var doUpdateSoftwares = function() if(chart.drillUpButton) chart.drillUpButton = chart.drillUpButton.destroy(); - $('#softwares .table tbody tr[data-type=drilldown][data-parent="' + currentSoftware + '"]').each(function(){ + $('#software .table tbody tr[data-type=drilldown][data-parent="' + currentSoftware + '"]').each(function(){ $(this).find('.square').css('background', chart.get('software-' + makeSlug($(this).attr('data-name'))).color); }); } @@ -237,18 +237,18 @@ var doUpdateSoftwares = function() }); if(drillDownSoftware) - $('#softwares .table tbody tr[data-type=drilldown][data-parent="' + currentDrillDown + '"]').each(function(){ + $('#software .table tbody tr[data-type=drilldown][data-parent="' + currentDrillDown + '"]').each(function(){ $(this).find('.square').css('background', chart.get('software-' + makeSlug($(this).attr('data-name'))).color); }); chart.redraw(); - $('#softwares').find(".stat").removeClass("warning").each(function() { + $('#software').find(".stat").removeClass("warning").each(function() { if ($(this).html() == "0") $(this).addClass("warning"); }); - $('#softwares').find(".update_timestamp").html(d.toString("yyyy-MM-dd HH:mm:ss")); + $('#software').find(".update_timestamp").html(d.toString("yyyy-MM-dd HH:mm:ss")); } }); } @@ -595,7 +595,7 @@ var start = function(){ }, updateInterval); // Grab software from monitor - $('#softwares .chart').highcharts({ + $('#software .chart').highcharts({ chart: { type: 'pie', animation: Highcharts.svg }, From e5b3ba64046b6b0a25224fa2147c49a96e199b80 Mon Sep 17 00:00:00 2001 From: AnthorNet Date: Mon, 29 Jun 2015 09:34:01 +0200 Subject: [PATCH 06/15] Add detailled information about schemas in monitor --- contrib/monitor/index.html | 17 +- contrib/monitor/schemas.html | 312 +++++++++++++++++++++++++++++++++++ 2 files changed, 325 insertions(+), 4 deletions(-) create mode 100644 contrib/monitor/schemas.html diff --git a/contrib/monitor/index.html b/contrib/monitor/index.html index 1cbc1d2..7673e50 100644 --- a/contrib/monitor/index.html +++ b/contrib/monitor/index.html @@ -266,7 +266,10 @@
-
+
+ Total hits calculated since May 5, 2015 +
+

Last updated: N/A.

@@ -316,7 +319,10 @@
-
+
+ Total hits calculated since May 5, 2015 +
+

Last updated: N/A.

@@ -332,7 +338,7 @@
-

Schemas

+

Schemas

@@ -366,7 +372,10 @@
-
+
+ Total hits calculated since May 5, 2015 +
+

Last updated: N/A.

diff --git a/contrib/monitor/schemas.html b/contrib/monitor/schemas.html new file mode 100644 index 0000000..e033951 --- /dev/null +++ b/contrib/monitor/schemas.html @@ -0,0 +1,312 @@ + + + + + + + EDDN Status - Schemas + + + + + + + + + + + + + +
+ +
+ +
+
+
+

Schemas (Last 60 days)

+
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+ +
+
+
+

Schemas in percent (Last 60 days)

+
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+ + + + + + + + + + + From e38baa4140cd9a3639faee805815de3a1948cc09 Mon Sep 17 00:00:00 2001 From: AnthorNet Date: Mon, 29 Jun 2015 09:41:29 +0200 Subject: [PATCH 07/15] Fix typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ad58f9..db1ca4f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ EDDN Status: http://eddn-gateway.elite-markets.net/ | http://eddn.ed-td.space/ | [**E:D Market Connector**](https://github.com/Marginal/EDMarketConnector) | Otis B. | No | **Yes** (v1/v2) | | [**edce-client**](https://github.com/Andargor/edce-client/) | Andargor | No | **Yes** (v1/v2) | | [**EDDB**](http://eddb.io/) | themroc | **Yes** (v1/v2) | No | -| [**ED-TD**](http://ed-tb.space/) | AnthorNet | **Yes** (v1/v2) | **Yes** (v2) | +| [**ED-TD**](http://ed-td.space/) | AnthorNet | **Yes** (v1/v2) | **Yes** (v2) | | [**EliteOCR**](https://forums.frontier.co.uk/showthread.php?t=68771) | seeebek | No | **Yes** (v1) | | [**Maddavo's Market Data**](http://www.davek.com.au/td/) | maddavo | **Yes** (v1/v2) | **Yes** (v1/v2) | | [**RegulatedNoise DJ-version**](https://forums.frontier.co.uk/showthread.php?t=137732) | Duke | **Yes** (v1) | **Yes** (v1) | From 2ffd62a9338c9a68cc54771301fbb8792fef62f9 Mon Sep 17 00:00:00 2001 From: James Muscat Date: Wed, 1 Jul 2015 21:38:08 +0100 Subject: [PATCH 08/15] Bump version number. --- src/eddn/conf/Version.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/eddn/conf/Version.py b/src/eddn/conf/Version.py index 576116a..6c46f47 100644 --- a/src/eddn/conf/Version.py +++ b/src/eddn/conf/Version.py @@ -1,3 +1,2 @@ -# coding: utf8 - -__version__ = "0.5 BETA" +# This should be a version number as understood by setuptools +__version__ = "0.5" From 8cdd2b4c84d8eabfa7f1ae234009db2c8ccba5e6 Mon Sep 17 00:00:00 2001 From: James Muscat Date: Wed, 1 Jul 2015 21:44:19 +0100 Subject: [PATCH 09/15] Add WSGI hook for running gateway through uWSGI. --- src/eddn/Gateway.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/eddn/Gateway.py b/src/eddn/Gateway.py index 4367f62..9d2b505 100644 --- a/src/eddn/Gateway.py +++ b/src/eddn/Gateway.py @@ -21,7 +21,7 @@ from eddn.core.Validator import Validator, ValidationSeverity from gevent import monkey monkey.patch_all() -from bottle import run, request, response, get, post +from bottle import default_app, run, request, response, get, post logger = logging.getLogger(__name__) @@ -219,3 +219,5 @@ def main(): if __name__ == '__main__': main() +else: + application = app = default_app() From a2ebb94c7a5e62a854d20ca784d319b8f2691f78 Mon Sep 17 00:00:00 2001 From: James Muscat Date: Wed, 1 Jul 2015 21:44:42 +0100 Subject: [PATCH 10/15] Coding standards. --- src/eddn/Gateway.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eddn/Gateway.py b/src/eddn/Gateway.py index 9d2b505..6aacd4a 100644 --- a/src/eddn/Gateway.py +++ b/src/eddn/Gateway.py @@ -132,7 +132,7 @@ def parse_and_error_handle(data): # Here we check if an outdated schema has been passed if parsed_message["$schemaRef"] in Settings.GATEWAY_OUTDATED_SCHEMAS.keys(): - response.status = '426 Upgrade Required' # Bottle (and underlying httplib) don't know this one + response.status = '426 Upgrade Required' # Bottle (and underlying httplib) don't know this one statsCollector.tally("outdated") return "FAIL: The schema you have used need an upgrade. Update your software." From f591d3a8150e6e144155f91cbea782ee05c24102 Mon Sep 17 00:00:00 2001 From: James Muscat Date: Wed, 1 Jul 2015 21:46:16 +0100 Subject: [PATCH 11/15] Slightly nicer error message. --- src/eddn/Gateway.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eddn/Gateway.py b/src/eddn/Gateway.py index 6aacd4a..d2f11ae 100644 --- a/src/eddn/Gateway.py +++ b/src/eddn/Gateway.py @@ -134,7 +134,7 @@ def parse_and_error_handle(data): if parsed_message["$schemaRef"] in Settings.GATEWAY_OUTDATED_SCHEMAS.keys(): response.status = '426 Upgrade Required' # Bottle (and underlying httplib) don't know this one statsCollector.tally("outdated") - return "FAIL: The schema you have used need an upgrade. Update your software." + return "FAIL: The schema you have used is no longer supported. Please check for an updated version of your application." validationResults = validator.validate(parsed_message) From 13a651175dafc014c9b4cfcb963962463bde7706 Mon Sep 17 00:00:00 2001 From: James Muscat Date: Wed, 1 Jul 2015 22:25:38 +0100 Subject: [PATCH 12/15] We still need to configure the gateway when running in wsgi mode! --- src/eddn/Gateway.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/eddn/Gateway.py b/src/eddn/Gateway.py index d2f11ae..bc448a1 100644 --- a/src/eddn/Gateway.py +++ b/src/eddn/Gateway.py @@ -45,7 +45,7 @@ def configure(): sender.bind(binding) for schemaRef, schemaFile in Settings.GATEWAY_JSON_SCHEMAS.iteritems(): - validator.addSchemaResource(schemaRef, resource_string(__name__, schemaFile)) + validator.addSchemaResource(schemaRef, resource_string('eddn.Gateway', schemaFile)) def push_message(string_message, topic): @@ -211,12 +211,11 @@ class MalformedUploadError(Exception): def main(): - loadConfig() - - configure() run(host='0.0.0.0', port=Settings.GATEWAY_HTTP_PORT, server='gevent') +loadConfig() +configure() if __name__ == '__main__': main() else: From 2d6e7d9f3827fb65a5a969ed5b1cb141c3078ff2 Mon Sep 17 00:00:00 2001 From: James Muscat Date: Wed, 1 Jul 2015 22:27:12 +0100 Subject: [PATCH 13/15] This just needs to be a list, not a dict. --- src/eddn/Gateway.py | 2 +- src/eddn/conf/Settings.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/eddn/Gateway.py b/src/eddn/Gateway.py index bc448a1..5d79d77 100644 --- a/src/eddn/Gateway.py +++ b/src/eddn/Gateway.py @@ -131,7 +131,7 @@ def parse_and_error_handle(data): return str(exc) # Here we check if an outdated schema has been passed - if parsed_message["$schemaRef"] in Settings.GATEWAY_OUTDATED_SCHEMAS.keys(): + if parsed_message["$schemaRef"] in Settings.GATEWAY_OUTDATED_SCHEMAS: response.status = '426 Upgrade Required' # Bottle (and underlying httplib) don't know this one statsCollector.tally("outdated") return "FAIL: The schema you have used is no longer supported. Please check for an updated version of your application." diff --git a/src/eddn/conf/Settings.py b/src/eddn/conf/Settings.py index 6e7f86e..c4cafcf 100644 --- a/src/eddn/conf/Settings.py +++ b/src/eddn/conf/Settings.py @@ -45,10 +45,10 @@ class _Settings(object): "http://schemas.elite-markets.net/eddn/shipyard/1/test": "schemas/shipyard-v1.0.json" } - GATEWAY_OUTDATED_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" - } + GATEWAY_OUTDATED_SCHEMAS = [ + "http://schemas.elite-markets.net/eddn/commodity/1", + "http://schemas.elite-markets.net/eddn/commodity/1/test" + ] ############################################################################### # Monitor settings From 6a74a2ae254b7cbc2861724e007add364711c490 Mon Sep 17 00:00:00 2001 From: James Muscat Date: Wed, 1 Jul 2015 22:27:25 +0100 Subject: [PATCH 14/15] Remove obsolete schema. --- schemas/commodity-v0.1.json | 102 ------------------------------------ 1 file changed, 102 deletions(-) delete mode 100644 schemas/commodity-v0.1.json diff --git a/schemas/commodity-v0.1.json b/schemas/commodity-v0.1.json deleted file mode 100644 index c98b3dd..0000000 --- a/schemas/commodity-v0.1.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "http://schemas.elite-markets.net/eddn/commodity/1#", - "type": "object", - "additionalProperties": false, - "properties": { - "$schemaRef": { - "type": "string", - "additionalProperties": false - }, - "header": { - "type": "object", - "additionalProperties": true, - "properties": { - "uploaderID": { - "type": "string", - "additionalProperties": false - }, - "softwareName": { - "type": "string", - "additionalProperties": false - }, - "softwareVersion": { - "type": "string", - "additionalProperties": false - }, - "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.", - "additionalProperties": false - } - } - }, - "message": { - "type": "object", - "additionalProperties": true, - "properties": { - "systemName": { - "type": "string", - "additionalProperties": false - }, - "stationName": { - "type": "string", - "additionalProperties": false - }, - "itemName": { - "type": "string", - "additionalProperties": false - }, - "buyPrice": { - "type": "integer", - "description": "Price to buy from the market", - "additionalProperties": false - }, - "stationStock": { - "type": "integer", - "additionalProperties": false - }, - "supplyLevel": { - "$ref": "#/definitions/levelType" - }, - "sellPrice": { - "type": "integer", - "description": "Price to sell to the market", - "additionalProperties": false - }, - "demand": { - "type": "integer", - "additionalProperties": false - }, - "demandLevel": { - "$ref": "#/definitions/levelType" - }, - "timestamp": { - "type": "string", - "format": "date-time", - "additionalProperties": false - } - }, - "required": [ - "systemName", - "stationName", - "itemName", - "stationStock", - "sellPrice", - "demand", - "timestamp" - ] - } - }, - "required": [ - "$schemaRef", - "header", - "message" - ], - "definitions" : { - "levelType" : { - "enum": ["Low", "Med", "High"] - } - } -} \ No newline at end of file From 443882592ea17aca0659dc4a6c7749a7373ff7e1 Mon Sep 17 00:00:00 2001 From: James Muscat Date: Wed, 1 Jul 2015 23:23:47 +0100 Subject: [PATCH 15/15] Back out wsgi entry point since it breaks things in complicated ways. --- src/eddn/Gateway.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/eddn/Gateway.py b/src/eddn/Gateway.py index 5d79d77..5534aeb 100644 --- a/src/eddn/Gateway.py +++ b/src/eddn/Gateway.py @@ -21,7 +21,7 @@ from eddn.core.Validator import Validator, ValidationSeverity from gevent import monkey monkey.patch_all() -from bottle import default_app, run, request, response, get, post +from bottle import run, request, response, get, post logger = logging.getLogger(__name__) @@ -211,12 +211,10 @@ class MalformedUploadError(Exception): def main(): + loadConfig() + configure() run(host='0.0.0.0', port=Settings.GATEWAY_HTTP_PORT, server='gevent') -loadConfig() -configure() if __name__ == '__main__': main() -else: - application = app = default_app()