ExTool / ExTool-EDMC-Plugin

10 stars 3 forks source link

Linux Support? #8

Closed waterlubber closed 5 years ago

waterlubber commented 5 years ago

I've been running Elite in WINE, and while the game works fantastic, a few EDMC plugins don't.

I'm running EDMC natively, and most plugins work, but the Canonn ones don't: EXTool refuses to load in with the error ValueError: _type_ 'v' not supported

loading plugin ExTool from "/home/waterlubber/.local/share/EDMarketConnector/plugins/ExTool/load.py"
Traceback (most recent call last):
  File "/mnt/main/home/waterlubber/.local/share/EDMarketConnector/plug.py", line 190, in load_plugins
    found.append(Plugin(name, os.path.join(config.plugin_dir, name, 'load.py')))
  File "/mnt/main/home/waterlubber/.local/share/EDMarketConnector/plug.py", line 91, in __init__
    ('.py', 'r', imp.PY_SOURCE))
  File "/home/waterlubber/.local/share/EDMarketConnector/plugins/ExTool/load.py", line 9, in <module>
    import key
  File "/home/waterlubber/.local/share/EDMarketConnector/plugins/EDMC-Screenshot/key.py", line 2, in <module>
    from ctypes import wintypes
  File "/usr/lib64/python2.7/ctypes/wintypes.py", line 19, in <module>
    class VARIANT_BOOL(_SimpleCData):
ValueError: _type_ 'v' not supported

https://pastebin.com/raw/RXrat9jq

Is this something that I would be able to patch myself? Or would it require a full rewrite? I'd like to help if possible, but I haven't written Python in a while.

Thanks for any assistance you can offer.

inorton commented 5 years ago

You could put a try: except around the import lines in ExTool's load.py

inorton commented 5 years ago

Possibly:

try:
    import key
except ValueError:
    class FakeKey(object):
    def GetForegroundWindow():
        return None
        def GetWindowName(active):
        return "none"
    key = FakeKey()
waterlubber commented 5 years ago

I was able to fix it with the above fix and also by commenting out from winsound import *