1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 17:42:20 +03:00

132 Commits

Author SHA1 Message Date
Athanasius
f9a23cc831 Clean up flake8 output for this branch 2020-07-27 09:37:10 +01:00
Athanasius
bae2f25e19 companion.py: Convert to proper logging 2020-07-27 06:57:52 +01:00
Athanasius
71bb14a737 Document allowed imports for PLUGINS
* List added in 'Available imports' section of PLUGINS.md
* Various *.py files now have comments about things being allowed for
 plugin import.
2020-07-12 19:25:47 +01:00
A_D
1481c3d13e
Added todo, removed import
Added a TODO on the incase plugins need it line, and removed the unused
sys import
2020-07-08 21:24:15 +02:00
A_D
09f5dfff23
Replaced assert False with a clearer raise
previously this would assert False, which always raises an
AssertionError, now we raise a saner ValueError
2020-07-08 18:12:15 +02:00
A_D
2890d33d03
Address review comments
Added a missing comma to the category_map literal
Added parens around an index that does math beforehand
Clarified HTTP/JSON error CredentialsError
2020-07-08 18:05:43 +02:00
A_D
dcb9853b68
Removed python2 specific code
This entire branch is py3 only, and even with this code the actual file
isn't py2 compatible syntax wise
2020-07-07 21:52:30 +02:00
A_D
0b6ef97f41
Made dict copy clearer
While `dict(somedict)` does the same thing as `somedict.copy()`, the
.copy is clearer as to intent
2020-07-07 18:46:23 +02:00
A_D
4aa8e2ca0e
Added variable for re-used accesses
The last starport ID and name was repeatedly accessed out of a dict,
making lines longer and harder to parse
2020-07-07 18:42:16 +02:00
A_D
e739923083
Moved User Agent to constant
This is one of those things that really should be a constant anyway
2020-07-07 18:37:05 +02:00
A_D
5c4c9fd3a7
Added error messages to exceptions where possible
Adds messages to exceptions where they may be useful and I could figure
out what they should be
2020-07-07 18:30:29 +02:00
A_D
34b963620a
Removed bare except clauses
Bare except clauses are a fantastic way to find your HTTP requests
eating your ^C. I replaced all bare excepts with Exception if I could
not find a list of exceptions that could be thrown.
2020-07-07 18:21:48 +02:00
A_D
9363b1457d
Simplified if ladder
Removed a large if ladder with a simpler construct that does the same
thing
2020-07-07 16:59:03 +02:00
A_D
31e0758ee4
Replaced x in $list construct with x in $tuple
Tuples are smaller and immutable, therefore using a tuple is cleaner.
2020-07-07 15:52:45 +02:00
A_D
7260dff9a2
Replaced modulo formatting with .format calls
Modulo formatting is py2 (and C printf) style, its arcane and incredibly
hard to read for large formats.

I used keyed .formats where there were more than a few format specifiers
2020-07-07 15:52:44 +02:00
A_D
765dc0bcf3
Replaced oneline ifs with multiline ifs
Oneline ifs are in general a bad idea in whitespace significant
languages, this replaces them with their multi-line equivalents
2020-07-07 15:52:44 +02:00
A_D
56d4d13d4d
Fixed line spacing and comment length
This adds newlines after blocks and in other logical places to assist
with reading the code. Additionally, comments that were too long to
remain inline within a 120 character limit have been moved above the
line they reference.
2020-07-07 15:52:43 +02:00
Athanasius
259bb3bbd6 Merge branch 'release-final-python27' into python3 2020-06-21 16:43:02 +01:00
Jonathan Harris
4daaed7f0c Fix representation of user-defined errors 2020-06-21 16:31:41 +01:00
Athanasius
091a7c22d5 Revert "Lowers companion.py holdoff to 10 seconds"
This reverts commit 93c4f85b3c4c25216ec5f5f62754671b9d8d04e2.
2020-06-21 16:28:29 +01:00
Athanasius
c8f732f7a2 exe: We don't need to explicitly set REQUESTS_CA_BUNDLE any more. 2020-06-21 16:23:02 +01:00
Athanasius
d4a263aab1 companion.py: De-future 2020-06-21 16:23:01 +01:00
Athanasius
2208fdf686 Removes problematic .encode('utf-8')'s in companion.py 2020-06-21 16:23:00 +01:00
Athanasius
e73db981a8 Fixes EDDN sending to be working.
NB: Due to, I assume, EDDN relay de-duplication of messages, it's been
difficult to 100% test this.  No errors thrown, and stock/release EDMC
also doesn't result in a new message arriving at my EDDN consumer.
2020-06-21 16:23:00 +01:00
Athanasius
e7545e174f Use .items() instead of .iteritems() 2020-06-21 16:23:00 +01:00
Athanasius
ee588e2f1f Fixes generation of market CSV files 2020-06-21 16:23:00 +01:00
Athanasius
d00472c2cd Fixes Frontier oAuth2 initiation 2020-06-21 16:23:00 +01:00
Athanasius
90b05d22c5 Now runs without console errors so far as pressing 'Update' is concerned.
There's an error on the console about an iterator when doing so
though.
2020-06-21 16:23:00 +01:00
Athanasius
d0ae621387 Running EDMarketConnector.py 'works'.
First pass utilising 'futurize' to do most of the work.

  There's an issue with ur'\"' in l10n.py which I'm not sure how to
