From c58728821e3bacd60e83401baae042d1e9b9e52a Mon Sep 17 00:00:00 2001 From: A_D Date: Sun, 19 Jul 2020 07:50:44 +0200 Subject: [PATCH 01/53] Add flake8 and autopep8 to requirements.txt --- requirements.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/requirements.txt b/requirements.txt index 2327e183..4ef8f1ce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,15 @@ keyring==19.2.0 pathtools>=0.1.2 requests>=2.11.1 watchdog>=0.8.3 + +# Static analysis tools +flake8==3.8.3 +flake8-annotations-coverage==0.0.4 +flake8-cognitive-complexity==0.0.2 +flake8-comprehensions==3.2.3 +flake8-pep3101==1.3.0 +flake8-polyfill==1.0.2 +pep8-naming==0.11.1 + +# Code formatting tools +autopep8==1.5.3 From d0fbaa6091dd1fd54f4430bc95eb345bd5444198 Mon Sep 17 00:00:00 2001 From: A_D Date: Sun, 19 Jul 2020 07:52:06 +0200 Subject: [PATCH 02/53] Add config for autopep8 --- .pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .pyproject.toml diff --git a/.pyproject.toml b/.pyproject.toml new file mode 100644 index 00000000..7ff18c21 --- /dev/null +++ b/.pyproject.toml @@ -0,0 +1,2 @@ +[tool.autopep8] +max_line_length = 120 From 836efd0771a68a7560de22d050677181be7abbe8 Mon Sep 17 00:00:00 2001 From: A_D Date: Sun, 19 Jul 2020 16:53:21 +0200 Subject: [PATCH 03/53] Removed dev deps from requirements.txt --- requirements.txt | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/requirements.txt b/requirements.txt index 4ef8f1ce..5fa59d6a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,17 +1,7 @@ certifi==2019.9.11 keyring==19.2.0 -pathtools>=0.1.2 requests>=2.11.1 watchdog>=0.8.3 - -# Static analysis tools -flake8==3.8.3 -flake8-annotations-coverage==0.0.4 -flake8-cognitive-complexity==0.0.2 -flake8-comprehensions==3.2.3 -flake8-pep3101==1.3.0 -flake8-polyfill==1.0.2 -pep8-naming==0.11.1 - -# Code formatting tools -autopep8==1.5.3 +# argh==0.26.2 watchdog dep +# pyyaml==5.3.1 watchdog dep +semantic-version==2.8.5 From d9cea74cf70bdcdc5245f8bead0c0c91c67d2e77 Mon Sep 17 00:00:00 2001 From: A_D Date: Sun, 19 Jul 2020 16:53:58 +0200 Subject: [PATCH 04/53] Create requirements-dev.txt --- requirements-dev.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 requirements-dev.txt diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 00000000..0666adb3 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,20 @@ +# Static analysis tools +flake8==3.8.3 +flake8-annotations-coverage==0.0.4 +flake8-cognitive-complexity==0.0.2 +flake8-comprehensions==3.2.3 +flake8-pep3101==1.3.0 +flake8-polyfill==1.0.2 +pep8-naming==0.11.1 + +# Code formatting tools +autopep8==1.5.3 + +# HTML changelogs +grip==4.5.2 + +# Packaging +py2exe==0.9.3.2 + +# All of the normal requirements +-r requirements.txt From f3d20981790e907e9ddd25ebcce1dff514d9552d Mon Sep 17 00:00:00 2001 From: A_D Date: Sun, 19 Jul 2020 17:42:51 +0200 Subject: [PATCH 05/53] Updated docs Added linting, testing, and new requirements-dev.txt instructions --- Contributing.md | 64 +++++++++++++++++++++++++++++++++++++++++------ docs/Releasing.md | 6 ++--- 2 files changed, 60 insertions(+), 10 deletions(-) diff --git a/Contributing.md b/Contributing.md index 168c97de..4b7bdaae 100644 --- a/Contributing.md +++ b/Contributing.md @@ -104,7 +104,7 @@ The Semantic Versioning `+` should never be a part of the tag. --- -Work in progress conventions +### Work in progress conventions --- Remember, you should always be working versus a single issue, even if the work is part of a Milestone or Project. There might be cases where issues aren't duplicates, but your work still addresses more than one. In that case @@ -131,6 +131,24 @@ your WIP branch. If there are any non-trivial conflicts when we merge your Pull to rebase your WIP branch on the latest version of the source branch. Otherwise we'll work out how to best merge your changes via comments in the Pull Request. + +#### Linting + +We use flake8 for linting all python source. + +While working on your changes, please ensure that they pass a check from `flake8` using our configuration and plugins. +If you installed `requirements-dev.txt` with pip, you should simply be able to run `flake8 your_files_here` to lint +your files. + +Note that if your PR does not cleanly (or mostly cleanly) pass a linting scan, your PR may be put on hold pending fixes. + +#### Unit testing + +Where possible please write unit tests for your PRs, especially in the case of bug fixes, having regression tests help +ensure that we don't accidentally re-introduce a bug down the line. + +We use the python stdlib library `unittest` for unit testing. + --- General workflow @@ -141,6 +159,8 @@ General workflow 1. In your local copy of *your* fork create an appropriate WIP branch. 1. Develop the changes, testing as you go (no we don't have any actual tests yet). 1. Be as sure as you can that the code works as you intend and hasn't introduced any other bugs or regressions. + 1. Test the codebase as a whole against any unit tests that do exist, and add your own as you can. + 1. Check your code against flake8 periodically. 1. When you're sure the work is final: 1. Push your WIP branch to your fork (you probably should have been doing this as you worked as a form of backup). 1. Access the WIP branch on your fork on GitHub and create a Pull Request. Mention any Issue number(s) that it @@ -162,19 +182,49 @@ Coding Conventions on a separate line, with consistent indentation. Yes: - + + ```python if somethingTrue: - Things we then do + Things_we_then_do() + ``` No: - - if somethingTrue: One thing we do + + ```python + if somethingTrue: One_thing_we_do() + ``` Yes, some existing code still flouts this rule. - + +* **Always** use Line breaks after scope changes. It makes reading code far easier + + Yes: + + ```python + if True: + do_something() + + else: + raise UniverseBrokenException() + + return + ``` + No: + + ```python + if True: + do_something() + else: + raise UniverseBrokenException() + return + ``` + + * Going forwards please do place [type hints](https://docs.python.org/3/library/typing.html) on the declarations of your functions, both their arguments and return types. - + +* In general, please follow [PEP8](https://www.python.org/dev/peps/pep-0008/). + --- Git commit conventions diff --git a/docs/Releasing.md b/docs/Releasing.md index 2f52c67e..ff2ec482 100644 --- a/docs/Releasing.md +++ b/docs/Releasing.md @@ -54,9 +54,9 @@ You will need several pieces of software installed, or the files from their 1. You'll now need to 'pip install' several python modules. 1. Ensure you have `pip` installed. If needs be see [Installing pip](https://pip.pypa.io/en/stable/installing/) - 1. The easiest way is to utilise the `requirements.txt` file: - `pip install -r requirements.txt` - 1. Else check the contents of `requirements.txt` and ensure the modules + 1. The easiest way is to utilise the `requirements-dev.txt` file: + `python -m pip install -r requirements-dev.txt`. This will install all dependencies plus anything required for development + 1. Else check the contents of both `requirements.txt` and `requirements-dev.txt`, and ensure the modules listed there are installed as per the version requirements. If you are using different versions of any of these tools then please ensure From 836a27fb9614f95d84e3039cb3fb62cc4d53dbb2 Mon Sep 17 00:00:00 2001 From: A_D Date: Sun, 19 Jul 2020 17:47:52 +0200 Subject: [PATCH 06/53] Fixed code blocks --- Contributing.md | 51 +++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/Contributing.md b/Contributing.md index 4b7bdaae..ff683dff 100644 --- a/Contributing.md +++ b/Contributing.md @@ -181,43 +181,44 @@ Coding Conventions * **ALWAYS** place a single-statement control flow body, for control statements such as `if`, `else`, `for`, `foreach`, on a separate line, with consistent indentation. - Yes: +Yes: - ```python - if somethingTrue: - Things_we_then_do() - ``` +```python +if somethingTrue: + Things_we_then_do() +``` - No: +No: - ```python - if somethingTrue: One_thing_we_do() - ``` +```python +if somethingTrue: One_thing_we_do() +``` Yes, some existing code still flouts this rule. * **Always** use Line breaks after scope changes. It makes reading code far easier - Yes: +Yes: - ```python - if True: - do_something() +```python + if True: + do_something() - else: - raise UniverseBrokenException() + else: + raise UniverseBrokenException() - return - ``` - No: + return +``` - ```python - if True: - do_something() - else: - raise UniverseBrokenException() - return - ``` +No: + +```python + if True: + do_something() + else: + raise UniverseBrokenException() + return +``` * Going forwards please do place [type hints](https://docs.python.org/3/library/typing.html) on the declarations of your functions, both their arguments and return From a38a2420df68cff912b72e3669427b49a09a10fe Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 13 Jul 2020 05:42:55 +0200 Subject: [PATCH 07/53] Add newlines to separate scopes Newlines between scope changes help you to not get lost when reading source --- collate.py | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/collate.py b/collate.py index b3053c08..b56f0060 100755 --- a/collate.py +++ b/collate.py @@ -17,8 +17,8 @@ import outfitting # keep a summary of commodities found using in-game names # Assumes that the commodity data has already been 'fixed up' def addcommodities(data): - - if not data['lastStarport'].get('commodities'): return + if not data['lastStarport'].get('commodities'): + return commodityfile = 'commodity.csv' commodities = {} @@ -29,6 +29,7 @@ def addcommodities(data): reader = csv.DictReader(csvfile) for row in reader: commodities[int(row['id'])] = row # index by int for easier lookup and sorting + size_pre = len(commodities) for commodity in data['lastStarport'].get('commodities'): @@ -39,22 +40,26 @@ def addcommodities(data): 'category' : companion.category_map.get(commodity['categoryname']) or commodity['categoryname'], 'name' : commodity.get('locName') or 'Limpets', } + old = commodities.get(key) + if old and companion.category_map.get(commodity['categoryname'], True): if new['symbol'] != old['symbol'] or new['name'] != old['name']: raise AssertionError('%s: "%s"!="%s"' % (key, new, old)) + commodities[key] = new if len(commodities) > size_pre: - if isfile(commodityfile): if isfile(commodityfile+'.bak'): os.unlink(commodityfile+'.bak') + os.rename(commodityfile, commodityfile+'.bak') with open(commodityfile, 'w') as csvfile: writer = csv.DictWriter(csvfile, ['id', 'symbol', 'category', 'name']) writer.writeheader() + for key in sorted(commodities): writer.writerow(commodities[key]) @@ -62,7 +67,6 @@ def addcommodities(data): # keep a summary of modules found def addmodules(data): - if not data['lastStarport'].get('modules'): return outfile = 'outfitting.csv' @@ -75,17 +79,21 @@ def addmodules(data): reader = csv.DictReader(csvfile, restval='') for row in reader: modules[int(row['id'])] = row # index by int for easier lookup and sorting + size_pre = len(modules) for key,module in data['lastStarport'].get('modules').items(): # sanity check if int(key) != module.get('id'): raise AssertionError('id: %s!=%s' % (key, module['id'])) + try: new = outfitting.lookup(module, companion.ship_map, True) + except: print('%d, %s:' % (module['id'], module['name'])) print_exc(0) new = None + if new: old = modules.get(int(key)) if old: @@ -93,20 +101,23 @@ def addmodules(data): for thing in fields: if not old.get(thing) and new.get(thing): size_pre -= 1 + elif str(new.get(thing,'')) != old.get(thing): raise AssertionError('%s: %s "%s"!="%s"' % (key, thing, new.get(thing), old.get(thing))) + modules[int(key)] = new if len(modules) > size_pre: - if isfile(outfile): if isfile(outfile+'.bak'): os.unlink(outfile+'.bak') + os.rename(outfile, outfile+'.bak') with open(outfile, 'w') as csvfile: writer = csv.DictWriter(csvfile, fields, extrasaction='ignore') writer.writeheader() + for key in sorted(modules): writer.writerow(modules[key]) @@ -114,7 +125,6 @@ def addmodules(data): # keep a summary of ships found def addships(data): - if not data['lastStarport'].get('ships'): return shipfile = 'shipyard.csv' @@ -127,6 +137,7 @@ def addships(data): reader = csv.DictReader(csvfile, restval='') for row in reader: ships[int(row['id'])] = row # index by int for easier lookup and sorting + size_pre = len(ships) for ship in list((data['lastStarport']['ships'].get('shipyard_list') or {}).values()) + data['lastStarport']['ships'].get('unavailable_list'): @@ -141,8 +152,10 @@ def addships(data): if not old.get(thing) and new.get(thing): ships[int(key)] = new size_pre -= 1 + elif str(new.get(thing,'')) != old.get(thing): raise AssertionError('%s: %s "%s"!="%s"' % (key, thing, new.get(thing), old.get(thing))) + ships[int(key)] = new if len(ships) > size_pre: @@ -150,11 +163,13 @@ def addships(data): if isfile(shipfile): if isfile(shipfile+'.bak'): os.unlink(shipfile+'.bak') + os.rename(shipfile, shipfile+'.bak') with open(shipfile, 'w') as csvfile: writer = csv.DictWriter(csvfile, ['id', 'symbol', 'name']) writer.writeheader() + for key in sorted(ships): writer.writerow(ships[key]) @@ -173,18 +188,25 @@ if __name__ == "__main__": data = json.load(h) if not data['commander'].get('docked'): print('Not docked!') + elif not data.get('lastStarport'): print('No starport!') + else: if data['lastStarport'].get('commodities'): addcommodities(data) + else: print('No market') + if data['lastStarport'].get('modules'): addmodules(data) + else: print('No outfitting') + if data['lastStarport'].get('ships'): addships(data) + else: print('No shipyard') From 8cd6bf4b9392d48c7200ee4402bb366c70a3adf1 Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 13 Jul 2020 05:45:13 +0200 Subject: [PATCH 08/53] removed unused import --- collate.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/collate.py b/collate.py index b56f0060..f45cd37b 100755 --- a/collate.py +++ b/collate.py @@ -6,7 +6,7 @@ import csv import json import os -from os.path import exists, isfile +from os.path import isfile import sys from traceback import print_exc @@ -28,7 +28,7 @@ def addcommodities(data): with open(commodityfile) as csvfile: reader = csv.DictReader(csvfile) for row in reader: - commodities[int(row['id'])] = row # index by int for easier lookup and sorting + commodities[int(row['id'])] = row # index by int for easier lookup and sorting size_pre = len(commodities) @@ -65,6 +65,7 @@ def addcommodities(data): print('Added %d new commodities' % (len(commodities) - size_pre)) + # keep a summary of modules found def addmodules(data): if not data['lastStarport'].get('modules'): return @@ -78,7 +79,7 @@ def addmodules(data): with open(outfile) as csvfile: reader = csv.DictReader(csvfile, restval='') for row in reader: - modules[int(row['id'])] = row # index by int for easier lookup and sorting + modules[int(row['id'])] = row # index by int for easier lookup and sorting size_pre = len(modules) @@ -123,6 +124,7 @@ def addmodules(data): print('Added %d new modules' % (len(modules) - size_pre)) + # keep a summary of ships found def addships(data): if not data['lastStarport'].get('ships'): return @@ -136,7 +138,7 @@ def addships(data): with open(shipfile) as csvfile: reader = csv.DictReader(csvfile, restval='') for row in reader: - ships[int(row['id'])] = row # index by int for easier lookup and sorting + ships[int(row['id'])] = row # index by int for easier lookup and sorting size_pre = len(ships) From 3df8a1f77b0ca7bf8763c1c61a210d0f8ed0020a Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 13 Jul 2020 05:49:58 +0200 Subject: [PATCH 09/53] added missing whitespace where needed --- collate.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/collate.py b/collate.py index f45cd37b..70f6b420 100755 --- a/collate.py +++ b/collate.py @@ -51,10 +51,10 @@ def addcommodities(data): if len(commodities) > size_pre: if isfile(commodityfile): - if isfile(commodityfile+'.bak'): - os.unlink(commodityfile+'.bak') + if isfile(commodityfile + '.bak'): + os.unlink(commodityfile + '.bak') - os.rename(commodityfile, commodityfile+'.bak') + os.rename(commodityfile, commodityfile + '.bak') with open(commodityfile, 'w') as csvfile: writer = csv.DictWriter(csvfile, ['id', 'symbol', 'category', 'name']) @@ -83,7 +83,7 @@ def addmodules(data): size_pre = len(modules) - for key,module in data['lastStarport'].get('modules').items(): + for key, module in data['lastStarport'].get('modules').items(): # sanity check if int(key) != module.get('id'): raise AssertionError('id: %s!=%s' % (key, module['id'])) @@ -103,17 +103,17 @@ def addmodules(data): if not old.get(thing) and new.get(thing): size_pre -= 1 - elif str(new.get(thing,'')) != old.get(thing): + elif str(new.get(thing, '')) != old.get(thing): raise AssertionError('%s: %s "%s"!="%s"' % (key, thing, new.get(thing), old.get(thing))) modules[int(key)] = new if len(modules) > size_pre: if isfile(outfile): - if isfile(outfile+'.bak'): - os.unlink(outfile+'.bak') + if isfile(outfile + '.bak'): + os.unlink(outfile + '.bak') - os.rename(outfile, outfile+'.bak') + os.rename(outfile, outfile + '.bak') with open(outfile, 'w') as csvfile: writer = csv.DictWriter(csvfile, fields, extrasaction='ignore') @@ -145,7 +145,7 @@ def addships(data): for ship in list((data['lastStarport']['ships'].get('shipyard_list') or {}).values()) + data['lastStarport']['ships'].get('unavailable_list'): # sanity check key = ship['id'] - new = { 'id': int(key), 'symbol': ship['name'], 'name': companion.ship_map.get(ship['name'].lower()) } + new = {'id': int(key), 'symbol': ship['name'], 'name': companion.ship_map.get(ship['name'].lower())} if new: old = ships.get(int(key)) if old: @@ -155,7 +155,7 @@ def addships(data): ships[int(key)] = new size_pre -= 1 - elif str(new.get(thing,'')) != old.get(thing): + elif str(new.get(thing, '')) != old.get(thing): raise AssertionError('%s: %s "%s"!="%s"' % (key, thing, new.get(thing), old.get(thing))) ships[int(key)] = new @@ -163,10 +163,10 @@ def addships(data): if len(ships) > size_pre: if isfile(shipfile): - if isfile(shipfile+'.bak'): - os.unlink(shipfile+'.bak') + if isfile(shipfile + '.bak'): + os.unlink(shipfile + '.bak') - os.rename(shipfile, shipfile+'.bak') + os.rename(shipfile, shipfile + '.bak') with open(shipfile, 'w') as csvfile: writer = csv.DictWriter(csvfile, ['id', 'symbol', 'name']) From 43ba47ddf9c0c4f9c303e73ab8e705f0006f218c Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 13 Jul 2020 05:59:03 +0200 Subject: [PATCH 10/53] shortened line --- collate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/collate.py b/collate.py index 70f6b420..0733238d 100755 --- a/collate.py +++ b/collate.py @@ -142,7 +142,8 @@ def addships(data): size_pre = len(ships) - for ship in list((data['lastStarport']['ships'].get('shipyard_list') or {}).values()) + data['lastStarport']['ships'].get('unavailable_list'): + data_ships = data['lastStarport']['ships'] + for ship in tuple(data_ships.get('shipyard_list', {}).values()) + data_ships.get('unavailable_list'): # sanity check key = ship['id'] new = {'id': int(key), 'symbol': ship['name'], 'name': companion.ship_map.get(ship['name'].lower())} From ec6a09a06ddb2681e55acfe344d5a906dd2940e0 Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 13 Jul 2020 05:59:29 +0200 Subject: [PATCH 11/53] removed oneline statements --- collate.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/collate.py b/collate.py index 0733238d..ccfa9271 100755 --- a/collate.py +++ b/collate.py @@ -68,7 +68,8 @@ def addcommodities(data): # keep a summary of modules found def addmodules(data): - if not data['lastStarport'].get('modules'): return + if not data['lastStarport'].get('modules'): + return outfile = 'outfitting.csv' modules = {} @@ -85,7 +86,8 @@ def addmodules(data): for key, module in data['lastStarport'].get('modules').items(): # sanity check - if int(key) != module.get('id'): raise AssertionError('id: %s!=%s' % (key, module['id'])) + if int(key) != module.get('id'): + raise AssertionError('id: %s!=%s' % (key, module['id'])) try: new = outfitting.lookup(module, companion.ship_map, True) @@ -127,7 +129,8 @@ def addmodules(data): # keep a summary of ships found def addships(data): - if not data['lastStarport'].get('ships'): return + if not data['lastStarport'].get('ships'): + return shipfile = 'shipyard.csv' ships = {} From a40b08530398e478e50f323ecb525387c55c0958 Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 13 Jul 2020 06:03:37 +0200 Subject: [PATCH 12/53] replace modulo formatting with .format --- collate.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/collate.py b/collate.py index ccfa9271..a1d2367d 100755 --- a/collate.py +++ b/collate.py @@ -45,7 +45,7 @@ def addcommodities(data): if old and companion.category_map.get(commodity['categoryname'], True): if new['symbol'] != old['symbol'] or new['name'] != old['name']: - raise AssertionError('%s: "%s"!="%s"' % (key, new, old)) + raise AssertionError('{}: {!r} != {!r}'.format(key, new, old)) commodities[key] = new @@ -63,7 +63,7 @@ def addcommodities(data): for key in sorted(commodities): writer.writerow(commodities[key]) - print('Added %d new commodities' % (len(commodities) - size_pre)) + print('Added {} new commodities'.format(len(commodities) - size_pre)) # keep a summary of modules found @@ -87,13 +87,13 @@ def addmodules(data): for key, module in data['lastStarport'].get('modules').items(): # sanity check if int(key) != module.get('id'): - raise AssertionError('id: %s!=%s' % (key, module['id'])) + raise AssertionError('id: {} != {}'.format(key, module['id'])) try: new = outfitting.lookup(module, companion.ship_map, True) - except: - print('%d, %s:' % (module['id'], module['name'])) + except Exception: + print('{}, {}:'.format(module['id'], module['name'])) print_exc(0) new = None @@ -106,7 +106,7 @@ def addmodules(data): size_pre -= 1 elif str(new.get(thing, '')) != old.get(thing): - raise AssertionError('%s: %s "%s"!="%s"' % (key, thing, new.get(thing), old.get(thing))) + raise AssertionError('{}: {} {!r}!={!r}'.format(key, thing, new.get(thing), old.get(thing))) modules[int(key)] = new @@ -124,7 +124,7 @@ def addmodules(data): for key in sorted(modules): writer.writerow(modules[key]) - print('Added %d new modules' % (len(modules) - size_pre)) + print('Added {} new modules'.format(len(modules) - size_pre)) # keep a summary of ships found @@ -160,7 +160,7 @@ def addships(data): size_pre -= 1 elif str(new.get(thing, '')) != old.get(thing): - raise AssertionError('%s: %s "%s"!="%s"' % (key, thing, new.get(thing), old.get(thing))) + raise AssertionError('{}: {} {!r} != {!r}'.format(key, thing, new.get(thing), old.get(thing))) ships[int(key)] = new @@ -179,7 +179,7 @@ def addships(data): for key in sorted(ships): writer.writerow(ships[key]) - print('Added %d new ships' % (len(ships) - size_pre)) + print('Added {} new ships'.format(len(ships) - size_pre)) if __name__ == "__main__": From 6b73161cae61227695ddc4f1881b95025cd3d8b2 Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 13 Jul 2020 06:04:45 +0200 Subject: [PATCH 13/53] Replace AssertionErrors with ValueError AssertionError comes from `assert`s, using it for this doesn't make sense as we're complaining about values --- collate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/collate.py b/collate.py index a1d2367d..4a06d35c 100755 --- a/collate.py +++ b/collate.py @@ -45,7 +45,7 @@ def addcommodities(data): if old and companion.category_map.get(commodity['categoryname'], True): if new['symbol'] != old['symbol'] or new['name'] != old['name']: - raise AssertionError('{}: {!r} != {!r}'.format(key, new, old)) + raise ValueError('{}: {!r} != {!r}'.format(key, new, old)) commodities[key] = new @@ -87,7 +87,7 @@ def addmodules(data): for key, module in data['lastStarport'].get('modules').items(): # sanity check if int(key) != module.get('id'): - raise AssertionError('id: {} != {}'.format(key, module['id'])) + raise ValueError('id: {} != {}'.format(key, module['id'])) try: new = outfitting.lookup(module, companion.ship_map, True) @@ -106,7 +106,7 @@ def addmodules(data): size_pre -= 1 elif str(new.get(thing, '')) != old.get(thing): - raise AssertionError('{}: {} {!r}!={!r}'.format(key, thing, new.get(thing), old.get(thing))) + raise ValueError('{}: {} {!r}!={!r}'.format(key, thing, new.get(thing), old.get(thing))) modules[int(key)] = new @@ -160,7 +160,7 @@ def addships(data): size_pre -= 1 elif str(new.get(thing, '')) != old.get(thing): - raise AssertionError('{}: {} {!r} != {!r}'.format(key, thing, new.get(thing), old.get(thing))) + raise ValueError('{}: {} {!r} != {!r}'.format(key, thing, new.get(thing), old.get(thing))) ships[int(key)] = new From 558348658986ef1475a7a9cb80bbc77f33d11a58 Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 13 Jul 2020 06:08:04 +0200 Subject: [PATCH 14/53] replace list literals with tuples Tuples ensure that this isnt changed at runtime --- collate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collate.py b/collate.py index 4a06d35c..9431711c 100755 --- a/collate.py +++ b/collate.py @@ -73,7 +73,7 @@ def addmodules(data): outfile = 'outfitting.csv' modules = {} - fields = ['id', 'symbol', 'category', 'name', 'mount', 'guidance', 'ship', 'class', 'rating', 'entitlement'] + fields = ('id', 'symbol', 'category', 'name', 'mount', 'guidance', 'ship', 'class', 'rating', 'entitlement') # slurp existing if isfile(outfile): @@ -134,7 +134,7 @@ def addships(data): shipfile = 'shipyard.csv' ships = {} - fields = ['id', 'symbol', 'name'] + fields = ('id', 'symbol', 'name') # slurp existing if isfile(shipfile): From c233fa5ff51e50a748ebe0f35f8c3b59d02d2e61 Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 13 Jul 2020 06:11:48 +0200 Subject: [PATCH 15/53] Refactor __main__ logic Most of this is just de-pyramiding the code, removing else clauses that are unneeded (or making the if such that the else is not needed). Rationale is simple, every level of indentation adds more that the reader needs to keep track of. --- collate.py | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/collate.py b/collate.py index 9431711c..669ce162 100755 --- a/collate.py +++ b/collate.py @@ -185,34 +185,38 @@ def addships(data): if __name__ == "__main__": if len(sys.argv) <= 1: print('Usage: collate.py [dump.json]') - else: - # read from dumped json file(s) - session = companion.Session() - for f in sys.argv[1:]: - with open(f) as h: - print(f) - data = json.load(h) - if not data['commander'].get('docked'): - print('Not docked!') + sys.exit() - elif not data.get('lastStarport'): - print('No starport!') + # read from dumped json file(s) + session = companion.Session() + for file_name in sys.argv[1:]: + data = None + with open(file_name) as f: + print(file_name) + data = json.load(f) - else: - if data['lastStarport'].get('commodities'): - addcommodities(data) + if not data['commander'].get('docked'): + print('Not docked!') + continue - else: - print('No market') + elif not data.get('lastStarport'): + print('No starport!') + continue - if data['lastStarport'].get('modules'): - addmodules(data) + if data['lastStarport'].get('commodities'): + addcommodities(data) - else: - print('No outfitting') + else: + print('No market') - if data['lastStarport'].get('ships'): - addships(data) + if data['lastStarport'].get('modules'): + addmodules(data) - else: - print('No shipyard') + else: + print('No outfitting') + + if data['lastStarport'].get('ships'): + addships(data) + + else: + print('No shipyard') From 8856cec36faecd60191404bdfdad366c0e5caf0d Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 13 Jul 2020 06:25:13 +0200 Subject: [PATCH 16/53] Move file backup code to a method It was repeated in various places and increased noise --- collate.py | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/collate.py b/collate.py index 669ce162..e28f5882 100755 --- a/collate.py +++ b/collate.py @@ -14,6 +14,22 @@ import companion import outfitting +def __make_backup(file_name: str, suffix: str = '.bak') -> None: + """ + Rename the given file to $file.bak, removing any existing $file.bak + + :param file_name: The name of the file to make a backup of + :param suffix: The suffix to use for backup files (default '.bak') + """ + + backup_name = file_name + suffix + + if isfile(backup_name): + os.unlink(backup_name) + + os.rename(file_name, backup_name) + + # keep a summary of commodities found using in-game names # Assumes that the commodity data has already been 'fixed up' def addcommodities(data): @@ -51,10 +67,7 @@ def addcommodities(data): if len(commodities) > size_pre: if isfile(commodityfile): - if isfile(commodityfile + '.bak'): - os.unlink(commodityfile + '.bak') - - os.rename(commodityfile, commodityfile + '.bak') + __make_backup(commodityfile) with open(commodityfile, 'w') as csvfile: writer = csv.DictWriter(csvfile, ['id', 'symbol', 'category', 'name']) @@ -112,10 +125,7 @@ def addmodules(data): if len(modules) > size_pre: if isfile(outfile): - if isfile(outfile + '.bak'): - os.unlink(outfile + '.bak') - - os.rename(outfile, outfile + '.bak') + __make_backup(outfile) with open(outfile, 'w') as csvfile: writer = csv.DictWriter(csvfile, fields, extrasaction='ignore') @@ -167,10 +177,7 @@ def addships(data): if len(ships) > size_pre: if isfile(shipfile): - if isfile(shipfile + '.bak'): - os.unlink(shipfile + '.bak') - - os.rename(shipfile, shipfile + '.bak') + __make_backup(shipfile) with open(shipfile, 'w') as csvfile: writer = csv.DictWriter(csvfile, ['id', 'symbol', 'name']) From 05de5b557e5c6dd96946a576ad8e15713ece9cfc Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 13 Jul 2020 06:30:04 +0200 Subject: [PATCH 17/53] Removed repeated int(key) With the previous formatting changes there is no reason to leave key as possibly a string anywhere, as it was already being converted to an int everywhere anyway --- collate.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/collate.py b/collate.py index e28f5882..18571084 100755 --- a/collate.py +++ b/collate.py @@ -99,7 +99,8 @@ def addmodules(data): for key, module in data['lastStarport'].get('modules').items(): # sanity check - if int(key) != module.get('id'): + key = int(key) + if key != module.get('id'): raise ValueError('id: {} != {}'.format(key, module['id'])) try: @@ -111,7 +112,7 @@ def addmodules(data): new = None if new: - old = modules.get(int(key)) + old = modules.get(key) if old: # check consistency with existing data for thing in fields: @@ -121,7 +122,7 @@ def addmodules(data): elif str(new.get(thing, '')) != old.get(thing): raise ValueError('{}: {} {!r}!={!r}'.format(key, thing, new.get(thing), old.get(thing))) - modules[int(key)] = new + modules[key] = new if len(modules) > size_pre: if isfile(outfile): @@ -158,21 +159,21 @@ def addships(data): data_ships = data['lastStarport']['ships'] for ship in tuple(data_ships.get('shipyard_list', {}).values()) + data_ships.get('unavailable_list'): # sanity check - key = ship['id'] - new = {'id': int(key), 'symbol': ship['name'], 'name': companion.ship_map.get(ship['name'].lower())} + key = int(ship['id']) + new = {'id': key, 'symbol': ship['name'], 'name': companion.ship_map.get(ship['name'].lower())} if new: - old = ships.get(int(key)) + old = ships.get(key) if old: # check consistency with existing data for thing in fields: if not old.get(thing) and new.get(thing): - ships[int(key)] = new + ships[key] = new size_pre -= 1 elif str(new.get(thing, '')) != old.get(thing): raise ValueError('{}: {} {!r} != {!r}'.format(key, thing, new.get(thing), old.get(thing))) - ships[int(key)] = new + ships[key] = new if len(ships) > size_pre: From 0b2b76a9f563e9ed5478b6bd67f155bb0b9bc7b7 Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 13 Jul 2020 06:32:55 +0200 Subject: [PATCH 18/53] Replaced write out checks with guard clauses Guard clauses reduce indentation and help when reading code as they remove a variable and indentation level that the reader would otherwise need to keep track of --- collate.py | 59 +++++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/collate.py b/collate.py index 18571084..26a24197 100755 --- a/collate.py +++ b/collate.py @@ -65,18 +65,20 @@ def addcommodities(data): commodities[key] = new - if len(commodities) > size_pre: - if isfile(commodityfile): - __make_backup(commodityfile) + if not len(commodities) > size_pre: + return - with open(commodityfile, 'w') as csvfile: - writer = csv.DictWriter(csvfile, ['id', 'symbol', 'category', 'name']) - writer.writeheader() + if isfile(commodityfile): + __make_backup(commodityfile) - for key in sorted(commodities): - writer.writerow(commodities[key]) + with open(commodityfile, 'w') as csvfile: + writer = csv.DictWriter(csvfile, ['id', 'symbol', 'category', 'name']) + writer.writeheader() - print('Added {} new commodities'.format(len(commodities) - size_pre)) + for key in sorted(commodities): + writer.writerow(commodities[key]) + + print('Added {} new commodities'.format(len(commodities) - size_pre)) # keep a summary of modules found @@ -124,18 +126,20 @@ def addmodules(data): modules[key] = new - if len(modules) > size_pre: - if isfile(outfile): - __make_backup(outfile) + if not len(modules) > size_pre: + return - with open(outfile, 'w') as csvfile: - writer = csv.DictWriter(csvfile, fields, extrasaction='ignore') - writer.writeheader() + if isfile(outfile): + __make_backup(outfile) - for key in sorted(modules): - writer.writerow(modules[key]) + with open(outfile, 'w') as csvfile: + writer = csv.DictWriter(csvfile, fields, extrasaction='ignore') + writer.writeheader() - print('Added {} new modules'.format(len(modules) - size_pre)) + for key in sorted(modules): + writer.writerow(modules[key]) + + print('Added {} new modules'.format(len(modules) - size_pre)) # keep a summary of ships found @@ -175,19 +179,20 @@ def addships(data): ships[key] = new - if len(ships) > size_pre: + if not len(ships) > size_pre: + return - if isfile(shipfile): - __make_backup(shipfile) + if isfile(shipfile): + __make_backup(shipfile) - with open(shipfile, 'w') as csvfile: - writer = csv.DictWriter(csvfile, ['id', 'symbol', 'name']) - writer.writeheader() + with open(shipfile, 'w') as csvfile: + writer = csv.DictWriter(csvfile, ['id', 'symbol', 'name']) + writer.writeheader() - for key in sorted(ships): - writer.writerow(ships[key]) + for key in sorted(ships): + writer.writerow(ships[key]) - print('Added {} new ships'.format(len(ships) - size_pre)) + print('Added {} new ships'.format(len(ships) - size_pre)) if __name__ == "__main__": From 783b3c5ce90c6dfbeb677fda3381bd71bb582636 Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 13 Jul 2020 06:43:41 +0200 Subject: [PATCH 19/53] clarified docs --- collate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collate.py b/collate.py index 26a24197..a5fa219f 100755 --- a/collate.py +++ b/collate.py @@ -16,7 +16,7 @@ import outfitting def __make_backup(file_name: str, suffix: str = '.bak') -> None: """ - Rename the given file to $file.bak, removing any existing $file.bak + Rename the given file to $file.bak, removing any existing $file.bak. Assumes $file exists on disk. :param file_name: The name of the file to make a backup of :param suffix: The suffix to use for backup files (default '.bak') From d41dc38162b0a308cc9e0945e63e50ab071ef5d0 Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 20 Jul 2020 15:39:19 +0200 Subject: [PATCH 20/53] Create Enhancement issue template closes #599 --- .github/ISSUE_TEMPLATE/enhancement.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/enhancement.md diff --git a/.github/ISSUE_TEMPLATE/enhancement.md b/.github/ISSUE_TEMPLATE/enhancement.md new file mode 100644 index 00000000..80d5a0f3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/enhancement.md @@ -0,0 +1,24 @@ +--- +name: Enhancement / Feature request +about: Request a new feature or other enhancement +title: '' +labels: enhancement +assignees: '' + +--- + +**Describe the enhancement** + +A clear and concise description of what you would like changed or added + +**Expected behavior** + +A clear and concise description of what you expect to happen. + +**Considered workarounds** + +Workarounds you may have considered can help us with how to implement your idea. + +**Additional context** + +Add any other context about your request here From 0e1c7dbf95177c6f65b742c9d742ebfe6a744a3c Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 23 Jul 2020 15:35:54 +0100 Subject: [PATCH 21/53] Translations: Add 'Use alternate URL method' to phrases --- L10n/en.template | 3 +++ 1 file changed, 3 insertions(+) diff --git a/L10n/en.template b/L10n/en.template index fdfef11d..132df0d5 100644 --- a/L10n/en.template +++ b/L10n/en.template @@ -490,6 +490,9 @@ /* Update button in main window. [EDMarketConnector.py] */ "Update" = "Update"; +/* Option to use alternate URL method on shipyard links [prefs.py] */ +"Use alternate URL method" = "Use alternate URL method"; + /* Status dialog subtitle - CR value of ship. [stats.py] */ "Value" = "Value"; From f027d1fa9253658bf223b8d3e74fa029ee7de313 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 24 Jul 2020 10:03:56 +0100 Subject: [PATCH 22/53] Releasing.md: Update 'Known Issues' after a stable release. --- docs/Releasing.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/Releasing.md b/docs/Releasing.md index ff2ec482..4c251af8 100644 --- a/docs/Releasing.md +++ b/docs/Releasing.md @@ -306,6 +306,8 @@ updates specifically targets NB: It can take some time for GitHub to show the changed edmarketconnector.xml contents to all users. +**You should now update [Known Issues](https://github.com/EDCD/EDMarketConnector/issues/618) +to reflect anything now fixed in latest release.** Pre-Releases --- From 982e77c38a9fb9559ac7aaf25813335fdbca667f Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 24 Jul 2020 14:20:29 +0100 Subject: [PATCH 23/53] Use SemVer for sparkle:version Else it thinks 4.0.3.0 > 4.0.3 and keeps offering the upgrade. --- edmarketconnector.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edmarketconnector.xml b/edmarketconnector.xml index 81d0b356..d257a537 100644 --- a/edmarketconnector.xml +++ b/edmarketconnector.xml @@ -581,7 +581,7 @@ If any of your plugins are listed in that section then they will need updating, url="https://github.com/EDCD/EDMarketConnector/releases/download/Release/4.0.3/EDMarketConnector_win_4.0.3.msi" sparkle:os="windows" sparkle:installerArguments="/passive LAUNCH=yes" - sparkle:version="4.0.3.0" + sparkle:version="4.0.3" length="11325440" type="application/octet-stream" /> From 04122b2de614a28772b0905095baa3ede1b6f22e Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 24 Jul 2020 14:28:34 +0100 Subject: [PATCH 24/53] Releasing.md: Emphasises that sparkle:version is SemVer string. --- docs/Releasing.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/Releasing.md b/docs/Releasing.md index 4c251af8..fcc66daa 100644 --- a/docs/Releasing.md +++ b/docs/Releasing.md @@ -180,7 +180,8 @@ a `stable` release, as well as any social media posts you make. 1. You'll need to change the `` and `<description>` texts to reflect the latest version and the additional changelog. 1. Update the `url` and `sparkle:version` elements of the `<enclosure>` - section. + section. **NB: Yes, sparkle:version should be the Semantic Version + string, not the Windows A.B.C.D form.** 1. As you're working in a version-specific branch, `release-4.0.2`, you can safely commit these changes and push to GitHub. **Do not merge the branch with `releases` until the GitHub release is in From 525baf8b03bc98b4b5264ea57ef292a20ea85162 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 18:27:24 +0100 Subject: [PATCH 25/53] Create python-app.yml Add a GitHub Action to check requirements-dev.txt, flake8, and pytest. --- .github/workflows/python-app.yml | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 00000000..b6c17dec --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,36 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: EDMarketConnector + +on: + push: + branches: [ develop ] + pull_request: + branches: [ develop ] + +jobs: + build: + + runs-on: debian-stable + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest From f7968bd0c87c0f7d9311dccaa7eb640a31c29c3b Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 18:49:10 +0100 Subject: [PATCH 26/53] Update python-app.yml Change name to be more obvious when viewing in Actions. --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index b6c17dec..be43b5f5 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: EDMarketConnector +name: Check-Dependencies-Flake8-PyTest on: push: From 04fa3fae2cb9369144a7149aecb8ca3615bc6ef4 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 18:57:52 +0100 Subject: [PATCH 27/53] Update python-app.yml Change to ubuntu-18.04 --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index be43b5f5..794039be 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -12,7 +12,7 @@ on: jobs: build: - runs-on: debian-stable + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 From 607770f7d4ec8918474024b40ee14c9fcd58fd89 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 20:23:02 +0100 Subject: [PATCH 28/53] Add greet-example to github workflows --- .github/workflows/greet-everyone.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/greet-everyone.yml diff --git a/.github/workflows/greet-everyone.yml b/.github/workflows/greet-everyone.yml new file mode 100644 index 00000000..8eb21f91 --- /dev/null +++ b/.github/workflows/greet-everyone.yml @@ -0,0 +1,21 @@ +name: Greet Everyone +# This workflow is triggered on pushes to the repository. +on: [push] + +jobs: + build: + # Job name is Greeting + name: Greeting + # This job runs on Linux + runs-on: ubuntu-latest + steps: + # This step uses GitHub's hello-world-javascript-action: https://github.com/actions/hello-world-javascript-action + - name: Hello world + uses: actions/hello-world-javascript-action@v1 + with: + who-to-greet: 'Mona the Octocat' + id: hello + # This step prints an output (time) from the previous step's action. + - name: Echo the greeting's time + run: echo 'The time was ${{ steps.hello.outputs.time }}.' + From a76aae97371fe4432e14ed1d9f1e7bd55ce4f3c9 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 20:32:27 +0100 Subject: [PATCH 29/53] Remove pytest and comment out flake8 for now. Narrowing down what's working and what isn't in this. --- .github/workflows/python-app.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 794039be..f395cb89 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -25,12 +25,9 @@ jobs: python -m pip install --upgrade pip pip install flake8 pytest if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest +# - name: Lint with flake8 +# run: | +# # stop the build if there are Python syntax errors or undefined names +# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics +# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide +# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics From fd78df246ae02ac64d55f722e8084cf148e5465f Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 20:36:35 +0100 Subject: [PATCH 30/53] Comments out py2exe in requirements-dev.txt as it trips up GitHub Actions docs/Releasing.md has fuller instructions on getting that specific pyexe version installed anyway. --- docs/Releasing.md | 9 ++++++--- requirements-dev.txt | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/Releasing.md b/docs/Releasing.md index fcc66daa..0e704d08 100644 --- a/docs/Releasing.md +++ b/docs/Releasing.md @@ -55,9 +55,12 @@ You will need several pieces of software installed, or the files from their 1. Ensure you have `pip` installed. If needs be see [Installing pip](https://pip.pypa.io/en/stable/installing/) 1. The easiest way is to utilise the `requirements-dev.txt` file: - `python -m pip install -r requirements-dev.txt`. This will install all dependencies plus anything required for development - 1. Else check the contents of both `requirements.txt` and `requirements-dev.txt`, and ensure the modules - listed there are installed as per the version requirements. + `python -m pip install -r requirements-dev.txt`. This will install all + dependencies plus anything required for development *other than py2exe, see + above*. + 1. Else check the contents of both `requirements.txt` and `requirements-dev.txt`, + and ensure the modules listed there are installed as per the version + requirements. If you are using different versions of any of these tools then please ensure that the paths where they're installed match the associated lines in diff --git a/requirements-dev.txt b/requirements-dev.txt index 0666adb3..ab0c4685 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -14,7 +14,9 @@ autopep8==1.5.3 grip==4.5.2 # Packaging -py2exe==0.9.3.2 +# This isn't available via 'pip install', so has to be commented out in order for +# GitHub Action Workflows to not error out +#py2exe==0.9.3.2 # All of the normal requirements -r requirements.txt From 838e55710d786be66ea3e65cdf2eb41424b5d65c Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 20:38:57 +0100 Subject: [PATCH 31/53] Uncomment flake8 part of build in workflow --- .github/workflows/python-app.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index f395cb89..ae0746d3 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -25,9 +25,9 @@ jobs: python -m pip install --upgrade pip pip install flake8 pytest if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi -# - name: Lint with flake8 -# run: | -# # stop the build if there are Python syntax errors or undefined names -# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics -# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide -# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics From f41eb4fb92e3895d0607a6e159eb2e735ab742ef Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 20:45:08 +0100 Subject: [PATCH 32/53] Try A_D's "diff only" flake8 checking --- .github/workflows/python-app.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index ae0746d3..dd8d38e9 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -26,8 +26,25 @@ jobs: pip install flake8 pytest if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi - name: Lint with flake8 + env: + ROOT_SHA: ${{github.base_ref}} + run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + DATA=$(python3 <<EOF + import json + import os + with open(os.getenv('GITHUB_EVENT_PATH')) as f: + data = json.load(f) + + typ = os.getenv('GITHUB_EVENT_NAME') + + if 'pull_request' in typ: + print(data['base']['ref']) + elif 'push' in typ: + print(data['before']) + EOF + ) + # stop the build if there are Python syntax errors or undefined names, ignore existing + git diff "$DATA" | flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --diff # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + git diff "$DATA" | flake8 . --count --exit-zero --statistics --diff From 4a3c74ce5b61405ff35b604a478230fc1b3d3f66 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 20:59:10 +0100 Subject: [PATCH 33/53] Use fetch-depth 0 for 'all' on checkout@v2 --- .github/workflows/python-app.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index dd8d38e9..5ead381d 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -16,6 +16,7 @@ jobs: steps: - uses: actions/checkout@v2 + fetch-depth: 0 - name: Set up Python 3.7 uses: actions/setup-python@v2 with: From e461fa62f6946708d4a4819e268c3e486a5a9bc3 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 21:00:28 +0100 Subject: [PATCH 34/53] The configuration must be inside a 'with:' --- .github/workflows/python-app.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 5ead381d..a61a5c09 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -16,7 +16,8 @@ jobs: steps: - uses: actions/checkout@v2 - fetch-depth: 0 + with: + fetch-depth: 0 - name: Set up Python 3.7 uses: actions/setup-python@v2 with: From 333ba24db4cfb5003a1ef497ac041bc433763b85 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 21:19:36 +0100 Subject: [PATCH 35/53] Rename to 'what it runs on' prefix --- .github/workflows/{python-app.yml => pr-or-push-checks.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{python-app.yml => pr-or-push-checks.yml} (100%) diff --git a/.github/workflows/python-app.yml b/.github/workflows/pr-or-push-checks.yml similarity index 100% rename from .github/workflows/python-app.yml rename to .github/workflows/pr-or-push-checks.yml From 63d44bf8d789dd786aa34195ae2bd4c072e424b1 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 21:19:58 +0100 Subject: [PATCH 36/53] Attempt to run "tayfun/flake8-your-pr@master" in PRs. --- .github/workflows/pr-annotate-with-flake8.yml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/pr-annotate-with-flake8.yml diff --git a/.github/workflows/pr-annotate-with-flake8.yml b/.github/workflows/pr-annotate-with-flake8.yml new file mode 100644 index 00000000..2782678a --- /dev/null +++ b/.github/workflows/pr-annotate-with-flake8.yml @@ -0,0 +1,27 @@ +# This workflow will: +# +# install Python dependencies +# Run flake8 to add annotations to the PR +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: PR-annotate-flake8 + +on: + pull_request: + branches: [ develop ] + +jobs: + build: + + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Annotate with Flake8 + uses: "tayfun/flake8-your-pr@master" From 8dbb275dcadc75c440259b618106261f211c997a Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 21:26:55 +0100 Subject: [PATCH 37/53] Specify GITHUB_TOKEN for flake8-your-pr via env --- .github/workflows/pr-annotate-with-flake8.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr-annotate-with-flake8.yml b/.github/workflows/pr-annotate-with-flake8.yml index 2782678a..2f089a9d 100644 --- a/.github/workflows/pr-annotate-with-flake8.yml +++ b/.github/workflows/pr-annotate-with-flake8.yml @@ -25,3 +25,5 @@ jobs: python-version: 3.7 - name: Annotate with Flake8 uses: "tayfun/flake8-your-pr@master" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d65176aed8452b3dd9615b72ac1e55e57e725ca9 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 21:46:00 +0100 Subject: [PATCH 38/53] Add flake8-json to requirements-dev.txt --- .github/workflows/pr-annotate-with-flake8.yml | 2 +- requirements-dev.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-annotate-with-flake8.yml b/.github/workflows/pr-annotate-with-flake8.yml index 2f089a9d..7ac9f99a 100644 --- a/.github/workflows/pr-annotate-with-flake8.yml +++ b/.github/workflows/pr-annotate-with-flake8.yml @@ -24,6 +24,6 @@ jobs: with: python-version: 3.7 - name: Annotate with Flake8 - uses: "tayfun/flake8-your-pr@master" + uses: "Athanasius/flake8-your-pr@master" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/requirements-dev.txt b/requirements-dev.txt index ab0c4685..433b140d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,6 +5,7 @@ flake8-cognitive-complexity==0.0.2 flake8-comprehensions==3.2.3 flake8-pep3101==1.3.0 flake8-polyfill==1.0.2 +flake8-json pep8-naming==0.11.1 # Code formatting tools From 6513db3aca2c6e2f8d93a226746f5c6d828c1ae9 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 22:34:15 +0100 Subject: [PATCH 39/53] Don't force --show-source in .flake8 ! This was the cause of our flake8-your-pr issue! It meant that as well as `--format json` giving JSON output it also got polluted with the raw string of the source line as well. --- .flake8 | 2 +- .github/workflows/pr-annotate-with-flake8.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index a762f8f7..03d0e79c 100644 --- a/.flake8 +++ b/.flake8 @@ -1,6 +1,6 @@ [flake8] # Show exactly where in a line the error happened -show-source = True +#show-source = True max-line-length = 120 # Add _ as a builtin for localisation stuff diff --git a/.github/workflows/pr-annotate-with-flake8.yml b/.github/workflows/pr-annotate-with-flake8.yml index 7ac9f99a..2f089a9d 100644 --- a/.github/workflows/pr-annotate-with-flake8.yml +++ b/.github/workflows/pr-annotate-with-flake8.yml @@ -24,6 +24,6 @@ jobs: with: python-version: 3.7 - name: Annotate with Flake8 - uses: "Athanasius/flake8-your-pr@master" + uses: "tayfun/flake8-your-pr@master" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From df3f70b7ed839dfc08b61efdf16f08af96282784 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 22:40:12 +0100 Subject: [PATCH 40/53] Rename to push-checks.yml, don't do PRs Also commented better at the top --- .../{pr-or-push-checks.yml => push-checks.yml} | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) rename .github/workflows/{pr-or-push-checks.yml => push-checks.yml} (88%) diff --git a/.github/workflows/pr-or-push-checks.yml b/.github/workflows/push-checks.yml similarity index 88% rename from .github/workflows/pr-or-push-checks.yml rename to .github/workflows/push-checks.yml index a61a5c09..ba8367c7 100644 --- a/.github/workflows/pr-or-push-checks.yml +++ b/.github/workflows/push-checks.yml @@ -1,13 +1,15 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python +# This workflow will: +# +# * install Python dependencies +# * lint with a single version of Python +# # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Check-Dependencies-Flake8-PyTest +name: Push-Checks on: push: branches: [ develop ] - pull_request: - branches: [ develop ] jobs: build: From 6ba1f77352b10fa44073a9285bacbb7e9cc77893 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 26 Jul 2020 23:04:37 +0100 Subject: [PATCH 41/53] Remove greet-everyone workflow, we've gotten things working now --- .github/workflows/greet-everyone.yml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .github/workflows/greet-everyone.yml diff --git a/.github/workflows/greet-everyone.yml b/.github/workflows/greet-everyone.yml deleted file mode 100644 index 8eb21f91..00000000 --- a/.github/workflows/greet-everyone.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Greet Everyone -# This workflow is triggered on pushes to the repository. -on: [push] - -jobs: - build: - # Job name is Greeting - name: Greeting - # This job runs on Linux - runs-on: ubuntu-latest - steps: - # This step uses GitHub's hello-world-javascript-action: https://github.com/actions/hello-world-javascript-action - - name: Hello world - uses: actions/hello-world-javascript-action@v1 - with: - who-to-greet: 'Mona the Octocat' - id: hello - # This step prints an output (time) from the previous step's action. - - name: Echo the greeting's time - run: echo 'The time was ${{ steps.hello.outputs.time }}.' - From 1b543e582031d722966641daaa6ca3ad04c13562 Mon Sep 17 00:00:00 2001 From: A_D <A-UNDERSCORE-D@users.noreply.github.com> Date: Mon, 27 Jul 2020 18:55:59 +0200 Subject: [PATCH 42/53] Dont crash when journal_dir is None Ensures that journal_dir is always at least an empty string. Fixes #639 --- monitor.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/monitor.py b/monitor.py index eb63e83c..ac7e8d10 100644 --- a/monitor.py +++ b/monitor.py @@ -118,9 +118,14 @@ class EDLogs(FileSystemEventHandler): def start(self, root): self.root = root - logdir = expanduser(config.get('journaldir') or config.default_journal_dir) # type: ignore # config is weird + journal_dir = config.get('journaldir') or config.default_journal_dir - if not logdir or not isdir(logdir): # type: ignore # config does weird things in its get + if journal_dir is None: + journal_dir = '' + + logdir = expanduser(journal_dir) # type: ignore # config is weird + + if not logdir or not isdir(logdir): self.stop() return False From 6ab4433c590ee1deaec02a004aaf2a8cad838b93 Mon Sep 17 00:00:00 2001 From: A_D <A-UNDERSCORE-D@users.noreply.github.com> Date: Mon, 27 Jul 2020 19:07:54 +0200 Subject: [PATCH 43/53] Add TODO regarding type config --- monitor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/monitor.py b/monitor.py index ac7e8d10..90988dfd 100644 --- a/monitor.py +++ b/monitor.py @@ -122,7 +122,9 @@ class EDLogs(FileSystemEventHandler): if journal_dir is None: journal_dir = '' - + + # TODO(A_D): this is ignored for type checking due to all the different types config.get returns + # When that is refactored, remove the magic comment logdir = expanduser(journal_dir) # type: ignore # config is weird if not logdir or not isdir(logdir): From 974872fe9e706542241e19e4cd1cbc401188cae8 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Thu, 30 Jul 2020 14:05:09 +0100 Subject: [PATCH 44/53] PLUGINS.md: Logging is being added, how to prepare * Currently you use `print(...)` * `logging` support is coming, here's how to prepare. --- PLUGINS.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/PLUGINS.md b/PLUGINS.md index 9f7bf42a..02daa688 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -55,6 +55,72 @@ import myNotebook as nb ``` For creating UI elements. +--- +### Logging +Currently (still in 4.0.3) the only way to provide any logged output from a +plugin is to use `print(...)` statements. When running the application from +the packaged executeable all output is redirected to a log file. See +[Reporting a problem](https://github.com/EDCD/EDMarketConnector/wiki/Troubleshooting#reporting-a-problem) +for the location of this log file. + +A future version of EDMC will implement proper logging using the Python +`logging` module. Plugin developers should get their code ready for this by +using the following code instead of simple `print(...)' statements + +Insert this at the top-level of your load.py file (so not inside +`plugin_start3()`): +```python +import logging + +from config import appname + +# This could also be returned from plugin_start3() +plugin_name = os.path.basename(os.path.dirname(__file__)) + +# A Logger is used per 'found' plugin to make it easy to include the plugin's +# folder name in the logging output format. +logger = logging.getLogger(f'{appname}.{plugin_name}') + +# If the Logger has handlers then it was already set up by the core code, else +# it needs setting up here. +if not logger.hasHandlers(): + level = logging.INFO # So logger.info(...) is equivalent to print() + + logger.setLevel(level) + logger_channel = logging.StreamHandler() + logger_channel.setLevel(level) + logger_formatter = logging.Formatter(f'%(asctime)s - %(name)s - %(levelname)s - %(module)s:%(lineno)d:%(funcName)s: %(message)s') + logger_formatter.default_time_format = '%Y-%m-%d %H:%M:%S' + logger_formatter.default_msec_format = '%s.%03d' + logger_channel.setFormatter(logger_formatter) + logger.addHandler(logger_channel) +``` + +Then replace `print(...)` statements with one of the following: +```python + logger.info('some info message') # instead of print(...) + + logger.debug('something only for debug') + + logger.warning('Something needs warning about') + + logger.error('Some error happened') + + logger.critical('Something went wrong in a critical manner') + + try: + ... + catch Exception: + # This logs at 'ERROR' level. + # Also automatically includes exception information. + logger.exception('An exception occurred') + + try: + ... + catch Exception as e: + logger.debug('Exception we only note in debug output', exc_info=e) +``` + --- ### Startup From 0e6d4468dae8a6bd6ae2c62ac9e937c4e4446565 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Thu, 30 Jul 2020 14:17:14 +0100 Subject: [PATCH 45/53] PLUGINS.md: Fix typo ' -> ` --- PLUGINS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PLUGINS.md b/PLUGINS.md index 02daa688..d574620b 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -65,7 +65,7 @@ for the location of this log file. A future version of EDMC will implement proper logging using the Python `logging` module. Plugin developers should get their code ready for this by -using the following code instead of simple `print(...)' statements +using the following code instead of simple `print(...)` statements Insert this at the top-level of your load.py file (so not inside `plugin_start3()`): From 48499e701750a6fffb6251ae0cdbb0924bf6d056 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Thu, 30 Jul 2020 14:32:12 +0100 Subject: [PATCH 46/53] PLUGINS.md: except not catch --- PLUGINS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PLUGINS.md b/PLUGINS.md index d574620b..8a43bf6f 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -110,14 +110,14 @@ Then replace `print(...)` statements with one of the following: try: ... - catch Exception: + except Exception: # This logs at 'ERROR' level. # Also automatically includes exception information. logger.exception('An exception occurred') try: ... - catch Exception as e: + except Exception as e: logger.debug('Exception we only note in debug output', exc_info=e) ``` From cf25eacda98baaf3b43d73e67708ac2ce577f5be Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Wed, 5 Aug 2020 12:33:52 +0100 Subject: [PATCH 47/53] Releasing.md: We're using Python 3.7.8 now --- docs/Releasing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Releasing.md b/docs/Releasing.md index 0e704d08..4b1862f9 100644 --- a/docs/Releasing.md +++ b/docs/Releasing.md @@ -32,7 +32,7 @@ You will need several pieces of software installed, or the files from their "Windows Software Development Kit - Windows 10.0.18362.1" in "Apps & Features", *not* "Windows SDK AddOn". 1. [Python](https://python.org): 32-bit version of Python 3.7 for Windows. - [v3.7.7](https://www.python.org/downloads/release/python-377/) is the most + [v3.7.8](https://www.python.org/downloads/release/python-378/) is the most recently tested version. You need the `Windows x86 executable installer` file, for the 32-bit version. 1. [py2exe](https://github.com/albertosottile/py2exe): From ab494e64728ed70337b30a99db7297e10cb8a508 Mon Sep 17 00:00:00 2001 From: Athanasius <github@miggy.org> Date: Sun, 2 Aug 2020 19:41:14 +0100 Subject: [PATCH 48/53] Release 4.0.4: Changelog, version, appcast * Version 4.0.4 * ChangeLog.md * edmarketconnector.xml (except length) --- ChangeLog.md | 19 +++++++++++++++++++ config.py | 2 +- edmarketconnector.xml | 28 +++++++++++++++++++++++++--- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 1c5c7701..eb75a48f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,25 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in reverse chronological order (latest first). --- +Release 4.0.4 +=== + + * Don't crash if no non-default Journal Directory has been set. + * Only send to Inara API at most once every 30 seconds. This should avoid + the "Inara 400 Too much requests, slow down, cowboy. ;) ..." message and + being locked out from the API for an hour as a result. Any events that + require data to be sent during the 30s cooldown will be queued and sent when + that timer expires. + + This was caused by previous changes in an attempt to send cargo events + to Inara more often. This fix retains that enhancement. + + Note that if you log out and stop EDMC within 30 seconds you might have + some events not sent. If we tried to force a send then it might hit the + limit when you want to log back in and continue playing. As it is you can + re-run EDMC and log back into the game to ensure Inara is synchronised + properly. + Release 4.0.3 === diff --git a/config.py b/config.py index b0b887ec..c65b59dc 100644 --- a/config.py +++ b/config.py @@ -13,7 +13,7 @@ appcmdname = 'EDMC' # appversion **MUST** follow Semantic Versioning rules: # <https://semver.org/#semantic-versioning-specification-semver> # Major.Minor.Patch(-prerelease)(+buildmetadata) -appversion = '4.0.3' #-rc1+a872b5f' +appversion = '4.0.4' #-rc1+a872b5f' # For some things we want appversion without (possible) +build metadata appversion_nobuild = str(semantic_version.Version(appversion).truncate('prerelease')) copyright = u'© 2015-2019 Jonathan Harris, 2020 EDCD' diff --git a/edmarketconnector.xml b/edmarketconnector.xml index 1ad38955..41b5dcd4 100644 --- a/edmarketconnector.xml +++ b/edmarketconnector.xml @@ -168,11 +168,33 @@ <!-- Windows --> <item> - <title>Release 4.0.3 + Release 4.0.4 body { font-family:"Segoe UI","Tahoma"; font-size: 75%; } h2 { font-family:"Segoe UI","Tahoma"; font-size: 105%; } +

