Forráskód Böngészése

Merge branch 'master' of git.craftbroec.nl:VBOO/HVS

JoostSijm 5 éve
szülő
commit
105a7aed4d
4 módosított fájl, 7 hozzáadás és 7 törlés
  1. 1 1
      Pipfile
  2. 2 2
      Pipfile.lock
  3. 3 3
      app/__init__.py
  4. 1 1
      app/api.py

+ 1 - 1
Pipfile

@@ -17,4 +17,4 @@ matplotlib = "*"
 pandas = "*"
 
 [requires]
-python_version = "3.8"
+python_version = "3"

+ 2 - 2
Pipfile.lock

@@ -1,11 +1,11 @@
 {
     "_meta": {
         "hash": {
-            "sha256": "f1736fd02266147bd4504b42fa289bb3bb9c6141e05e0cd0367e7f133d1cd790"
+            "sha256": "030b742e5871456ee5bfd0eaa2a07807499b0e43dcca3f4682bf9dd60f17b886"
         },
         "pipfile-spec": 6,
         "requires": {
-            "python_version": "3.7"
+            "python_version": "3"
         },
         "sources": [
             {

+ 3 - 3
app/__init__.py

@@ -35,7 +35,7 @@ SCHEDULER_LOGGER = logging.getLogger('apscheduler')
 SCHEDULER_LOGGER.setLevel(logging.DEBUG)
 
 # create file handler
-FILE_HANDLER = logging.FileHandler('irlt.log')
+FILE_HANDLER = logging.FileHandler('output.log')
 FILE_HANDLER.setLevel(logging.DEBUG)
 
 # create console handler
@@ -61,7 +61,7 @@ HEADERS = {
 
 RESOURCE_IDS = {
     0: 'gold',
-    2: 'oil',
+    3: 'oil',
     4: 'ore',
     11: 'uranium',
     15: 'diamond',
@@ -69,7 +69,7 @@ RESOURCE_IDS = {
 
 RESOURCE_NAMES = {
     'gold': 0,
-    'oil': 2,
+    'oil': 3,
     'ore': 4,
     'uranium': 11,
     'diamond': 15,

+ 1 - 1
app/api.py

@@ -12,7 +12,7 @@ def download_resources(state_id, resource_id):
     """Download the resource list"""
     # return read_resources()
     response = requests.get(
-        '{}listed/stateresources/{}/{}'.format(BASE_URL, state_id, RESOURCES[resource_id]),
+        '{}listed/stateresources/{}/{}'.format(BASE_URL, state_id, RESOURCE_IDS[resource_id]),
         headers=HEADERS
     )
     return parse_resources(response.text)