1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-16 09:10:35 +03:00

2173 Commits

Author SHA1 Message Date
Athanasius
3516f1cf6d Translations: Updated with latest from OneSkyApp 2020-09-18 15:42:56 +01:00
Athanasius
3864f1fd80
Merge pull request #710 from EDCD/fix/edsm-carrierjump
Add detailed logging of Carrier/FSDJump to edsm plugin
2020-09-18 15:35:55 +01:00
Athanasius
0efe38540f Extend logging to FSDJump as well for ease of testing.
FSDJump happens, relatively, seldom enough to not be too spammy.
2020-09-18 15:33:18 +01:00
Athanasius
3f001a383f plugins/edsm: Add extra logging for CarrierJump events.
We've had reports about EDSM not updating for these, so add logging to
see if it's a bug our end.
2020-09-18 15:15:02 +01:00
Athanasius
a19fd3cbf6 PLUGINS.md: Emphasise the correct way to get a logger.
A_D had accidentally used 'ClickCounter' for this when their folder name
was 'click_counter'.  This lead to using a very bare `logger` which
still used our defined format leading to things blowing up when there
was no adapter to handle `qualname` format string.
2020-09-18 13:07:44 +01:00
Athanasius
7c9b8861fc
Merge pull request #707 from EDCD/fix/671-no-modules
Catch where station modules and shipyard from CAPI aren't as expected.
2020-09-18 13:00:40 +01:00
Athanasius
f485ffa737 Correctly return and receive bare Tuple, not nested. 2020-09-18 12:59:09 +01:00
Athanasius
030ae05889 Adjust return type of companion.session.station()
Now we're correctly always returning `data` it can't be None.
2020-09-18 12:58:16 +01:00
Athanasius
be541571d9 companion.py: Return CAPI data if not docked
Else at least one caller to .station() blows up when it can't find the
commander data.

The call has to be to .station() so as to populate the market/shipyard
added dictionaries.
2020-09-18 12:48:21 +01:00
Athanasius
7d66a47b4b
Merge pull request #709 from EDCD/fix/found-plugin-logging
Plugin logging needs to be DEBUG, to let channels decide later.
2020-09-18 12:37:38 +01:00
Athanasius
ed8403f303 Plugin logging needs to be DEBUG, to let channels decide later.
This should have been changed when the rotating file logging was
implemented.
2020-09-18 12:17:08 +01:00
Athanasius
22a8da5bf7 Add ships sanity checking, and it's all in a helper function now.
* Moved these modules and ships checks to safe_modules_and_ships().
* Applied some paranoia checks to ships as well.
2020-09-18 11:38:20 +01:00
Athanasius
81f71c88ff Catch where station modules from CAPI is an empty list.
Out of paranoia we're also checking if it's a non-empty list and logging
that as an error if encountered.  It should be a dictionary!
2020-09-18 11:15:15 +01:00
Athanasius
42c826f04b
Merge pull request #704 from EDCD/cleanup/commodity.py
Cleanup/commodity.py
2020-09-16 21:01:27 +01:00
Athanasius
beeadf266a
Merge pull request #703 from EDCD/feature/tk-dir-dialog
Locale: More detailed login at startup around changes
2020-09-16 09:43:39 +01:00
Athanasius
c9bea98021 Refer to Known Issues in Bug Report Template. 2020-09-16 09:42:05 +01:00
Athanasius
14d1a0ad5e companion.py: Re-format next(...) to be more obvious. 2020-09-15 17:30:23 +01:00
Athanasius
ed52528718 companion.py: Slight tweaks from running mypy
NB: Using `mypy --follow-imports skip` for now to limit how much it
checks each time.
2020-09-15 16:15:13 +01:00
Athanasius
c311957eff companion.py: import requests does belong down there. 2020-09-15 15:49:28 +01:00
Athanasius
55fcfbeb17 companion.py: Further PyCharm-prompted cleanup.
* Correct use of error[0] to just error.
* We don't want methods not referencing self to be static in this case,
  so annotate them.
* Take suggestion of "if v == []:" equivalent to "if not v:".
* Preserve CAPIData typing throughout filter_ship().
2020-09-15 15:33:00 +01:00
Athanasius
4575353923 companion.py: CAPIData type & PyCharm-prompted cleanup.
* CAPI Data really is just a Dict.  Define a custom type so it could
  easily be a class in future with minimal edits.
* Auth.refresh() *can* also return a str (Access Token).
* Catch specific (but still quite loose) exceptions in Auth.refresh().
* Set self.server in Session.__init__.
* Remove some extraneous () on conditionals.
2020-09-15 15:00:22 +01:00
Athanasius
da2a582c46 companion.py: Use custom type for CAPI Data.
This way if we get more stringent about it (could be a class) we don't
need to edit all the references.
2020-09-15 14:35:37 +01:00
Athanasius
c12c739c11 companion.py: Full pass to 100% pass flake8
* docstrings added throughout.
* .format() all now f-strings.
* Type annotations added throughout.
* White space tweaked.
2020-09-15 14:15:07 +01:00
Athanasius
8b5e5e73de Locale: More detailed login at startup around changes
As we might run into some special cases with users we need to log in
more detail what the locale is around our changes.

NB: Also contains some misc. PyCharm-enacted formatting changes, white
space, wrapping etc.
2020-09-15 10:28:28 +01: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