Release 4.0.4

+
    +
  • +

    Don't crash if no non-default Journal Directory has been set.

    +
  • +
  • +

    Only send to Inara API at most once every 30 seconds. This should avoid +the "Inara 400 Too much requests, slow down, cowboy. ;) ..." message and +being locked out from the API for an hour as a result. Any events that +require data to be sent during the 30s cooldown will be queued and sent when +that timer expires.

    +

    This was caused by previous changes in an attempt to send cargo events +to Inara more often. This fix retains that enhancement.

    +

    Note that if you log out and stop EDMC within 30 seconds you might have +some events not sent. If we tried to force a send then it might hit the +limit when you want to log back in and continue playing. As it is you can +re-run EDMC and log back into the game to ensure Inara is synchronised +properly.

    +
  • +
+ +

Release 4.0.3

NB: Anyone who installed a 4.0.3-rcX release candidate version should first uninstall it before installing this. @@ -578,10 +600,10 @@ If any of your plugins are listed in that section then they will need updating, ]]> From ab8aa732d7143f35a0343abc20dc32528a745d9d Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sun, 2 Aug 2020 19:56:14 +0100 Subject: [PATCH 49/53] Release 4.0.4: Mention Python 3.7.8 in changelogs. --- ChangeLog.md | 1 + edmarketconnector.xml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index eb75a48f..92083dcf 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -4,6 +4,7 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are Release 4.0.4 === + * Built using Python 3.7.8. Prior 4.0.x releases used 3.7.7. * Don't crash if no non-default Journal Directory has been set. * Only send to Inara API at most once every 30 seconds. This should avoid the "Inara 400 Too much requests, slow down, cowboy. ;) ..." message and diff --git a/edmarketconnector.xml b/edmarketconnector.xml index 41b5dcd4..9854da44 100644 --- a/edmarketconnector.xml +++ b/edmarketconnector.xml @@ -176,6 +176,9 @@

