Commit Graph
2430 Commits
Author SHA1 Message Date
Athanasius 0263dc628b Added some fcntl-based locking code for !win32
* If fcntl can't be imported it will just let things slide.
2021-01-18 21:09:11 +00:00
Athanasius 5c09ef78f8 Add comment as to why the file open is done at top level 2021-01-18 21:09:11 +00:00
Athanasius ab281bca5a Implement msvcrt.locking() under win32
NB: The locked file *must* be opened at top level in order for the file
handle to not get cleaned up, which also removes the locks.
2021-01-18 21:09:11 +00:00
Athanasius 937a38f0b5 Remove extraneous enforce_single_instance() code & add opening of journal lock file 2021-01-18 21:09:10 +00:00
Athanasius 4689666b13 Strip out old win32 only window handle checking code. 2021-01-18 21:08:15 +00:00
Athanasius 61275b73a1 Merge pull request #851 from EDCD/enhancement/848-suppress-dupe-process-popup
Add --suppress-dupe-process-popup and move enforce_single_instance() call after
2021-01-18 21:05:34 +00:00
Athanasius 7e0c141547 This version of protocol.py doesn't yet need EDMCLogging 2021-01-18 14:53:44 +00:00
Athanasius c67b1b76f7 Move argsparse code to top & do rename enforce_single_instance() -> no_other_instance_running()
1. We need the args available at the top.
2. In `develop` we'd renamed `enforce_single_instance()` to
   `no_other_instance_running()` so that it's obvious it's a function
   returning a boolean, rather than the function that does the
   enforcement.
2021-01-18 14:48:17 +00:00
Athanasius c3663d8be8 Move the 'duplicate' constants into a new constants.py
1. So now they're only defined in one place.
2. config.py does an import of them, and `from config import ...` then
   chains through, so no need to update other users.
3. No need to ' # noqa E402' the killswitch/config imports now.
2021-01-18 14:43:45 +00:00
Athanasius 778668f680 Add --suppress-dupe-process-popup and move enforce_single_instance() call after 2021-01-18 14:35:46 +00:00
Athanasius 966599d82c Merge pull request #844 from alterNERDtive/alterNERDtive-patch-1
PLUGINS.md: fix typo & example for `journal_entry`
2021-01-13 13:14:34 +00:00
alterNERDtive 589f0cf454 PLUGINS.md: fix typo & example for journal_entry 2021-01-13 14:06:27 +01:00
Athanasius 52193a9f07 Release 4.1.6: config version and changelog Release/4.1.6 2021-01-12 16:24:10 +00:00
Athanasius 6a8d950b87 Change all requirements to latest tested and use '==' on all.
Although the issue we've identified with GitHub builds isn't to do with
a python module version it's best to nail precise versions so we can be
sure it will build with the same as we've tested locally.
2021-01-11 19:28:56 +00:00
Athanasius 3d515ba919 protocol.py: Need from config import config Release/4.1.6-rc3 2021-01-11 18:20:58 +00:00
Athanasius 501f34836a update.py: Need to from config import config to access shutting_down 2021-01-11 17:48:47 +00:00
Athanasius 67e72f7477 Pre-Release 4.1.6-rc3: config version and changelog 2021-01-11 17:35:54 +00:00
Athanasius c90392ab89 Merge branch 'release-4.1.6-rc2' into release-4.1.6-rc3 2021-01-11 17:24:42 +00:00
Athanasius 6831c45c59 Merge pull request #840 from EDCD/fix/678-check-for-shutdown-when-tk-event-generate
Avoid Tk event_generate() calls during shutdown.
2021-01-11 17:23:15 +00:00
Athanasius 247577c5f4 config: Also set Config.shutting_down to be @propety on win32 and linux 2021-01-11 17:13:31 +00:00
Athanasius 462cd25312 config: Make config.shutting_down() a property, and change 'callers' 2021-01-11 16:54:09 +00:00
Athanasius 111f445cac plugins/inara: Avoid Tk event_generate() calls during shutdown 2021-01-11 16:45:45 +00:00
Athanasius bca0231dfc plugins/edsm: Avoid Tk event_generate() calls during shutdown 2021-01-11 16:45:26 +00:00
Athanasius fb1c9fc034 update: Avoid Tk event_generate() calls during shutdown. 2021-01-11 16:44:11 +00:00
Athanasius 92d5657e21 protocol: Avoid Tk event_generate() calls during shutdown 2021-01-11 16:43:53 +00:00
Athanasius 4bddc4c0cb prefs: Avoid Tk event_generate() calls during shutdown 2021-01-11 16:43:33 +00:00
Athanasius 571f9665b3 monitor: Avoid Tk event_generate() calls during shutdown. 2021-01-11 16:43:07 +00:00
Athanasius 6cdc1dc20c hotkey: Avoid event_generate() calls during shutdown 2021-01-11 16:41:57 +00:00
Athanasius cb9bd30a05 dashboard: Bail early from process() if in shutdown 2021-01-11 16:41:36 +00:00
Athanasius 50f520ab66 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-01-11 15:53:12 +00:00
Athanasius 5175136419 plug.py: Avoid Tk event_generate() call from show_error() if in shutdown 2021-01-11 15:49:08 +00:00
Athanasius 08f1f3e7d9 EDMarketConnector: call config.set_shutdown() in AppWindow.onexit() 2021-01-11 15:37:47 +00:00
Athanasius f92385244c config: Add class member and methods for signalling/checking shutdown status 2021-01-11 15:37:17 +00:00
Athanasius decb889242 Pre-Release 4.1.6-rc2 version and changelog Release/4.1.6-rc2 2021-01-08 15:51:27 +00:00
Athanasius e51bde44ef Shutdown: re-order the top level calls
1. The updater is in a thread/DLL and we don't want that firing part way
  through shutdown, so it gets asked to stop first.
