1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-28 06:22:13 +03:00

324 Commits

Author SHA1 Message Date
Athanasius
9a185e91ca config.py: Add a lot of docstrings to Config class methods.
I settled on having the full docstring only in the AbstractConfig
definitions.  In the implementations we then have:

"""
<first line same as AbstractConfig>

Implements :meth:`AbstractConfig.<method>`.
"""
2021-04-01 14:45:52 +01:00
Athanasius
9444973ebd config.py: docstring new appversion() and appversion_nobuild() 2021-04-01 14:45:52 +01:00
Athanasius
7a8b1100e9 config.py: Remove static_appversion_nobuild, and point to functions
* Also renamed static_appversion to have leading _ to further discourage
  use.
2021-04-01 14:45:52 +01:00
Athanasius
dcc4f1c4f1 Begin converting config.appversion to a function.
In-place converstion done, next will be all the call sites.
2021-04-01 14:45:52 +01:00
Athanasius
cc571e44b1 Re-factor git short hash into a config.py function.
This should clear the way for using it in running code when not frozen.
2021-04-01 14:45:52 +01:00
Athanasius
7ad3518a7b config.py: Restor appversion to intended 5.0.0-beta1 for current develop. 2021-04-01 14:45:52 +01:00
Athanasius
6dbdd332be config.py: Silence flake8 complaint about no space at start of comment 2021-04-01 14:45:52 +01:00
Athanasius
bfb7780efc Version to 4.2.0-beta1 to distinguish Python 3.8 builds
* I don't want to be checking something against 4.1.x releases when my
  last build was with Python 3.8.

# Conflicts:
#	config.py
2021-04-01 14:45:51 +01:00
Athanasius
87c88b80ea Slightly more paranoia in that NSCFArray check 2021-04-01 14:45:50 +01:00
Athanasius
6a4ab10cd4 Add comment about the __NSCFArray issue 2021-04-01 14:45:50 +01:00
Athanasius
1c269e9f4b Change darwin __raw_get() check for list to check it's not the OTHERS
On darwin this comes back with the type `__NSCFArray`, which I can't
find the definition of (in order to test against it).  So instead let's
check that `res` is not-None, and not one of `str` or `int`, because
then it should be (meant to be) `list`.

Yes, this is weird given the pre-rewrite code is:

```python
        def get(self, key: str) -> Union[None, list, str]:
            """Look up a string configuration value."""
            val = self.settings.get(key)
            if val is None:
                return None

            elif isinstance(val, str):
                return str(val)

            elif isinstance(val, list):
                return list(val)  # make writeable

            else:
                return None
```
But maybe something changed since 3.43 was tested and built.
2021-04-01 14:45:50 +01:00
Athanasius
0f83e5b035 macos config: Respect suppress argument to config.delete()
Else the blind deletion of the shipyard key at startup causes a fatal
exception.
2021-04-01 14:45:50 +01:00
A_D
e4c0703142 fixed log wording 2021-04-01 14:45:50 +01:00
A_D
f5575e5b8e Fixed broken suppress_call calls 2021-04-01 14:45:50 +01:00
A_D
7707c26d18 tiny mypy cleanup 2021-04-01 14:45:50 +01:00
A_D
45e14ee86c added stacktrace to debug log 2021-04-01 14:45:50 +01:00
Athanasius
81e25adfb1 Bump version to 5.0.0-beta1, due to removal of {stations,systems}.p files 2021-04-01 14:45:50 +01:00
Athanasius
471714f149 Bump version for develop to 4.3.0-beta1
Work against stable/main is going to be using 4.2.0-beta1 shortly.
2021-04-01 14:45:49 +01:00
Athanasius
5093fb58ee Add --force-localserver-for-auth CL arg to EDMarketConnector 2021-04-01 14:45:49 +01:00
A_D
3ac956dcec Removed uneeded str() calls 2021-04-01 14:45:48 +01:00
A_D
051245cf90 Renamed various config values to be backwards compatible 2021-04-01 14:45:48 +01:00
Athanasius
b7094c59f3 config: __in_shutdown needs to be abstract member, not self. ? 2021-04-01 14:45:48 +01:00
Athanasius
28a230b584 config: Change self.in_shutdown to be mangled.
I specifically made set_shutdown() *not* take an argument and only ever
set this true so no-one else can monkey with it, so might as well mangle
it too.
2021-04-01 14:45:48 +01:00
Athanasius
50f9410c02 config: Add class member and methods for signalling/checking shutdown status 2021-04-01 14:45:48 +01:00
A_D
41f7391e42 Added _str properties for config Path variables 2021-04-01 14:45:48 +01:00
A_D
1b7ad1f7e9 un-optionaled config.default_journal_dir 2021-04-01 14:45:46 +01:00
A_D
d95db448e8 Fixed getint not passing default arg 2021-04-01 14:45:46 +01:00
A_D
a6f3d4a382 Added optional exception handler 2021-04-01 14:45:46 +01:00
A_D
fad193eff1 Added clarifying comment 2021-04-01 14:45:46 +01:00
A_D
e50c1ec936 Defaults on get_ functions now require kwargs 2021-04-01 14:45:46 +01:00
A_D
a9c705c0cf Removed Optionals from method definitions
It makes typing far easier
2021-04-01 14:45:46 +01:00
A_D
e84373822c Finished docstrings 2021-04-01 14:45:46 +01:00
A_D
a85a3d356a Added warning on windows for large ints 2021-04-01 14:45:46 +01:00
A_D
0ca9e81eca Final fixups for WinConfig
Added delete method
Fixed missing sub_key arg to CreateKeyEx
2021-04-01 14:45:45 +01:00
A_D
bb431b83c1 Added bool support to MacConfig 2021-04-01 14:45:45 +01:00
A_D
9e1bb0a2a2 Added bool support to WinConfig 2021-04-01 14:45:45 +01:00
A_D
82fc4b56f7 Added bool to valid set args 2021-04-01 14:45:45 +01:00
A_D
63c3c55b9b Cleaned up windows imports 2021-04-01 14:45:45 +01:00
A_D
a5140f0be2 Replaced getenv with os.getenv 2021-04-01 14:45:45 +01:00
A_D
0e339111f1 Made sure to grab the correct dir for paths on windows 2021-04-01 14:45:45 +01:00
Athanasius
b3cc94031b Removed old config code
# Conflicts:
#	config.py
2021-04-01 14:45:45 +01:00
A_D
4eaf7175a0 Reimplemented string escaping on LinuxConfig 2021-04-01 14:45:45 +01:00
A_D
3e1a3aaf9c Added bool support to LinuxConfig 2021-04-01 14:45:45 +01:00
A_D
55585342e1 Added disable bool for winsparkle checks 2021-04-01 14:45:45 +01:00
A_D
7f53230a95 Cleaned up imports 2021-04-01 14:45:45 +01:00
A_D
54023725e9 Made sure to catch exceptions in get()
The various get_* functions vary in implementation, but some raise a
ValueError when they are used with a key of the wrong type. This catches
that ValueError when hunting for a valid type.
2021-04-01 14:45:45 +01:00
A_D
36f80d6b15 Updated docstrings, added bool support 2021-04-01 14:45:45 +01:00
A_D
0367dd8ba0 Added legacy password subsystem to AbstractConfig 2021-04-01 14:45:45 +01:00
A_D
e3807648f7 Added linux AbstractConfig implementation 2021-04-01 14:45:45 +01:00
A_D
482c502f52 Added darwin config implementation 2021-04-01 14:45:45 +01:00