properly fix.

  This now has errors when hitting the 'Update' button.
2020-06-21 16:23:00 +01:00
Athanasius
886c5740e5 Changes CAPI CLIENT_ID to one under Athanasius' Frontier account 2020-06-18 15:34:39 +01:00
Jonathan Harris
169c8e09b4 Run from source without obtaining a CLIENT_ID 2019-06-19 12:24:22 +01:00
Jonathan Harris
569bb0d834 Increase Auth timeout 2019-04-26 18:10:42 +01:00
Jonathan Harris
11000b086d Generate separate error when deauthorization is required 2019-02-19 18:16:07 +00:00
Jonathan Harris
8838dde116 More robust handling of cAPI server errors 2019-01-18 13:21:51 +00:00
Jonathan Harris
21b70cccfd Force re-authentication on 4xx return from cAPI
Fixes #398
2019-01-17 16:08:00 +00:00
Jonathan Harris
d4cb8b8ff6 Don't hang when cAPI server down 2019-01-16 15:31:09 +00:00
Jonathan Harris
fd492cdf94 Support authentication when running from source
Fixes #395
2019-01-14 21:33:41 +00:00
Jonathan Harris
f00e44065c Set Auth scope to capi 2019-01-10 13:28:07 +00:00
Jonathan Harris
4900969bd9 cAPI data doesn't seem to reliably reflect whether user has Horizons 2019-01-10 01:12:09 +00:00
Jonathan Harris
6ae3c4c786 Don't offer XBox, PSN or Steam options to authenticate 2019-01-07 17:19:21 +00:00
Jonathan Harris
7f6c28488d Fix for non-ASCII Cmdr names 2019-01-05 17:33:50 +00:00
Jonathan Harris
5c8f97a8dd Fix for hang on failed authentication through Steam
Fixes #376 & #377
2019-01-03 16:01:44 +00:00
Jonathan Harris
1ae89de163 Fix token expiry handling 2018-12-31 12:35:25 +00:00
Jonathan Harris
fb911ef28e More logging of OAuth process 2018-12-31 00:25:16 +00:00
Jonathan Harris
0630ff6710 Force re-authentication if credentials entered for wrong Cmdr 2018-12-30 20:09:15 +00:00
Jonathan Harris
56223cdee0 Better error handling during OAuth authorization callback
Allow retry after failed authorization.
2018-12-28 18:49:37 +00:00
Jonathan Harris
f17f5d3f25 PKCE OAuth2 access to cAPI 2018-12-28 03:32:26 +00:00
Jonathan Harris
99b3450992 Add Krait Phantom and Mamba 2018-11-16 11:44:08 +00:00
Jonathan Harris
f2bd931a84 Add missing 3.2 ships, modules & commoditites 2018-09-25 00:17:59 +01:00
Jonathan Harris
6bffcf473e Also fixup rare commodities 2018-08-01 00:23:47 +01:00