Commit Graph
168 Commits
Author SHA1 Message Date
Athanasius a6939c77d9 Backport of fix/891/force-localserver-for-auth_fix-journallock-import
* Move JournalLock into its own file.
2021-03-09 12:37:59 +00:00
Athanasius d8e9748c88 Small tweak to "couldn't lock" message 2021-03-05 16:02:36 +00:00
Athanasius f3ef653a8d Change journal changed locking strings to translations. 2021-03-05 15:46:30 +00:00
Athanasius f449286983 Implement retry of locking when journal dir changed.
In case the user does have another EDMC instance running that they need
to kill first.
2021-03-05 15:08:13 +00:00
Athanasius 447cd2c2d7 Remove unused monitor.JournalLock.self.journal_dir_lock 2021-03-05 14:18:34 +00:00
Athanasius 4884f75419 Change self.journal_dir* vars when updating lock.
* Also, need to seek(0) before unlock to be operating on correct range
of bytes with msvcrt.locking().
2021-03-05 13:46:10 +00:00
Athanasius e9c31c3293 Implement releasing of monitor.JournalLock()
* Implement JournalLock.release_lock().
* Renamed other methods to remove journaldir_ prefix.
* Slightly tweak the code flow for obtaining the lock.
* Implement JournalLock.update_lock(), called from AppWindow.postprefs().
2021-03-05 12:45:22 +00:00
Athanasius c0e7be98f8 Move journal locking code into new monitor.JournalLock class 2021-03-05 12:03:54 +00:00
Athanasius 462cd25312 config: Make config.shutting_down() a property, and change 'callers' 2021-01-11 16:54:09 +00:00
Athanasius 571f9665b3 monitor: Avoid Tk event_generate() calls during shutdown. 2021-01-11 16:43:07 +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 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
A_D 525f0b05e7 Added doctest 2021-01-05 14:34:52 +00:00
A_D b04b39fa8a Fix multiple missions with the same cargo type
A user can collect multiple missions with the same mission cargo, which
is added to the cargo.json as distinct entries. Previously we would take
the last number as the total, leading to invalid counts (and possibly
negative counts).

This adds a method to sum cargo entries based on the cargo name. It also
adds a field on status to access the original cargo JSON data.

Fixes #817
2021-01-05 14:34:51 +00:00
Athanasius 1aba1a0596 Trace: Change several calls from debug to trace. 2020-09-23 22:07:18 +01:00
Athanasius d8ea6a0a94 monitor.py: Fix typo of info() 2020-09-23 15:32:36 +01:00
Athanasius 85d45aadd7 Place detailed logging for "Location" events.
To try and track down what's happening with #713
2020-09-23 11:45:48 +01:00
Athanasius 3afcac0dea monitor.py: Use logging for Journal Folder/File announcements 2020-09-22 18:49:07 +01:00
Athanasius b1d35e0579 Merge branch 'fix/639-crash-linux-unset-journal-dir' into develop 2020-07-27 18:12:40 +01:00
A_D 6ab4433c59 Add TODO regarding type config 2020-07-27 19:07:54 +02:00
A_D 1b543e5820 Dont crash when journal_dir is None
Ensures that journal_dir is always at least an empty string.

Fixes #639
2020-07-27 18:55:59 +02:00
A_D c6e61cc3da Fix ~ not being expanded on linux 2020-07-26 23:08:47 +01:00
A_D 179e06d6e9 added informational comment on private access 2020-07-26 23:08:47 +01:00
A_D ecfed2b558 Modified dict comprehension to be more clear 2020-07-26 23:08:47 +01:00
A_D d9658f2cf9 Fixed alignment and comment grammar 2020-07-26 23:08:47 +01:00
A_D 9a482cb04b Added type annotations where needed
Not everywhere because they can be inferred in a lot of places. But I
added them to a lot of the self.* variables
2020-07-26 23:08:47 +01:00
A_D 21ab456e22 Added variables for repeatedly indexed keys
Repeatedly indexing keys is in general slow. And, not only is it slow,
it makes reading code hell.
2020-07-26 23:08:47 +01:00
A_D 12fdbd0678 Replaced x in list with x in tuple
Tuples are immutable, so this ensures that there isn't any funny business
at runtime
2020-07-26 23:08:47 +01:00
A_D 85c27e4cd7 Replaced or-based ternaries with standard ones 2020-07-26 23:08:47 +01:00
A_D 40aa4f9e63 Added whitespace on scope changes 2020-07-26 23:08:47 +01:00
A_D a6d6599c3b Moved logfile regexp to class level constant
Regular expressions are expensive to recompile constantly, and while the
python regexp library currently caches reuse, it only does so to a point
and that is not a required behaviour.

Compiling regexps once is simply best practice. On top of this, the
regexp was duplicated in various places.
2020-07-26 23:08:47 +01:00
A_D b010b8015d Aligned values of large dicts
helps your eyes track the changes
2020-07-26 23:08:47 +01:00
A_D ed45d59af1 Replaced modulo formatters with .format formatters 2020-07-26 23:08:47 +01:00
A_D 05e6d49880 replaced list comp with generator where possible 2020-07-26 23:08:47 +01:00
A_D 33f25da270 Fixed ambiguous names and logic 2020-07-26 23:08:47 +01:00
A_D 1963140572 removed star import 2020-07-26 23:08:47 +01:00
A_D f95bfd4280 removed bare except clauses 2020-07-26 23:08:47 +01:00
A_D bf74e3647f Fixed various whitespace issues 2020-07-26 23:08:47 +01:00
A_D aeb328b31f Removed oneliners 2020-07-26 23:08:47 +01:00
A_D d877de2758 Ensured all lines are under 120 characters wide 2020-07-26 23:08:47 +01:00
A_D 86dea84e94 Removed tabs preceeding inline comments 2020-07-26 23:08:47 +01:00
A_D a40cebc749 Added whitespace around scope changes
Helps with reading code later
2020-07-26 23:08:47 +01:00
A_D ce7c6d4333 removed unused variable 2020-07-26 23:08:47 +01:00
A_D a9f4f5d507 made all regexps raw strings
ensures no weirdness from escapes
2020-07-26 23:08:47 +01:00
A_D ba67db3f13 removed unused imports 2020-07-26 23:08:47 +01:00
Athanasius 0135c73f6f Merge branch 'fix/614-ship-name-underscore' into release-4.0.3-rc3 2020-07-23 14:43:15 +01:00
Athanasius f9de137105 Add import of os.path.expanduser 2020-07-23 14:40:53 +01:00
A_D aa95573f3d Fix ~ not being expanded on linux 2020-07-23 14:35:57 +01:00
Athanasius 58ad7156b4 monitor.py: Add comment about why this new check is there 2020-07-22 14:48:34 +01:00