1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 16:27:13 +03:00

2259 Commits

Author SHA1 Message Date
A_D
f9f6907a2c
renamed variables to reduce ambiguity 2020-09-14 17:21:20 +02:00
A_D
df554ec8b3
Added docstrings 2020-09-14 17:21:09 +02:00
A_D
2459de4893
Added spacing around scope changes 2020-09-14 17:20:38 +02:00
A_D
ef359395ec
Removed object subclass 2020-09-14 17:19:58 +02:00
A_D
b85b0622f5
Fixed some type issues 2020-09-14 17:19:57 +02:00
A_D
3010f21965
Added some type comments to appease pylance 2020-09-14 17:19:57 +02:00
A_D
742709c431
Replaced modulo-formatting with fstrings 2020-09-14 17:19:56 +02:00
A_D
d77cfd0e7a
removed bare excepts 2020-09-14 17:19:56 +02:00
A_D
9f8d8a9052
cleaned up overlong lines 2020-09-14 17:19:55 +02:00
A_D
ebc34d858c
autoformatted and sorted imports 2020-09-14 17:19:55 +02:00
Athanasius
faf4906eea
Merge pull request #701 from EDCD/fix/671-no-modules
Fix the detection of no modules being available at a station, so is_horizons() doesn't blindly modules.values().
2020-09-14 16:16:39 +01:00
Athanasius
c7f8b3dada Translations: Fix erroneous newline in a RU string 2020-09-14 15:44:03 +01:00
Athanasius
62851bfe3b
Merge pull request #702 from EDCD/feature/tk-dir-dialog
Use tkinter.filedialog on win32, because we now fix locale encoding
2020-09-14 15:43:49 +01:00
Athanasius
31203270bc Switch to "thing is None" on tests. 2020-09-14 15:43:15 +01:00
Athanasius
52dcd3b28a Use tkinter.filedialog on win32, because we now fix locale encoding
tkinter ends up calling something where utf8 characters won't work
because of the windows encoding, e.g. cp1252.

We can't set encoding just for the dialogs, as it's not thread safe.  So
we'll just set it at startup instead.  Utilising:

	locale.setlocale(locale.LC_ALL, '')

to get things set up initially, so we can properly retrieve the language
to go with the encoding on the subsequent setlocale() call.
2020-09-14 15:16:26 +01:00
Athanasius
735e37e10e Revert is_horizons to modules: MAP_STR_ANY as it works 2020-09-14 13:32:06 +01:00
Athanasius
d45070c249 plugins/eddn: Tweak ships/modules in export of shipyard and outfitting from CAPI
There are cases where a station/FC doesn't have outfitting modules or a
ships list.  Let's make the checks happen in both those functions and be
extra paranoid with some logging.

Closes #671
2020-09-14 13:26:20 +01:00
Athanasius
44353b668e Update translations.
I meant to do this for 4.1.0-beta4, so let's try and make sure it's in
the next (pre-)release.
2020-09-11 16:48:20 +01:00
Athanasius
13f7ccc87a Pre-Release 4.1.0-beta4 Release/4.1.0-beta4 2020-09-11 14:28:25 +01:00
Athanasius
057a95f5fd
Merge pull request #696 from EDCD/fix/edmc-eddn-import
Fix/edmc eddn import
2020-09-11 14:21:16 +01:00
Athanasius
3556808606 Remove flake8-pep3101, we're using flake8-use-fstrings instead 2020-09-11 14:18:44 +01:00
Athanasius
5effee0d67
Merge pull request #695 from EDCD/enhancement/515-ui-scaling
Scale versus the startup default value.
2020-09-11 14:16:18 +01:00
Athanasius
17e65ae411 Update flake8/isort/etc versions.
Using older versions meant isort didn't pay attention to control
comments for the fixes in EDMC.py.
2020-09-11 14:10:56 +01:00
Athanasius
f73a372e6b EDMC.py: Correct import eddn position, with isort comments
isort thinks this is a STDLIB import, when it's actually from the
plugins directory.  So add comments to stop isort from re-ordering it.
2020-09-11 14:09:47 +01:00
Athanasius
cd24db88a9 UI Scaling: Size the Scale bar as per our startup value
If we use the last configured value then the width of the Scale bar
changes as per the user's last setting, even though they might not have
yet restarted for all the rest of the UI to resize.
2020-09-11 11:14:19 +01:00
Athanasius
5f759ee2d3 UI Scaling: Update translation now that 100 is default. 2020-09-11 09:29:00 +01:00
Athanasius
0a5bbad55b UI Scaling: Change our %age scaling to be relative to base tk-scaling
So if at startup tk-scaling is 1.33 then a user configured 200(%) will
set it to 2.66 for this run.

* Low end of scale bar set to 10, not 0, because now 0 makes absolutely
  no sense.
* In theory the width of the scale bar, in pixels, is now also correctly
  scaled.