Release 4.0.4

  • +

    Built using Python 3.7.8. Prior 4.0.x releases used 3.7.7.

    +
  • +
  • Don't crash if no non-default Journal Directory has been set.

  • From 238817a68c2b642920c1b0f664b72bf352af8c23 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sun, 2 Aug 2020 20:02:45 +0100 Subject: [PATCH 50/53] Release 4.0.4: Post-build appcast length update --- edmarketconnector.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edmarketconnector.xml b/edmarketconnector.xml index 9854da44..b551f74c 100644 --- a/edmarketconnector.xml +++ b/edmarketconnector.xml @@ -607,7 +607,7 @@ If any of your plugins are listed in that section then they will need updating, sparkle:os="windows" sparkle:installerArguments="/passive LAUNCH=yes" sparkle:version="4.0.4" - length="11325440" + length="11411456" type="application/octet-stream" /> From f35d9542f6b4734a9939d7afc1026cf099c67e6c Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sun, 2 Aug 2020 20:04:37 +0100 Subject: [PATCH 51/53] Translations: Minor changes * Back to {HH}:{MM}:{SS} for this. * A few extra "Use alternate URL method" translations. --- L10n/cs.strings | 4 ++-- L10n/de.strings | 4 ++-- L10n/es.strings | 4 ++-- L10n/fi.strings | 4 ++-- L10n/fr.strings | 4 ++-- L10n/hu.strings | 4 ++-- L10n/it.strings | 4 ++-- L10n/ja.strings | 4 ++-- L10n/lv.strings | 4 ++-- L10n/nl.strings | 7 +++++-- L10n/pl.strings | 4 ++-- L10n/pt-BR.strings | 4 ++-- L10n/pt-PT.strings | 4 ++-- L10n/ru.strings | 4 ++-- L10n/sl.strings | 4 ++-- L10n/sr-Latn-BA.strings | 4 ++-- L10n/sr-Latn.strings | 4 ++-- L10n/sv-SE.strings | 4 ++-- L10n/uk.strings | 7 +++++-- L10n/zh-Hans.strings | 4 ++-- 20 files changed, 46 insertions(+), 40 deletions(-) diff --git a/L10n/cs.strings b/L10n/cs.strings index 48c58606..42acb642 100644 --- a/L10n/cs.strings +++ b/L10n/cs.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Jazyk"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Poslední aktualizace {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Poslední aktualizace %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/de.strings b/L10n/de.strings index 9e50095f..14ef93ea 100644 --- a/L10n/de.strings +++ b/L10n/de.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Sprache"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Zuletzt aktualisiert um {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Zuletzt aktualisiert um %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Kapitänleutnant"; diff --git a/L10n/es.strings b/L10n/es.strings index 5d4d819a..8dc4eb49 100644 --- a/L10n/es.strings +++ b/L10n/es.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Idioma"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Última actualización: {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Última actualización: %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Teniente de navío"; diff --git a/L10n/fi.strings b/L10n/fi.strings index 7c00b1b1..fd0ff40a 100644 --- a/L10n/fi.strings +++ b/L10n/fi.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Kieli"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Päivitetty viimeksi {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Päivitetty viimeksi %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/fr.strings b/L10n/fr.strings index 97550996..617fc168 100644 --- a/L10n/fr.strings +++ b/L10n/fr.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Langue"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Dernière mise à jour à {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Dernière mise à jour à %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/hu.strings b/L10n/hu.strings index daa68919..18880370 100644 --- a/L10n/hu.strings +++ b/L10n/hu.strings @@ -232,8 +232,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Nyelv"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Utoljára frissítve {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Utoljára frissítve %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Hadnagy"; diff --git a/L10n/it.strings b/L10n/it.strings index 8ec9f094..4a37b4c0 100644 --- a/L10n/it.strings +++ b/L10n/it.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Lingua"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Ultimo aggiornamento alle {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Ultimo aggiornamento alle %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/ja.strings b/L10n/ja.strings index 1810a0a7..9d067991 100644 --- a/L10n/ja.strings +++ b/L10n/ja.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "言語"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "最終更新時間 {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "最終更新時間 %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/lv.strings b/L10n/lv.strings index 3113fbbb..8247abc4 100644 --- a/L10n/lv.strings +++ b/L10n/lv.strings @@ -217,8 +217,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Valoda"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Pēdējo reizi atjaunināts {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Pēdējo reizi atjaunināts %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Leitnants"; diff --git a/L10n/nl.strings b/L10n/nl.strings index a3ee89e7..747d4452 100644 --- a/L10n/nl.strings +++ b/L10n/nl.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Taal"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Voor het laatst bijgewerkt om {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Voor het laatst bijgewerkt om %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; @@ -490,6 +490,9 @@ /* Update button in main window. [EDMarketConnector.py] */ "Update" = "Bijwerken"; +/* Option to use alternate URL method on shipyard links [prefs.py] */ +"Use alternate URL method" = "Gebruik andere URL methode"; + /* Status dialog subtitle - CR value of ship. [stats.py] */ "Value" = "Waarde"; diff --git a/L10n/pl.strings b/L10n/pl.strings index e2d26f8e..e0954301 100644 --- a/L10n/pl.strings +++ b/L10n/pl.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Język"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Ostatnia aktualizacja {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Ostatnia aktualizacja %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/pt-BR.strings b/L10n/pt-BR.strings index bb0c339f..c3fdd3f5 100644 --- a/L10n/pt-BR.strings +++ b/L10n/pt-BR.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Idioma"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Última atualização {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Última atualização %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Tenente"; diff --git a/L10n/pt-PT.strings b/L10n/pt-PT.strings index 249b6e29..2e78260d 100644 --- a/L10n/pt-PT.strings +++ b/L10n/pt-PT.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Linguagem"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Última actualização: {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Última actualização: %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Tenente"; diff --git a/L10n/ru.strings b/L10n/ru.strings index e7f012b8..5ae27431 100644 --- a/L10n/ru.strings +++ b/L10n/ru.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Язык"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Последнее обновление в {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Последнее обновление в %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Лейтенант"; diff --git a/L10n/sl.strings b/L10n/sl.strings index fe2f7435..2020469c 100644 --- a/L10n/sl.strings +++ b/L10n/sl.strings @@ -184,8 +184,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Jezik"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Zadnja osvežitev podatkov {HH}:{MM}:{SS} "; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Zadnja osvežitev podatkov %H:%M:%S "; /* Federation rank. [stats.py] */ "Lieutenant" = "LIeutenant"; diff --git a/L10n/sr-Latn-BA.strings b/L10n/sr-Latn-BA.strings index 3a1dbdc2..3178ffb9 100644 --- a/L10n/sr-Latn-BA.strings +++ b/L10n/sr-Latn-BA.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Jezik"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Posljednji put osvježeno {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Posljednji put osvježeno %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/sr-Latn.strings b/L10n/sr-Latn.strings index 1245451b..45eacc40 100644 --- a/L10n/sr-Latn.strings +++ b/L10n/sr-Latn.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Jezik"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Poslednji put osveženo {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Poslednji put osveženo %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/sv-SE.strings b/L10n/sv-SE.strings index d707eedd..b968a501 100644 --- a/L10n/sv-SE.strings +++ b/L10n/sv-SE.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Språk"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Senaste uppdatering: {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Senaste uppdatering: %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/uk.strings b/L10n/uk.strings index 09b80c27..ace0df1f 100644 --- a/L10n/uk.strings +++ b/L10n/uk.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Мова"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "Останнє оновлення було {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "Останнє оновлення було %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Лейтенант"; @@ -490,6 +490,9 @@ /* Update button in main window. [EDMarketConnector.py] */ "Update" = "Оновлення"; +/* Option to use alternate URL method on shipyard links [prefs.py] */ +"Use alternate URL method" = "Використовувати альтернативний URL-метод"; + /* Status dialog subtitle - CR value of ship. [stats.py] */ "Value" = "Вартість"; diff --git a/L10n/zh-Hans.strings b/L10n/zh-Hans.strings index 2ddbeee6..68827d9d 100644 --- a/L10n/zh-Hans.strings +++ b/L10n/zh-Hans.strings @@ -232,8 +232,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "语言"; -/* [EDMarketConnector.py] */ -"Last updated at {HH}:{MM}:{SS}" = "最后更新于 {HH}:{MM}:{SS}"; +/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ +"Last updated at %H:%M:%S" = "最后更新于 %H:%M:%S"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; From 5083db991833c37ac6c6bd7c9a2cd5a422d2d553 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sun, 2 Aug 2020 20:14:55 +0100 Subject: [PATCH 52/53] Release 4.0.4: Correct translations and update appcast length * Pulling in latest translations meant needing to change %H:%M:%S back to {HH}:{MM}:{SS}. * Built and tested, so has appcast length updated too. --- L10n/cs.strings | 4 ++-- L10n/de.strings | 4 ++-- L10n/es.strings | 4 ++-- L10n/fi.strings | 4 ++-- L10n/fr.strings | 4 ++-- L10n/hu.strings | 4 ++-- L10n/it.strings | 4 ++-- L10n/ja.strings | 4 ++-- L10n/lv.strings | 4 ++-- L10n/nl.strings | 4 ++-- L10n/pl.strings | 4 ++-- L10n/pt-BR.strings | 4 ++-- L10n/pt-PT.strings | 4 ++-- L10n/ru.strings | 4 ++-- L10n/sl.strings | 4 ++-- L10n/sr-Latn-BA.strings | 4 ++-- L10n/sr-Latn.strings | 4 ++-- L10n/sv-SE.strings | 4 ++-- L10n/uk.strings | 4 ++-- L10n/zh-Hans.strings | 4 ++-- edmarketconnector.xml | 2 +- 21 files changed, 41 insertions(+), 41 deletions(-) diff --git a/L10n/cs.strings b/L10n/cs.strings index 42acb642..39e80e0d 100644 --- a/L10n/cs.strings +++ b/L10n/cs.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Jazyk"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Poslední aktualizace %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Poslední aktualizace {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/de.strings b/L10n/de.strings index 14ef93ea..08fb23c7 100644 --- a/L10n/de.strings +++ b/L10n/de.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Sprache"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Zuletzt aktualisiert um %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Zuletzt aktualisiert um {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Kapitänleutnant"; diff --git a/L10n/es.strings b/L10n/es.strings index 8dc4eb49..d4105d03 100644 --- a/L10n/es.strings +++ b/L10n/es.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Idioma"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Última actualización: %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Última actualización: {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Teniente de navío"; diff --git a/L10n/fi.strings b/L10n/fi.strings index fd0ff40a..205c3394 100644 --- a/L10n/fi.strings +++ b/L10n/fi.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Kieli"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Päivitetty viimeksi %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Päivitetty viimeksi {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/fr.strings b/L10n/fr.strings index 617fc168..e51c107c 100644 --- a/L10n/fr.strings +++ b/L10n/fr.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Langue"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Dernière mise à jour à %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Dernière mise à jour à {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/hu.strings b/L10n/hu.strings index 18880370..7275ada4 100644 --- a/L10n/hu.strings +++ b/L10n/hu.strings @@ -232,8 +232,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Nyelv"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Utoljára frissítve %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Utoljára frissítve {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Hadnagy"; diff --git a/L10n/it.strings b/L10n/it.strings index 4a37b4c0..4ddbb393 100644 --- a/L10n/it.strings +++ b/L10n/it.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Lingua"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Ultimo aggiornamento alle %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Ultimo aggiornamento alle {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/ja.strings b/L10n/ja.strings index 9d067991..7848f534 100644 --- a/L10n/ja.strings +++ b/L10n/ja.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "言語"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "最終更新時間 %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "最終更新時間 {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/lv.strings b/L10n/lv.strings index 8247abc4..0a485523 100644 --- a/L10n/lv.strings +++ b/L10n/lv.strings @@ -217,8 +217,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Valoda"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Pēdējo reizi atjaunināts %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Pēdējo reizi atjaunināts {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Leitnants"; diff --git a/L10n/nl.strings b/L10n/nl.strings index 747d4452..9628e488 100644 --- a/L10n/nl.strings +++ b/L10n/nl.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Taal"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Voor het laatst bijgewerkt om %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Voor het laatst bijgewerkt om {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/pl.strings b/L10n/pl.strings index e0954301..72bc34fd 100644 --- a/L10n/pl.strings +++ b/L10n/pl.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Język"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Ostatnia aktualizacja %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Ostatnia aktualizacja {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/pt-BR.strings b/L10n/pt-BR.strings index c3fdd3f5..980fd473 100644 --- a/L10n/pt-BR.strings +++ b/L10n/pt-BR.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Idioma"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Última atualização %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Última atualização {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Tenente"; diff --git a/L10n/pt-PT.strings b/L10n/pt-PT.strings index 2e78260d..1da61a83 100644 --- a/L10n/pt-PT.strings +++ b/L10n/pt-PT.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Linguagem"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Última actualização: %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Última actualização: {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Tenente"; diff --git a/L10n/ru.strings b/L10n/ru.strings index 5ae27431..c357b97c 100644 --- a/L10n/ru.strings +++ b/L10n/ru.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Язык"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Последнее обновление в %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Последнее обновление в {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Лейтенант"; diff --git a/L10n/sl.strings b/L10n/sl.strings index 2020469c..5b705bbf 100644 --- a/L10n/sl.strings +++ b/L10n/sl.strings @@ -184,8 +184,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Jezik"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Zadnja osvežitev podatkov %H:%M:%S "; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Zadnja osvežitev podatkov {HH}:{MM}:{SS} "; /* Federation rank. [stats.py] */ "Lieutenant" = "LIeutenant"; diff --git a/L10n/sr-Latn-BA.strings b/L10n/sr-Latn-BA.strings index 3178ffb9..783e1029 100644 --- a/L10n/sr-Latn-BA.strings +++ b/L10n/sr-Latn-BA.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Jezik"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Posljednji put osvježeno %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Posljednji put osvježeno {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/sr-Latn.strings b/L10n/sr-Latn.strings index 45eacc40..3f1191c2 100644 --- a/L10n/sr-Latn.strings +++ b/L10n/sr-Latn.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Jezik"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Poslednji put osveženo %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Poslednji put osveženo {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/sv-SE.strings b/L10n/sv-SE.strings index b968a501..a3d5ed83 100644 --- a/L10n/sv-SE.strings +++ b/L10n/sv-SE.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Språk"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Senaste uppdatering: %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Senaste uppdatering: {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/L10n/uk.strings b/L10n/uk.strings index ace0df1f..cc0c5bcf 100644 --- a/L10n/uk.strings +++ b/L10n/uk.strings @@ -235,8 +235,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "Мова"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "Останнє оновлення було %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "Останнє оновлення було {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Лейтенант"; diff --git a/L10n/zh-Hans.strings b/L10n/zh-Hans.strings index 68827d9d..251fa21f 100644 --- a/L10n/zh-Hans.strings +++ b/L10n/zh-Hans.strings @@ -232,8 +232,8 @@ /* Appearance setting prompt. [prefs.py] */ "Language" = "语言"; -/* [EDMarketConnector.py] - Leave '%H:%M:%S' as-is */ -"Last updated at %H:%M:%S" = "最后更新于 %H:%M:%S"; +/* [EDMarketConnector.py] - Leave '{HH}:{MM}:{SS}' as-is */ +"Last updated at {HH}:{MM}:{SS}" = "最后更新于 {HH}:{MM}:{SS}"; /* Federation rank. [stats.py] */ "Lieutenant" = "Lieutenant"; diff --git a/edmarketconnector.xml b/edmarketconnector.xml index b551f74c..fdba6d04 100644 --- a/edmarketconnector.xml +++ b/edmarketconnector.xml @@ -607,7 +607,7 @@ If any of your plugins are listed in that section then they will need updating, sparkle:os="windows" sparkle:installerArguments="/passive LAUNCH=yes" sparkle:version="4.0.4" - length="11411456" + length="11419648" type="application/octet-stream" /> From 62ff0424163ea4cff05d3d0b759d4bbc6645e702 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 26 Aug 2020 22:35:24 +0100 Subject: [PATCH 53/53] Releasing.md: Releases now tested with Python 3.7.9 --- docs/Releasing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Releasing.md b/docs/Releasing.md index 4b1862f9..26246803 100644 --- a/docs/Releasing.md +++ b/docs/Releasing.md @@ -32,7 +32,7 @@ You will need several pieces of software installed, or the files from their "Windows Software Development Kit - Windows 10.0.18362.1" in "Apps & Features", *not* "Windows SDK AddOn". 1. [Python](https://python.org): 32-bit version of Python 3.7 for Windows. - [v3.7.8](https://www.python.org/downloads/release/python-378/) is the most + [v3.7.9](https://www.python.org/downloads/release/python-379/) is the most recently tested version. You need the `Windows x86 executable installer` file, for the 32-bit version. 1. [py2exe](https://github.com/albertosottile/py2exe):