2. Then plugins, so they're out of the way and we won't have already
  stopped something they might rely on.
3. Hotkey after that to head off the user triggering something via them.
4. Now stop the programmatic input from Journal files (including
   Status.json).
5. Frontier auth handling.
6. And then anything else.
2021-01-08 15:44:06 +00:00
Ash Holland 590cd608d3 Fix logging from mangled methods where class name starts with "_"
Python's name-mangling rules are quite complex. Previously, EDMC was
incorrectly mangling names where the class name starts with one or more
underscores; if the class name starts with any underscores, they should
be removed before prepending to the identifier being mangled. If the
class name contains *only* underscores, no mangling should be performed.
2021-01-08 15:32:42 +00:00
Athanasius 5776149d5d Merge pull request #835 from EDCD/fix/834/cease-journal-parse-on-shutdown
Bail out of Journal monitoring during shutdown
2021-01-08 15:14:09 +00:00
Athanasius 90ddd4e1e3 plugins: Log plugin names as we ask them to stop, and when we're done with them all
This should point the finger at any plugin(s) that aren't stopping
properly.  Well, at least those that are hanging *in* their
`plugin_stop()`.
2021-01-08 14:56:22 +00:00
Athanasius 81974f66ec monitor/dashboard: move away from if __debug__
This includes changing one print_exc() to logger.exception()
2021-01-08 14:56:22 +00:00
Athanasius be18f36e54 EDMarketConnector: Bail in AppWindow.journal_entry if monitor.thread is None
monitor.thread should only be none when there's a <<JournalEvent>> to
process if we're in shutdown, in which case we do *not* want to be
processing journal events.
2021-01-08 14:56:22 +00:00
Athanasius 8a0a82fe43 monitor: Bail from get_entry() if self.thread is None
If there's no thread to have sent the message then we shouldn't care
about it as this means we're in shutdown.
2021-01-08 14:56:22 +00:00
Athanasius 95b87f5b7b monitor: Detect shutdown and bail in log reading loop
This should mean not even generating <<JournalEvent>> Tk events once
self.thread == None.
2021-01-08 14:56:22 +00:00
Athanasius f3e87f9c24 Merge branch 'release-4.1.6-rc1' into main 2021-01-08 14:55:56 +00:00
Athanasius bc7d6defed Merge pull request #827 from EDCD/fix/main-push-checks
Replace python checks with jq in workflow
2021-01-05 15:22:29 +00:00
A_D d58d831ebe Replace python checks with jq in workflow
Also makes sure that pushes to main ARE checked
2021-01-05 17:20:21 +02:00
Athanasius 207bb9920f 4.1.6-rc1: version bump and changelog Release/4.1.6-rc1 2021-01-05 15:01:09 +00:00
A_D 525f0b05e7 Added doctest 2021-01-05 14:34:52 +00:00
A_D 416b73bc3b Modified location of state updates 2021-01-05 14:34:52 +00:00
A_D 13f7b62fe8 Added cargoJSON to state docs 2021-01-05 14:34:52 +00:00
A_D 1be723e249 Added additional doccumentation 2021-01-05 14:34:51 +00:00