2020-09-11 09:26:01 +01:00
Athanasius
4d3f9264f2 PLUGINS.md: Correct example to 'tkinter' not 'Tkinter'. 2020-09-10 18:31:09 +01:00
Athanasius
1c62cfaf4a
Merge pull request #694 from EDCD/enhancement/locale-logging-and-in-issue
Log locale settings at start & ask in bug template.
2020-09-10 17:58:10 +01:00
Athanasius
575acb3006 Log locale settings at start & ask in bug template. 2020-09-10 17:52:08 +01:00
Athanasius
1b226f8e08 Pre-Release 4.1.0-beta3 Release/4.1.0-beta3 2020-09-10 17:21:30 +01:00
Athanasius
95100ad586
Merge pull request #693 from EDCD/enhancement/515-ui-scaling
Change UI tk.Scale() to use integers to avoid locale issues.
2020-09-10 17:11:50 +01:00
Athanasius
f2ab8f0fd1 UI Scaling: Switch to using integers to avoid tk bug
Using a Tk.DoubleVar() with a locale where a comma is used as the
decimals separator leads to internal tk code recording values with the
comma but then other tk code not accepting that back, so it always
thinks the value is zero and the scale slider can't be moved.

Ref: https://stackoverflow.com/questions/45289237/tkinter-scale-slider-with-float-values-doesnt-work-with-locale-of-language-that

* Change to storing as a REG_DWORD under 'ui_scale' not 'ui_scaling'.
* Change all the code, except the call to *set* the tk scaling to use an
  integer, with 100 = 100%, i.e. equivalent to the old 1.0.
* Update strings slightly, so translations will need updating too.

NB: The theme.default_ui_scale value for plugin authors to query is
still the float that tk returns.
2020-09-10 16:54:14 +01:00
Athanasius
174e169469 UI Scaling: Add text stating changes require a restart.
Also updates the translation text.
2020-09-10 16:35:59 +01:00
Athanasius
b4d7d56222 Startup: Log application and Python version, extra in debug.
* appversion and sys.version logged at INFO.
* At DEBUG: platform, argv[0], exec_prefix, executable, sys.path
2020-09-10 10:14:58 +01:00
Athanasius
b162747e6e
Merge pull request #691 from A-UNDERSCORE-D/enhancement/add-flake8-plugins
Add more flake8 plugins
2020-09-10 09:34:47 +01:00
A_D
ee12b2073c
fixed some sentence construction 2020-09-09 23:23:15 +02:00
A_D
009ded50a1
Ensured PRs dont fail on doc lints 2020-09-09 23:05:59 +02:00
Athanasius
1446796eb8 UI Scaling: Store pre-fiddling default in theme.default_ui_scale
This is in case anything needs to know the ratio between what was the
default and what we then set it to.
2020-09-09 16:18:23 +01:00
A_D
054c2a09c7
Added noqa, docstring, and fstring linters
Additionally this removed one linter that was for preferring .format to
modulo formatting, as the new fstring linter does both
2020-09-09 17:13:13 +02:00
A_D
b50ed893ae
Cleaned up and updated Contributing docs 2020-09-09 17:12:44 +02:00
Athanasius
c5518cf763 Pre-release 4.1.0-beta2 Release/4.1.0-beta2 2020-09-09 15:31:42 +01:00
Athanasius
06b8661c91
Merge pull request #690 from EDCD/fix/console-redirect
Logging: Move stdout/stderr redirect to before `logging` can be run
2020-09-09 15:29:41 +01:00
Athanasius
f25c743d14 Logging: Move stdout/stderr redirect to before logging can be run
If anything does `import logging` it's likely to grab a copy of
sys.stderr before we redirect it meaning things aren't properly
redirected when we start logging.

So put the redirect as early as possible in EDMarketConnector.py.

This will need a test implemented to be sure it's not accidentally
broken by addition of an import before this.
2020-09-09 15:26:08 +01:00
Athanasius
82fc3cad65
Merge pull request #689 from EDCD/fix/eddn-missing-systemaddress
Fix/eddn missing systemaddress
2020-09-09 14:46:10 +01:00
Athanasius
99bac688af eddn: Tweak replay.jsonl try/except flow
* Catch OSError instead of Exception (which is *too* general).
* Put the set of self.replaylog in try/else so it only runs when there
  are no errors.
2020-09-09 14:36:38 +01:00
Athanasius
5e35012611 eddn: flake8 cleanups
* That "EDDN send failed" was too long, so now it's '''-formatted.
* journal_entry() cognitive complexity isn't changing any time soon.
2020-09-09 14:17:39 +01:00
Athanasius
48077f6a30 eddn: Straighten out replay.jsonl opening & minor cleanups.
* The logic for opening replay.jsonl, and detecting if the file was
  already there or not was tortured.  No longer.
* Changed a few logger.debug(..., exc_info=) to logger.exception().
* Changed all logger.warn() (deprecated) to logger.warning().
2020-09-09 14:03:40 +01:00
Athanasius
5d612822da eddn: Tweak the extra EDDN failed message logging format.
It's more readable with \n between each part, and added a prefix.
2020-09-09 13:51:15 +01:00
Athanasius
f7e516c702 L10/en.template: Add 'Log Level' 2020-09-09 13:43:45 +01:00