Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of EDMC's systems.p file (and others) #5

Closed
Athanasius opened this issue Feb 17, 2021 · 6 comments
Closed

Use of EDMC's systems.p file (and others) #5

Athanasius opened this issue Feb 17, 2021 · 6 comments

Comments

@Athanasius
Copy link

EDMC itself no longer makes use of the systems.p file shipped with it. At some future date it might not be shipped any more.

You appear to be using it (and stations.p) in the same manner the core EDDB plugin used to, i.e. to do System Name to EDDB ID lookups for the purpose of constructing EDDB URLs.

themroc kindly added some extra URL schemes to allow for both game system name and systemaddress/id64 lookup of systems, e.g.:

return requests.utils.requote_uri(f'https://eddb.io/system/ed-address/{this.system_address}')
return requests.utils.requote_uri(f'https://eddb.io/system/name/{system_name}')
return requests.utils.requote_uri(f'https://eddb.io/station/market-id/{this.station_marketid}')

You should probably look into adjusting your code to no longer rely on any extra files shipped with EDMC, including, but not necessarily limited to: commodity.csv, rare_commodity.csv, modules.p, ships.p, systems.p, stations.p. Although it's only systems.p and stations.p that are no longer used by EDMC itself at this time, the others really are only for internal use and any third-party use of them risks that breaking if we ever change their format.

@WaferMouse
Copy link
Owner

This is actually fortuitous timing! Thanks for the heads up. The current implementation is a direct clone of how the EDDB plugin used to do it, because I couldn't figure out another way back when I first set it up. I was already implementing a fix for this relating to #4 , and I'm just starting a week off so I'm sitting down to finish it right now :)

@WaferMouse
Copy link
Owner

Fixed as of latest release.

@Athanasius
Copy link
Author

EDMC 5.0.0 is out with this removal. We have one user reporting the issue, but I don't know if they're using the latest version. Log excerpt is:

2021-05-12 20:23:19.781 - ERROR - 13176:18772:18772 plug.Plugin.__init__:64: : Failed for Plugin "edmc-L3-37"
Traceback (most recent call last):
  File "plug.pyc", line 51, in __init__
  File "<frozen importlib._bootstrap_external>", line 529, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1034, in load_module
  File "<frozen importlib._bootstrap_external>", line 859, in load_module
  File "<frozen importlib._bootstrap>", line 274, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 711, in _load
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "C:\Users\Dlljs\AppData\Local\EDMarketConnector\plugins\edmc-L3-37\load.py", line 16, in <module>
    from fsd_target import FSDTarget
  File "C:\Users\Dlljs\AppData\Local\EDMarketConnector\plugins\edmc-L3-37\fsd_target.py", line 42, in <module>
    with open(join(config.respath, 'systems.p'),  'rb') as h:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Program Files (x86)\\EDMarketConnector\\systems.p'
2021-05-12 20:23:19.783 - ERROR - 13176:18772:18772 plug.load_plugins:161: Failure loading found Plugin "edmc-L3-37"
Traceback (most recent call last):
  File "plug.pyc", line 159, in load_plugins
  File "plug.pyc", line 51, in __init__
  File "<frozen importlib._bootstrap_external>", line 529, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1034, in load_module
  File "<frozen importlib._bootstrap_external>", line 859, in load_module
  File "<frozen importlib._bootstrap>", line 274, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 711, in _load
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "C:\Users\Dlljs\AppData\Local\EDMarketConnector\plugins\edmc-L3-37\load.py", line 16, in <module>
    from fsd_target import FSDTarget
  File "C:\Users\Dlljs\AppData\Local\EDMarketConnector\plugins\edmc-L3-37\fsd_target.py", line 42, in <module>
    with open(join(config.respath, 'systems.p'),  'rb') as h:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Program Files (x86)\\EDMarketConnector\\systems.p'

@DlljsCodes
Copy link

DlljsCodes commented May 12, 2021

Hi, I am that user. Thanks @Athanasius for identifying the actual issue.

@WaferMouse
Copy link
Owner

Apologies @DlljsCodes @Athanasius

I saw this issue when you first commented and pushed a fix out almost immediately, it's just that I forgot to reopen and close the issue and didn't reference it anywhere in the rush to push the next fix. Somehow one affected file didn't get updated on GitHub when I did the original fix. See the latest release: https://github.com/WaferMouse/L3-37/releases/tag/110

@Athanasius
Copy link
Author

Thanks, I've updated our Known Issues to reflect this (keeping the entry now with the link to v110).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants