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

153 Commits

Author SHA1 Message Date
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
Athanasius
ab5e94a7c8 monitor.py: Don't record '' or ' ' as ShipName
Doing so causes the ShipType to not be used in the UI, so you get a
'link' with just a space for the text.

Any user who purposefully sets their ship's name to a single space
can live with seeing the model name instead.  Yes, I checked, the game
allows it.
2020-07-22 14:43:45 +01:00
Athanasius
2bd6e4cb1c PLUGINS.md: Flesh out plugin API docs
* Note in monitor.py to update the docs if anything changed about the
 'state' dictionary.
* Expand on arguments to all plugin call-ins.
* Particularly what the 'state' diction passed to journal_entry()
 contains.
* The contents of the `data` dictionary passed to `cmdr_data()`.
2020-07-12 18:10:16 +01:00
Athanasius
942cbbfcfc Use a strict regex for matching Journal*.log files
A user accidentally copied a Journal file into the same directory, resulting in
a "Journal.<datetime>.<serial> - Copy.log" file.  EDMC 3.99.0.0 then picked this
up and re-sent events to EDDN, EDSM, Inara.

So, let's be strict about the filenames we consider to be valid, live, Journal
files.

 * Journal files have one basic form: Journal.YYMMDDHHMMSS.XX.log
 * In addition the word 'Beta' can be inserted just after 'Journal'

So regex '^Journal(Beta)?\.[0-9]{12}\.[0-9]{2}\.log$' matches both and nothing
else.

Test: The "copy to same directory" that originally triggered this.  EDMC no
      longer 'sees' the copy.
Test: Copied a Journal file out, renamed it to later date/time, copied that
      back in.  EDMC saw it correctly as a new file.

NB: Didn't test the "no emitter" version at monitor.py:251, but no reason to
    think it won't also work.

closes #546
2020-07-02 17:54:04 +01:00
Athanasius
0541e404ec Track system population in monitor, and use in eddb
EDDB station link now triggers off this.system_population, which is
received via monitor passing 'Population' through in Startup, Location,
FSDJump and CarrierJump events.

  One fewer use cases for systems.p (populated status in this case).
2020-07-01 15:51:14 +01:00
Athanasius
1a11202aea Implement tracking station MarketID, and use in eddb plugin
* Adds monitor.station_marketid, tracked at the same points as
   monitor.station (name).
 * Changes EDDB plugin to also track its own this.station_marketid so
   that it can be used in /market-id/ EDDB URL.
   This removes a use case for stations.p file.
2020-07-01 15:51:14 +01:00
Athanasius
259bb3bbd6 Merge branch 'release-final-python27' into python3 2020-06-21 16:43:02 +01:00
Athanasius
cc30f8e913 monitor.py: De-future 2020-06-21 16:23:01 +01:00
Athanasius
0f38e3e824 Removes un-necessary encode('utf-8') 2020-06-21 16:23:00 +01:00
Athanasius
d0ae621387 Running EDMarketConnector.py 'works'.
First pass utilising 'futurize' to do most of the work.

  There's an issue with ur'\"' in l10n.py which I'm not sure how to
properly fix.

  This now has errors when hitting the 'Update' button.
2020-06-21 16:23:00 +01:00
Bernd Gollesch
690ef067b0 keep track of system location if fleet carrier jumps while docked 2020-06-18 17:35:35 +01:00
Jonathan Harris
728ef3f599 Add "horizons" flag to outfitting and shipyard messages 2019-01-08 22:54:39 +00:00
Jonathan Harris
d281599dca Tidy 2018-12-28 03:32:35 +00:00
Jonathan Harris
1cdf1737c8 Track Frontier Cmdr ID 2018-11-15 23:06:40 +00:00
Jonathan Harris
a706c7aa29 Only update ship's cargo if 'Vessel' is 'Ship'
From 3.3 beta3
2018-11-15 22:55:00 +00:00
Jonathan Harris
8c3b0b8de3 Handle new Cargo event variant in 3.3 2018-11-03 10:37:01 +00:00