mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-18 18:07:37 +03:00
Merge branch 'python3' of https://github.com/EDCD/EDMarketConnector into python3
This commit is contained in:
commit
c5adb3bbb9
4
.gitignore
vendored
4
.gitignore
vendored
@ -9,5 +9,7 @@ dump
|
||||
*.pdb
|
||||
*.msi
|
||||
*.wixobj
|
||||
*.xml
|
||||
appcast_win_*.xml
|
||||
appcast_mac_*.xml
|
||||
EDMarketConnector.VisualElementsManifest.xml
|
||||
*.zip
|
||||
|
@ -215,7 +215,6 @@ class AppWindow(object):
|
||||
theme_titlebar.bind('<Button-1>', self.drag_start)
|
||||
theme_titlebar.bind('<B1-Motion>', self.drag_continue)
|
||||
theme_titlebar.bind('<ButtonRelease-1>', self.drag_end)
|
||||
if platform == 'win32': # Can't work out how to deiconify on Linux
|
||||
theme_minimize = tk.Label(self.theme_menubar, image=self.theme_minimize)
|
||||
theme_minimize.grid(row=0, column=3, padx=2)
|
||||
theme.button_bind(theme_minimize, self.oniconify, image=self.theme_minimize)
|
||||
@ -301,6 +300,7 @@ class AppWindow(object):
|
||||
|
||||
self.postprefs(False) # Companion login happens in callback from monitor
|
||||
|
||||
|
||||
# callback after the Preferences dialog is applied
|
||||
def postprefs(self, dologin=True):
|
||||
self.prefsdialog = None
|
||||
@ -576,6 +576,10 @@ class AppWindow(object):
|
||||
return # Startup or in CQC
|
||||
|
||||
if entry['event'] in ['StartUp', 'LoadGame'] and monitor.started:
|
||||
# Disable WinSparkle automatic update checks, IFF configured to do so when in-game
|
||||
if config.getint('disable_autoappupdatecheckingame') and 1:
|
||||
self.updater.setAutomaticUpdatesCheck(False)
|
||||
print('Monitor: Disable WinSparkle automatic update checks')
|
||||
# Can start dashboard monitoring
|
||||
if not dashboard.start(self.w, monitor.started):
|
||||
print("Can't start Status monitoring")
|
||||
@ -595,6 +599,12 @@ class AppWindow(object):
|
||||
if entry['event'] in ['StartUp', 'Location', 'Docked'] and monitor.station and not config.getint('output') & config.OUT_MKT_MANUAL and config.getint('output') & config.OUT_STATION_ANY and companion.session.state != companion.Session.STATE_AUTH:
|
||||
self.w.after(int(SERVER_RETRY * 1000), self.getandsend)
|
||||
|
||||
if entry['event'] == 'ShutDown':
|
||||
# Enable WinSparkle automatic update checks
|
||||
# NB: Do this blindly, in case option got changed whilst in-game
|
||||
self.updater.setAutomaticUpdatesCheck(True)
|
||||
print('Monitor: Enable WinSparkle automatic update checks')
|
||||
|
||||
# cAPI auth
|
||||
def auth(self, event=None):
|
||||
try:
|
||||
@ -663,13 +673,13 @@ class AppWindow(object):
|
||||
self.w.clipboard_append(monitor.station and '%s,%s' % (monitor.system, monitor.station) or monitor.system)
|
||||
|
||||
def help_general(self, event=None):
|
||||
webbrowser.open('https://github.com/Marginal/EDMarketConnector/wiki')
|
||||
webbrowser.open('https://github.com/EDCD/EDMarketConnector/wiki')
|
||||
|
||||
def help_privacy(self, event=None):
|
||||
webbrowser.open('https://github.com/Marginal/EDMarketConnector/wiki/Privacy-Policy')
|
||||
webbrowser.open('https://github.com/EDCD/EDMarketConnector/wiki/Privacy-Policy')
|
||||
|
||||
def help_releases(self, event=None):
|
||||
webbrowser.open('https://github.com/Marginal/EDMarketConnector/releases')
|
||||
webbrowser.open('https://github.com/EDCD/EDMarketConnector/releases')
|
||||
|
||||
def save_raw(self):
|
||||
self.status['text'] = _('Fetching data...')
|
||||
@ -804,4 +814,12 @@ if __name__ == "__main__":
|
||||
|
||||
root = tk.Tk(className=appname.lower())
|
||||
app = AppWindow(root)
|
||||
|
||||
plugins_not_py3_last = config.getint('plugins_not_py3_last') or 0
|
||||
if (plugins_not_py3_last + 86400) < int(time()) and len(plug.PLUGINS_not_py3):
|
||||
tkinter.messagebox.showinfo('Plugins Without Python 3.x Support',
|
||||
"One or more of your enabled plugins do not yet have support for Python 3.x. Please see the list on the 'Plugins' tab of 'File' > 'Settings'. You should check if there is an updated version available, else alert the developer that they need to update the code for Python 3.x\r\n\r\nYou can disable a plugin by renaming its folder to have '.disabled' on the end of the name."
|
||||
)
|
||||
config.set('plugins_not_py3_last', int(time()))
|
||||
|
||||
root.mainloop()
|
||||
|
@ -11,7 +11,7 @@
|
||||
Version="$(var.PRODUCTVERSION)"
|
||||
UpgradeCode="$(var.UPGRADECODE)"
|
||||
Language="!(bind.fileLanguage.EDMarketConnector.exe)"
|
||||
Manufacturer="Marginal">
|
||||
Manufacturer="EDCD">
|
||||
|
||||
<Package Id="*" Keywords="Installer"
|
||||
InstallScope="perMachine"
|
||||
@ -33,7 +33,7 @@
|
||||
<!-- For Add/Remove programs -->
|
||||
<Property Id="ARPPRODUCTICON" Value="EDMarketConnector.exe" />
|
||||
<Property Id="ARPNOMODIFY" Value="yes" Secure="yes" /> <!-- Remove modify - also set by WixUI_Minimal -->
|
||||
<Property Id="ARPHELPLINK" Value="https://github.com/Marginal/EDMarketConnector/wiki" />
|
||||
<Property Id="ARPHELPLINK" Value="https://github.com/EDCD/EDMarketConnector/wiki" />
|
||||
|
||||
<!-- Set INSTALLDIR from ARPINSTALLLOCATION if replacing/upgrading -->
|
||||
<!-- https://wyrdfish.wordpress.com/2012/07/20/msi-writing-guidelines-this-may-be-out-of-date/ -->
|
||||
|
@ -143,7 +143,7 @@
|
||||
"Error: Can't connect to EDSM" = "Błąd: Brak połączenia z EDSM";
|
||||
|
||||
/* [inara.py] */
|
||||
"Error: Can't connect to Inara" = "Błąd: Nie można połączyć się do serwisu Inara";
|
||||
"Error: Can't connect to Inara" = "Błąd: Nie można połączyć się z serwisem Inara";
|
||||
|
||||
/* [edsm.py] */
|
||||
"Error: EDSM {MSG}" = "Błąd: EDSM {MSG}";
|
||||
|
10
PLUGINS.md
10
PLUGINS.md
@ -19,14 +19,14 @@ Each plugin has it's own folder in the `plugins` directory:
|
||||
|
||||
Plugins are python files. The plugin folder must have a file named `load.py` that must provide one module level function and optionally provide a few others.
|
||||
|
||||
EDMC will import the `load.py` file as a module and then call the `plugin_start()` function.
|
||||
EDMC will import the `load.py` file as a module and then call the `plugin_start3()` function.
|
||||
|
||||
```python
|
||||
def plugin_start3(plugin_dir):
|
||||
"""
|
||||
Load this plugin into EDMC
|
||||
"""
|
||||
print "I am loaded! My plugin folder is {}".format(plugin_dir.encode("utf-8"))
|
||||
print("I am loaded! My plugin folder is {}".format(plugin_dir))
|
||||
return "Test"
|
||||
```
|
||||
|
||||
@ -39,7 +39,7 @@ def plugin_stop():
|
||||
"""
|
||||
EDMC is closing
|
||||
"""
|
||||
print "Farewell cruel world!"
|
||||
print("Farewell cruel world!")
|
||||
```
|
||||
|
||||
If your plugin uses one or more threads to handle Events then stop and join() the threads before returning from this function.
|
||||
@ -132,7 +132,7 @@ def plugin_app(parent):
|
||||
|
||||
Once you have created your plugin and EDMC has loaded it there are three other functions you can define to be notified by EDMC when something happens: `journal_entry()`, `dashboard_entry()` and `cmdr_data()`.
|
||||
|
||||
Your events all get called on the main tkinter loop so be sure not to block for very long or the EDMC will appear to freeze. If you have a long running operation then you should take a look at how to do background updates in tkinter - http://effbot.org/zone/tkinter-threads.htm
|
||||
Your events all get called on the main Tkinter loop so be sure not to block for very long or the app will appear to freeze. If you have a long running operation such as sending or receiving data from an external server then you should do this in a separate worker Thread. You can send work items to the worker thread over a Queue. Tkinter is not thread-safe so you should not access any Tkinter resources (including widgets and variables) from worker threads - doing so may cause the app to crash intermittently. You can signal back to the main thread using Tkinter's `event_generate()` widget method, generating a user-defined event that you have previously registered with the [`bind_all()`](http://effbot.org/tkinterbook/tkinter-events-and-bindings.htm) widget method. See the [EDSM plugin](https://github.com/Marginal/EDMarketConnector/blob/master/plugins/edsm.py) for an example of these techniques.
|
||||
|
||||
### Journal Entry
|
||||
|
||||
@ -251,7 +251,7 @@ If you display localized strings in EDMC's main window you should refresh them i
|
||||
|
||||
Translation files should reside in folder named `L10n` inside your plugin's folder. Files must be in macOS/iOS ".strings" format, encoded as UTF-8. You can generate a starting template file for your translations by invoking `l10n.py` in your plugin's folder. This extracts all the translatable strings from Python files in your plugin's folder and places them in a file named `en.template` in the `L10n` folder. Rename this file as `<language_code>.strings` and edit it.
|
||||
|
||||
See EDMC's own [`L10n`](https://github.com/Marginal/EDMarketConnector/tree/master/L10n) folder for the list of supported language codes and for example translation files.
|
||||
See EDMC's own [`L10n`](https://github.com/EDCD/EDMarketConnector/tree/master/L10n) folder for the list of supported language codes and for example translation files.
|
||||
|
||||
|
||||
# Python Package Plugins
|
||||
|
@ -38,4 +38,4 @@ If you have registered with the [Inara](https://inara.cz/) website this app tran
|
||||
|
||||
### Plugins
|
||||
|
||||
If you have installed any [plugins](https://github.com/Marginal/EDMarketConnector/wiki/Plugins) this app makes your Commander details available to those plugins.
|
||||
If you have installed any [plugins](https://github.com/EDCD/EDMarketConnector/wiki/Plugins) this app makes your Commander details available to those plugins.
|
||||
|
34
README.md
34
README.md
@ -1,3 +1,14 @@
|
||||
**2020-06-16 21:00 UTC**
|
||||
|
||||
**Due to a lack of time to continue with maintenance at this point Marginal (also known as Otis on the Discord) has kindly transferred ownership of this github repository to the EDCD Organisation.**
|
||||
|
||||
**EDCD has some volunteers ready to take over maintenance, so over the next few days you can expect at least one fresh release to get things fully transferred (necessary to change the URL that EDMC uses to check for new versions). After that we'll work hard at getting all of the Pull Requests addressed before moving on to any other outstanding Issues.**
|
||||
|
||||
**Initially Athanasius will be the principle maintainer and releaser before passing the reins over to "LCU No Fool Like One" who has kindly agreed to take over as primary maintainer.**
|
||||
|
||||
**Any questions or further offers of help can be directed to the Discord #edmc channel as below.**
|
||||
|
||||
|
||||
[](https://discord.gg/usQ5e6n)
|
||||
|
||||
Elite: Dangerous Market Connector (EDMC)
|
||||
@ -35,14 +46,14 @@ Installation
|
||||
Mac:
|
||||
|
||||
* Requires Mac OS 10.10 or later.
|
||||
* Download the `.zip` archive of the [latest release](https://github.com/Marginal/EDMarketConnector/releases/latest).
|
||||
* Download the `.zip` archive of the [latest release](https://github.com/EDCD/EDMarketConnector/releases/latest).
|
||||
* The zip archive contains the **EDMarketConnector** app - move this app to **Applications** or wherever you want it.
|
||||
* Double-click on the app to run it.
|
||||
|
||||
Windows:
|
||||
|
||||
* Requires Windows 7 or later.
|
||||
* Download the `.msi` package of the [latest release](https://github.com/Marginal/EDMarketConnector/releases/latest).
|
||||
* Download the `.msi` package of the [latest release](https://github.com/EDCD/EDMarketConnector/releases/latest).
|
||||
* Double-click on it to install.
|
||||
* Run **Elite Dangerous Market Connector** from the Start Menu or Start Screen.
|
||||
|
||||
@ -211,7 +222,7 @@ You'll see a very long cooldown period if your system's time of day changes whil
|
||||
- Re-start the app.
|
||||
|
||||
### Update Error!
|
||||
The [GitHub server](https://github.com/Marginal/EDMarketConnector/releases/latest) that hosts this app's updates only supports TLS 1.2 and higher. Follow [these](https://help.passageways.com/hc/en-us/articles/115005183226-How-to-enable-TLS-1-2-in-Internet-Explorer-11-and-MS-Edge) instructions to change your Windows settings to disable the [deprecated](https://tools.ietf.org/html/rfc7568) SSL 2.0 and 3.0 protocols and enable TLS 1.2.
|
||||
The [GitHub server](https://github.com/EDCD/EDMarketConnector/releases/latest) that hosts this app's updates only supports TLS 1.2 and higher. Follow [these](https://help.passageways.com/hc/en-us/articles/115005183226-How-to-enable-TLS-1-2-in-Internet-Explorer-11-and-MS-Edge) instructions to change your Windows settings to disable the [deprecated](https://tools.ietf.org/html/rfc7568) SSL 2.0 and 3.0 protocols and enable TLS 1.2.
|
||||
|
||||
### Location of configuration files
|
||||
If your configuration has been corrupted, or badly set, such that you can't run the program to fix it, or you otherwise need to directly access the configuration then these are the locations of the configuration:
|
||||
@ -237,7 +248,7 @@ Future updates will also be installed to this location.
|
||||
This app doesn't work with PS4 or Xbox Elite: Dangerous accounts. On these platforms the game lacks support for the API and Journal files that this app relies on.
|
||||
|
||||
### Reporting a problem
|
||||
Please report a problem as a new GitHub [issue](https://github.com/Marginal/EDMarketConnector/issues/new). Please wait for the error to occur and zip up and attach this app's log file to the new issue:
|
||||
Please report a problem as a new GitHub [issue](https://github.com/EDCD/EDMarketConnector/issues/new). Please wait for the error to occur and zip up and attach this app's log file to the new issue:
|
||||
|
||||
Mac:
|
||||
|
||||
@ -251,7 +262,7 @@ Windows:
|
||||
Running from source
|
||||
--------
|
||||
|
||||
Download and extract the [latest source code](https://github.com/Marginal/EDMarketConnector/archive/master.zip) (or fork and clone if you're comfortable with using `git`).
|
||||
Download and extract the [latest source code](https://github.com/EDCD/EDMarketConnector/archive/master.zip) (or fork and clone if you're comfortable with using `git`).
|
||||
|
||||
Mac:
|
||||
|
||||
@ -362,3 +373,16 @@ License
|
||||
Copyright © 2015-2019 Jonathan Harris.
|
||||
|
||||
Licensed under the [GNU Public License (GPL)](http://www.gnu.org/licenses/gpl-2.0.html) version 2 or later.
|
||||
|
||||
**2020-06-16 21:00 UTC**
|
||||
|
||||
**Due to a lack of time to continue with maintenance at this point Marginal (also known as Otis on the Discord) has kindly transferred ownership of this github repository to the EDCD Organisation.**
|
||||
|
||||
**EDCD has some volunteers ready to take over maintenance, so over the next few days you can expect at least one fresh release to get things fully transferred (necessary to change the URL that EDMC uses to check for new versions). After that we'll work hard at getting all of the Pull Requests addressed before moving on to any other outstanding Issues.**
|
||||
|
||||
**Initially Athanasius will be the principle maintainer and releaser before passing the reins over to "LCU No Fool Like One" who has kindly agreed to take over as primary maintainer.**
|
||||
|
||||
**Any questions or further offers of help can be directed to the Discord #edmc channel as below.**
|
||||
|
||||
|
||||
[](https://discord.gg/usQ5e6n)
|
||||
|
@ -52,7 +52,7 @@ def addcommodities(data):
|
||||
os.unlink(commodityfile+'.bak')
|
||||
os.rename(commodityfile, commodityfile+'.bak')
|
||||
|
||||
with open(commodityfile, 'wb') as csvfile:
|
||||
with open(commodityfile, 'w') as csvfile:
|
||||
writer = csv.DictWriter(csvfile, ['id', 'symbol', 'category', 'name'])
|
||||
writer.writeheader()
|
||||
for key in sorted(commodities):
|
||||
|
@ -217,3 +217,4 @@ id,symbol,category,name
|
||||
128924331,Alexandrite,Minerals,Alexandrite
|
||||
128924332,Opal,Minerals,Void Opals
|
||||
128924333,RockforthFertiliser,Chemicals,Rockforth Fertiliser
|
||||
128924334,AgronomicTreatment,Chemicals,Agronomic Treatment
|
||||
|
|
@ -27,7 +27,9 @@ holdoff = 60 # be nice
|
||||
timeout = 10 # requests timeout
|
||||
auth_timeout = 30 # timeout for initial auth
|
||||
|
||||
CLIENT_ID = os.getenv('CLIENT_ID') or '227cd239-ab8c-4728-9d3c-d8f588f247bd' # Obtain from https://auth.frontierstore.net/client/signup
|
||||
# Currently the "Elite Dangerous Market Connector (EDCD/Athanasius)" one in
|
||||
# Athanasius' Frontier account
|
||||
CLIENT_ID = os.getenv('CLIENT_ID') or 'fb88d428-9110-475f-a3d2-dc151c2b9c7a' # Obtain from https://auth.frontierstore.net/client/signup
|
||||
SERVER_AUTH = 'https://auth.frontierstore.net'
|
||||
URL_AUTH = '/auth'
|
||||
URL_TOKEN = '/token'
|
||||
|
@ -8,10 +8,10 @@ from sys import platform
|
||||
appname = 'EDMarketConnector'
|
||||
applongname = 'E:D Market Connector'
|
||||
appcmdname = 'EDMC'
|
||||
appversion = '3.5.0.0'
|
||||
appversion = '3.5.1.0'
|
||||
|
||||
update_feed = 'https://marginal.org.uk/edmarketconnector.xml'
|
||||
update_interval = 47*60*60
|
||||
update_feed = 'https://raw.githubusercontent.com/EDCD/EDMarketConnector/releases/edmarketconnector.xml'
|
||||
update_interval = 8*60*60
|
||||
|
||||
|
||||
if platform=='darwin':
|
||||
|
148
docs/RELEASING.md
Normal file
148
docs/RELEASING.md
Normal file
@ -0,0 +1,148 @@
|
||||
Introduction
|
||||
===
|
||||
This document aims to enable anyone to quickly get up to speed on how to:
|
||||
|
||||
1. Build a Windows .exe for the application
|
||||
1. Package that .exe into an .msi file for distribution
|
||||
1. Handle the files generated so the application automatically detects new available versions and asks the user to upgrade.
|
||||
|
||||
Note that for Windows only a 32-bit application is supported at this time. This is principally due to the Windows Registry handling in config.py.
|
||||
|
||||
Environment
|
||||
---
|
||||
You will need several pieces of software installed, or the files from their .zip archives, in order to build the .exe and generate the .msi
|
||||
|
||||
1. [WiX Toolset](https://wixtoolset.org/): 3.11.2 is the most recently tested version.
|
||||
1. [WinSparkle](https://github.com/vslavik/winsparkle): `winsparkle.dll` and `winsparkle.pdb` from the release's .zip file. v0.7.0 is the most recently tested version. Copy the two files, found at `<zip file>\<version>\Release`, into your checkout of the EDMC git files.
|
||||
1. [Windows SDK](https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk/). This is needed for the internationalisation support in EDMC. [Windows 10 SDK, version 1903 (10.0.18362.1)](https://go.microsoft.com/fwlink/?linkid=2083338) is the most recently tested version. Technically you only need the following components: `MSI Tools`, `Windows SDK for Desktop C++ x86 Apps` (which will auto-select some others). NB: If you have need to uninstall this it's "Windows Software Development Kit - Windows 10.0.18362.1" in "Apps & Features", *not* "Windows SDK AddOn".
|
||||
1. [Python](https://python.org): 32-bit version of Python 3.7 for Windows. [v3.7.7](https://www.python.org/downloads/release/python-377/) is the most recently tested version. You need the `Windows x86 executable installer` file, for the 32-bit version.
|
||||
1. You'll now need to 'pip install' several python modules
|
||||
1. `pip install certifi==2019.9.11` (because a later version doesn't work with py2exe, causing cacert.pem to not be found)
|
||||
1. `pip install requests`
|
||||
1. `pip install watchdog`
|
||||
1. [py2exe](https://github.com/albertosottile/py2exe):
|
||||
1. Install the python module. There are two options here.
|
||||
1. You can use the latest release version [0.9.3.2](https://github.com/albertosottile/py2exe/releases/tag/v0.9.3.2) and the current Marginal 'python3' branch as-is. This contains a small hack in `setup.py` to ensure `sqlite3.dll` is packaged.
|
||||
|
||||
pip install py2exe-0.9.3.2-cp37-none-win32.whl
|
||||
1. Or you can use a pre-release version, [0.9.4.0](https://bintray.com/alby128/py2exe/download_file?file_path=py2exe-0.9.4.0-cp37-none-win32.whl), see [this py2exe issue](https://github.com/albertosottile/py2exe/issues/23#issuecomment-541359225), which packages that DLL file correctly.
|
||||
|
||||
pip install py2exe-0.9.4.0-cp37-none-win32.whl
|
||||
You can then edit out the following line from `setup.py`, but it does no harm:
|
||||
|
||||
%s/DLLs/sqlite3.dll' % (sys.base_prefix),
|
||||
|
||||
1. `pip install keyring==19.2.0` (because newer tries to get importlib_metadata in a way that doesn't work)
|
||||
|
||||
As dependencies also get pulled in here's a list of what ends up in site-packages, and their versions:
|
||||
|
||||
cachetools-4.1.0.dist-info
|
||||
certifi-2019.9.11.dist-info
|
||||
chardet-3.0.4.dist-info
|
||||
entrypoints-0.3.dist-info
|
||||
future-0.18.2-py3.7.egg-info
|
||||
keyring-19.2.0.dist-info
|
||||
pathtools-0.1.2-py3.7.egg-info
|
||||
pefile-2019.4.18-py3.7.egg-info
|
||||
py2exe-0.9.4.0.dist-info
|
||||
pywin32_ctypes-0.2.0.dist-info
|
||||
requests-2.23.0.dist-info
|
||||
setuptools-41.2.0.dist-info
|
||||
urllib3-1.25.9.dist-info
|
||||
watchdog-0.10.2-py3.7.egg-info
|
||||
|
||||
If you are using different versions of any of these tools then please ensure that the paths where they're installed match the associated lines in `setup.py`. i.e. if you're using later WiX you might need to edit the WIXPATH line, and likewise the SDKPATH line if you're using a later Windows SDK kit.
|
||||
|
||||
Necessary Edits
|
||||
---
|
||||
There are some things that you should always change before running your own version of EDMC
|
||||
1. The Frontier CAPI client ID. This is hardcoded in companion.py, but can be overridden by setting a CLIENT_ID environment variable.
|
||||
|
||||
There are other things that you should probably change, but can get away with leaving at the upstream values, especially if you only you are going to use the resulting .exe and/or .msi files. **But** realise that the resulting program will still try to check for new versions at the main URL unless you change that.
|
||||
|
||||
1. Copyright and 'Company' texts. These are in `setup.py`. Search for `'copyright'` and `'company_name'`.
|
||||
|
||||
1. Location of release files. To change this edit `setup.py`. Look for the `appcast.write()` statement and change the `url="...` line.
|
||||
|
||||
1. Application names, version and URL the file with latest release information. These are all in the `config.py` file. See the `from config import ...` lines in setup.py.
|
||||
1. appname: The short appname, e.g. 'EDMarketConnector'
|
||||
1. applongname: The long appname, e.g. 'E:D Market Connector'
|
||||
1. appcmdname: The CLI appname, e.g. 'EDMC'
|
||||
1. appversion: The current version, e.g. '3.5.0.0'
|
||||
1. update_feed: The URL where the application looks for current latest version information. This URL should be hosting a renamed (so the full URL doesn't change over application versions) version of the appcast_win_<version>.xml file. The original upstream value is `https://marginal.org.uk/edmarketconnector.xml`
|
||||
|
||||
Packaging & Installer Generation
|
||||
---
|
||||
You'll want to do the .exe and .msi generation in a `cmd.exe` window, not e.g. a 'Git bash' window.
|
||||
|
||||
Assuming the correct python.exe is associated with .py files then simply run:
|
||||
|
||||
setup.py py2exe
|
||||
|
||||
else you might need this, which assumes correct python.exe is in your PATH:
|
||||
|
||||
python.exe setup.py py2exe
|
||||
|
||||
else you'll have to specify the path to python.exe:
|
||||
|
||||
"%LOCALAPPDATA%\Programs\Python\Python37-32\python.exe" setup.py py2exe
|
||||
|
||||
Output will be something like (`...` denoting parts elided for brevity):
|
||||
|
||||
running py2exe
|
||||
...
|
||||
Building 'dist.win32\EDMC.exe'.
|
||||
Building 'dist.win32\EDMarketConnector.exe'.
|
||||
Building shared code archive 'dist.win32\library.zip'.
|
||||
...
|
||||
Windows Installer XML Toolset Compiler version 3.11.1.2318
|
||||
Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
...
|
||||
Package language = 1033,1029,1031,1034,1035,1036,1038,1040,1041,1043,1045,1046,1049,1058,1062,2052,2070,2074,0, ProductLanguage = 1029, Database codepage = 0
|
||||
MsiTran V 5.0
|
||||
Copyright (c) Microsoft Corporation. All Rights Reserved
|
||||
...
|
||||
DonePackage language = 1033,1029,1031,1034,1035,1036,1038,1040,1041,1043,1045,1046,1049,1058,1062,2052,2070,2074,0, ProductLanguage = 0, Database codepage = 0
|
||||
MsiTran V 5.0
|
||||
Copyright (c) Microsoft Corporation. All Rights Reserved
|
||||
|
||||
Done
|
||||
|
||||
You should now have one new/updated folder `dist.win32` and two new files (version number dependent): `EDMarketConnector_win_350.msi` and `appcast_win_350.xml`. If you want to just check the generated .exe files then they're in that `dist.win32` folder.
|
||||
|
||||
Now check that the `EDMarketConnector.exe` in the `dist.win32` folder does run without errors.
|
||||
|
||||
Finally, uninstall your current version of ED Market Connector and re-install using the newly generated .msi file. Check the resulting installation does work (the installer will run the program for you).
|
||||
|
||||
Distribution
|
||||
---
|
||||
It is recommended to keep all the files for distribution on github, including the 'update_feed' file. So once you have tested the new .msi file
|
||||
|
||||
1. So as to make backing out any mistakes easier create a new branch for this release, e.g. `release-350`. 'release' is in full so as not to clash with the tag `rel-350` which could cause confusion. Ensure all the relevant commits, and no more than them, are present in this branch. This branch will be local to only you, you shouldn't ever push it to GitHub unless asked to by another maintainer.
|
||||
|
||||
1. You should have already decided on the new version number, as it's specified in `config.py`. You'll need to redo the `.msi` build if you forgot. **Remember to do a fresh git commit for this change.**
|
||||
1. Keep in mind that despite being specified as, e.g. '3.5.0.0' the `setup.py` code only takes note of the first 3 parts for deciding the release number. i.e. `3.5.0.1` results in the same `rel-350/EDMarketConnector_win_350.msi` as '3.5.0.0' does. Also the installer won't think that '3.5.0.1' is any newer than '3.5.0.0'.
|
||||
|
||||
1. Prepare a changelog text for the release. You'll need this both for the GitHub release and the contents of the `edmarketconnector.xml` file.
|
||||
1. Update `edmarketconnector.xml` to add this changelog text to the correct section(s).
|
||||
1. You'll need to change the `<title>` and `<description>` texts to reflect the latest version and the additional changelog.
|
||||
1. Update the `url`, `sparkle:version` and `length` elements of the `<enclosure>` section as per the latest `appcast_win_<version>.xml` file generated by the build process.
|
||||
1. **DO NOT git commit this change or push to github**. *We need to get the github release in place first before changing the file that running EDMC clients will check.*
|
||||
|
||||
1. Add a git tag for the release, which you'll refer to when actually creating the release:
|
||||
1. The tag should match the `rel-XYZ` part of the URL in the `appcast_win_XYX.msi` file. e.g. `git tag -a rel-350`
|
||||
|
||||
1. Now merge this release-specific branch into the `releases` branch and push it to GitHub.
|
||||
1. `git checkout releases`
|
||||
1. `git merge release-350`
|
||||
1. As you push the changes ensure the new tag is also pushed: `git push --tags origin` (perform the suggested `git push --set-upstream origin releases` if prompted to).
|
||||
|
||||
1. Craft a new github Release, using the new tag so as to reference the correct commit. Include the .msi file for Windows (the Source Code files are added by github based on the release tag). Use the changelog text you already prepared.
|
||||
|
||||
1. Check that the URL for the release that you specified in `edmarketconnector.xml` actually matches where github has placed the `.msi` file.
|
||||
|
||||
1. **NOW commit the latest `edmarketconnector.xml` changes to the `releases` branch and push to github.**
|
||||
This is the step that fully publishes the release for running EDMC instances to pick up on 'Check for Updates'. Yes, this means that this step isn't included in the git tag for the release, but the alternative (with hosting the file via github raw URL) is to have a race condition where a running EDMC instance might check the file and see there's a new version *before that new version is actually available for download*.
|
||||
1. `git checkout releases`
|
||||
1. `git commit -m "Make release 350 live" edmarketconnector.xml`
|
||||
1. `git push origin`
|
332
edmarketconnector.xml
Normal file
332
edmarketconnector.xml
Normal file
@ -0,0 +1,332 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<channel>
|
||||
<title>E:D Market Connector</title>
|
||||
<link>https://raw.githubusercontent.com/EDCD/EDMarketConnector/releases/edmarketconnector.xml</link>
|
||||
<description>Most recent changes with links to updates.</description>
|
||||
|
||||
<!-- Important: Mac must be listed before Windows since Sparkle < 1.18.1 on OSX doesn't check sparkle:os -->
|
||||
|
||||
<item>
|
||||
<title>Release 3.44</title>
|
||||
<description>
|
||||
<![CDATA[
|
||||
<style>h2 { font-size: 105%; }</style>
|
||||
<h2>Release 3.44</h2>
|
||||
<p><b>CHANGE OF MAINTAINER</b></p>
|
||||
<p>Due to a lack of time to give the project the attention it needs Marginal has handed over ownership of the EDMarketConnector GitHub repository to the EDCD (Elite Dangerous Community Developers) organisation.</p>
|
||||
<p>Initially Athanasius will now be responsible for maintaining the code, including addressing any Pull Requests and Issues, and making releases. <b><u>Unfortunately he has no access to hardware running MacOS so can't easily generate builds for that platform</u> or test them. So for the time being releases will be for Windows 10 only.</b> MacOS users are advised to look into running from source (see the github README).</p>
|
||||
<p>Going forwards the intention is to move to the python 3.7 code as soon as possible. To facilitate this there will be one more python 2.7 release in addition to this one, with the main aim of that being to add code to alert the user about any plugins they use that have apparently not been updated to run under python 3.7.</p>
|
||||
<p>See the project GitHub repository's <a href="https://github.com/EDCD/EDMarketConnector/blob/master/README.md">README.md</a> for further information.</p>
|
||||
<ul>
|
||||
<li>Version increased to 3.4.4.0 / 3.44.</li>
|
||||
<li>URL the application checks for updates changed to point to github,</li>
|
||||
</ul>
|
||||
<h2>Release 3.44</h2>
|
||||
<h2>Release 3.43</h2>
|
||||
<ul>
|
||||
<li>New commodity and modules from “September Update”.</li>
|
||||
<li>Misc fixes.</li>
|
||||
<li>More control over plugin widget colors.</li>
|
||||
</ul>
|
||||
<p>The first time that you run the app while playing the game you are redirected to Frontier's authentication website and prompted for your username and password.</p>
|
||||
<h2>Release 3.42</h2>
|
||||
<ul>
|
||||
<li>Use EDSY.org address for EDShipyard.</li>
|
||||
<li>Add advanced multi-cannon from “Bridging the Gap”.</li>
|
||||
</ul>
|
||||
<h2>Release 3.41</h2>
|
||||
<ul>
|
||||
<li>Transparent theme window size reduced.</li>
|
||||
</ul>
|
||||
<h2>Release 3.40</h2>
|
||||
<ul>
|
||||
<li>Add new modules in 3.4.</li>
|
||||
<li>Improved authentication when app started with game already running.</li>
|
||||
</ul>
|
||||
<h2>Release 3.38</h2>
|
||||
<ul>
|
||||
<li>More authentication fixes.</li>
|
||||
<li>Send influence and reputation gain to Inara on mission completion.</li>
|
||||
</ul>
|
||||
<h2>Release 3.37</h2>
|
||||
<ul>
|
||||
<li>More authentication fixes.</li>
|
||||
<li>More robust/graceful handling of Frontier Auth and/or cAPI server outages.</li>
|
||||
</ul>
|
||||
<h2>Release 3.36</h2>
|
||||
<ul>
|
||||
<li>Fix for forthcoming Frontier authentication changes.</li>
|
||||
</ul>
|
||||
<h2>Release 3.35</h2>
|
||||
<ul>
|
||||
<li>Display feedback on successful authentication.</li>
|
||||
<li>Outfitting and Shipyard data also sent to EDDN on visiting outfitting or shipyard in-game, and tagged with a “Horizons” flag.</li>
|
||||
<li>Sends your local faction reputation to Inara.</li>
|
||||
<li>Fix for preferences window appearance on macOS Mojave.</li>
|
||||
</ul>
|
||||
<h2>Release 3.33</h2>
|
||||
<ul>
|
||||
<li>More authentication fixes.</li>
|
||||
</ul>
|
||||
<h2>Release 3.32</h2>
|
||||
<ul>
|
||||
<li>Fix for token expiry during a session (“Frontier server is down” error).</li>
|
||||
<li>Force re-authentication if credentials entered for wrong Cmdr.</li>
|
||||
<li>More logging of OAuth failures.</li>
|
||||
</ul>
|
||||
<h2>Release 3.31</h2>
|
||||
<ul>
|
||||
<li>Support for OAuth2-based access to station commodity market, outfitting and shipyard data.</li>
|
||||
<li>Fix for command-line program.</li>
|
||||
<li>Improved handling of authentication errors.</li>
|
||||
<li>Commodity market data also sent to EDDN on visiting the in-game commodity market.</li>
|
||||
<li>Misc fixes.</li>
|
||||
</ul>
|
||||
<h2>Release 3.30</h2>
|
||||
<ul>
|
||||
<li>Support for OAuth2-based access to station commodity market, outfitting and shipyard data.</li>
|
||||
<li>Commodity market data also sent to EDDN on visiting the in-game commodity market.</li>
|
||||
<li>Misc fixes.</li>
|
||||
</ul>
|
||||
<h2>Release 3.20</h2>
|
||||
<ul>
|
||||
<li>Preliminary support for E:D 3.3.</li>
|
||||
<li>Support accessing Journal on macOS remotely over SMB.</li>
|
||||
<li>Misc fixes.</li>
|
||||
</ul>
|
||||
<h2>Release 3.12</h2>
|
||||
<ul>
|
||||
<li>Fix EDSM support.</li>
|
||||
<li>Send Coriolis links to <a href="https://coriolis.io/" target="_blank">https://coriolis.io/</a> instead of https://coriolid.edcd.io/. To migrate saved builds see <a href="https://youtu.be/4SvnLcefhtI" target="_blank">https://youtu.be/4SvnLcefhtI</a>.</li>
|
||||
<li>Plugins: pass plugin's folder location to plugin_start().</li>
|
||||
</ul>
|
||||
<h2>Release 3.11</h2>
|
||||
<ul>
|
||||
<li>Misc fixes.</li>
|
||||
</ul>
|
||||
<h2>Release 3.10</h2>
|
||||
<ul>
|
||||
<li>Support for new ships and modules in E:D 3.1.</li>
|
||||
<li>Fix for sending ship loadouts with engineered modules with certain secondary effects to Inara.</li>
|
||||
<li>Add separators between plugins in main window.</li>
|
||||
<li>Chinese (Simplified) translation courtesy of Cmdr Zhixian Wu.</li>
|
||||
<li>Portuguese (Portugal) translation courtesy of Carlos Oliveira.</li>
|
||||
</ul>
|
||||
<h2>Release 3.06</h2>
|
||||
<ul>
|
||||
<li>Extend localisation support to plugins.</li>
|
||||
<li>Hungarian translation courtesy of Cmdr Wormhole.</li>
|
||||
<li>Misc fixes.</li>
|
||||
</ul>
|
||||
<h2>Release 3.05</h2>
|
||||
<ul>
|
||||
<li>Fix for “Frontier server is down” error on systems with primary language other than English.</li>
|
||||
<li>Fix for TD prices file format.</li>
|
||||
</ul>
|
||||
<h2>Release 3.04</h2>
|
||||
<ul>
|
||||
<li>Export ship loadout to Coriolis in Journal “Loadout” format.</li>
|
||||
<li>Fix for “This app requires accurate timestamps” error - get timestamps for cAPI-derived data from cAPI server.</li>
|
||||
<li>Fix for TCE integration.</li>
|
||||
<li>Support for “package plugins”.</li>
|
||||
</ul>
|
||||
<h2>Release 3.03</h2>
|
||||
<ul>
|
||||
<li>Fixes for stats and plugin display.</li>
|
||||
</ul>
|
||||
<h2>Release 3.02</h2>
|
||||
<ul>
|
||||
<li>Choose between eddb, EDSM and Inara for station and shipyard links.</li>
|
||||
<li>Don't display “Solo” mode in main window.</li>
|
||||
<li>Fix for saving ship loadout to file when ship name contains punctuation.</li>
|
||||
</ul>
|
||||
<h2>Release 3.01</h2>
|
||||
<ul>
|
||||
<li>Various fixes for EDSM, Inara and TCE integrations.</li>
|
||||
<li>Fix for failure to terminate cleanly.</li>
|
||||
<li>Switch ship loadout file to journal format.</li>
|
||||
</ul>
|
||||
<h2>Release 3.00</h2>
|
||||
<ul>
|
||||
<li>Support for E:D 3.0.</li>
|
||||
<li>Updates your entire fleet on EDSM and/or Inara whenever you visit the shipyard in game.</li>
|
||||
<li>Updates your current ship's loadout on EDSM and/or Inara whenever it changes.</li>
|
||||
<li>Plugin access to your dashboard status.</li>
|
||||
</ul>
|
||||
]]>
|
||||
</description>
|
||||
<enclosure
|
||||
url="https://github.com/EDCD/EDMarketConnector/releases/download/rel-344/EDMarketConnector_mac_344.zip"
|
||||
sparkle:os="macos"
|
||||
sparkle:version="3.4.4.0"
|
||||
length="6058091"
|
||||
type="application/octet-stream"
|
||||
/>
|
||||
</item>
|
||||
|
||||
<!-- Windows -->
|
||||
|
||||
<item>
|
||||
<title>Release 3.44</title>
|
||||
<description>
|
||||
<![CDATA[
|
||||
<style>body { font-family:"Segoe UI","Tahoma"; font-size: 75%; } h2 { font-family:"Segoe UI","Tahoma"; font-size: 105%; }</style>
|
||||
<h2>Release 3.44</h2>
|
||||
<p><b>CHANGE OF MAINTAINER</b></p>
|
||||
<p>Due to a lack of time to give the project the attention it needs Marginal has handed over ownership of the EDMarketConnector GitHub repository to the EDCD (Elite Dangerous Community Developers) organisation.</p>
|
||||
<p>Initially Athanasius will now be responsible for maintaining the code, including addressing any Pull Requests and Issues, and making releases. Unfortunately he has no access to hardware running MacOS so can't easily generate builds for that platform or test them. So for the time being releases will be for Windows 10 only. MacOS users are advised to look into running from source (see the github README).</p>
|
||||
<p>Going forwards the intention is to move to the python 3.7 code as soon as possible. To facilitate this there will be one more python 2.7 release in addition to this one, with the main aim of that being to add code to alert the user about any plugins they use that have apparently not been updated to run under python 3.7.</p>
|
||||
<p>See the project GitHub repository's <a href="https://github.com/EDCD/EDMarketConnector/blob/master/README.md">README.md</a> for further information.</p>
|
||||
<ul>
|
||||
<li>Version increased to 3.4.4.0 / 3.44.</li>
|
||||
<li>URL the application checks for updates changed to point to github,</li>
|
||||
</ul>
|
||||
<h2>Release 3.43</h2>
|
||||
<ul>
|
||||
<li>New commodity and modules from “September Update”.</li>
|
||||
<li>Increase transparent theme font size.</li>
|
||||
<li>Misc fixes.</li>
|
||||
<li>More control over plugin widget colors.</li>
|
||||
</ul>
|
||||
<p>The first time that you run the app while playing the game you are redirected to Frontier's authentication website and prompted for your username and password.</p>
|
||||
<h2>Release 3.42</h2>
|
||||
<ul>
|
||||
<li>Use EDSY.org address for EDShipyard.</li>
|
||||
<li>Fixes for running under Wine on Linux.</li>
|
||||
<li>Support not always on top with dark theme on Linux.</li>
|
||||
<li>Add advanced multi-cannon from ”Bridging the Gap”.</li>
|
||||
</ul>
|
||||
<h2>Release 3.41</h2>
|
||||
<ul>
|
||||
<li>Transparent theme window size reduced.</li>
|
||||
</ul>
|
||||
<h2>Release 3.40</h2>
|
||||
<ul>
|
||||
<li>Use Euro Caps font with transparent theme.</li>
|
||||
<li>Add new modules in 3.4.</li>
|
||||
<li>Improved authentication when app started with game already running.</li>
|
||||
</ul>
|
||||
<h2>Release 3.38</h2>
|
||||
<ul>
|
||||
<li>More authentication fixes.</li>
|
||||
<li>Send influence and reputation gain to Inara on mission completion.</li>
|
||||
</ul>
|
||||
<h2>Release 3.37</h2>
|
||||
<ul>
|
||||
<li>More authentication fixes.</li>
|
||||
<li>More robust/graceful handling of Frontier Auth and/or cAPI server outages.</li>
|
||||
</ul>
|
||||
<h2>Release 3.36</h2>
|
||||
<ul>
|
||||
<li>Fix for forthcoming Frontier authentication changes.</li>
|
||||
<li>Fix for installation on non-English systems.</li>
|
||||
</ul>
|
||||
<h2>Release 3.35</h2>
|
||||
<ul>
|
||||
<li>Display feedback on successful authentication.</li>
|
||||
<li>Outfitting and Shipyard data also sent to EDDN on visiting outfitting or shipyard in-game, and tagged with a “Horizons” flag.</li>
|
||||
<li>Sends your local faction reputation to Inara.</li>
|
||||
</ul>
|
||||
<p>The first time that you run the app while playing the game you are redirected to Frontier's authentication website and prompted for your username and password.</p>
|
||||
<h2>Release 3.33</h2>
|
||||
<ul>
|
||||
<li>More authentication fixes.</li>
|
||||
</ul>
|
||||
<h2>Release 3.32</h2>
|
||||
<ul>
|
||||
<li>Fix for token expiry during a session (“Frontier server is down” error).</li>
|
||||
<li>Force re-authentication if credentials entered for wrong Cmdr.</li>
|
||||
<li>More logging of OAuth failures.</li>
|
||||
</ul>
|
||||
<h2>Release 3.31</h2>
|
||||
<ul>
|
||||
<li>Support for OAuth2-based access to station commodity market, outfitting and shipyard data.</li>
|
||||
<li>Fix for command-line program.</li>
|
||||
<li>Improved handling of authentication errors.</li>
|
||||
<li>Commodity market data also sent to EDDN on visiting the in-game commodity market.</li>
|
||||
<li>Misc fixes.</li>
|
||||
</ul>
|
||||
<h2>Release 3.30</h2>
|
||||
<ul>
|
||||
<li>Support for OAuth2-based access to station commodity market, outfitting and shipyard data.</li>
|
||||
<li>Commodity market data also sent to EDDN on visiting the in-game commodity market.</li>
|
||||
<li>Misc fixes.</li>
|
||||
</ul>
|
||||
<h2>Release 3.20</h2>
|
||||
<ul>
|
||||
<li>Preliminary support for E:D 3.3.</li>
|
||||
<li>Support accessing Journal on macOS remotely over SMB.</li>
|
||||
<li>Misc fixes.</li>
|
||||
</ul>
|
||||
<h2>Release 3.12</h2>
|
||||
<ul>
|
||||
<li>Send Coriolis links to <a href="https://coriolis.io/" target="_blank">https://coriolis.io/</a> instead of https://coriolid.edcd.io/. To migrate saved builds see <a href="https://youtu.be/4SvnLcefhtI" target="_blank">https://youtu.be/4SvnLcefhtI</a>.</li>
|
||||
</ul>
|
||||
<h2>Release 3.11</h2>
|
||||
<ul>
|
||||
<li>Misc fixes.</li>
|
||||
</ul>
|
||||
<h2>Release 3.10</h2>
|
||||
<ul>
|
||||
<li>Support for new ships and modules in E:D 3.1.</li>
|
||||
<li>Fix for sending ship loadouts with engineered modules with certain secondary effects to Inara.</li>
|
||||
<li>Add separators between plugins in main window.</li>
|
||||
<li>Chinese (Simplified) translation courtesy of Cmdr Zhixian Wu.</li>
|
||||
<li>Portuguese (Portugal) translation courtesy of Carlos Oliveira.</li>
|
||||
</ul>
|
||||
<h2>Release 3.06</h2>
|
||||
<ul>
|
||||
<li>Extend localisation support to plugins.</li>
|
||||
<li>Hungarian translation courtesy of Cmdr Wormhole.</li>
|
||||
<li>Misc fixes.</li>
|
||||
</ul>
|
||||
<h2>Release 3.05</h2>
|
||||
<ul>
|
||||
<li>Fix for “Frontier server is down” error on systems with primary language other than English.</li>
|
||||
<li>Fix for TD prices file format.</li>
|
||||
</ul>
|
||||
<h2>Release 3.04</h2>
|
||||
<ul>
|
||||
<li>Export ship loadout to Coriolis in Journal “Loadout” format.</li>
|
||||
<li>Fix for “This app requires accurate timestamps” error - get timestamps for cAPI-derived data from cAPI server.</li>
|
||||
<li>Fix for TCE integration.</li>
|
||||
<li>Support for “package plugins”.</li>
|
||||
</ul>
|
||||
<h2>Release 3.03</h2>
|
||||
<ul>
|
||||
<li>Fixes for stats and plugin display.</li>
|
||||
</ul>
|
||||
<h2>Release 3.02</h2>
|
||||
<ul>
|
||||
<li>Choose between eddb, EDSM and Inara for station and shipyard links.</li>
|
||||
<li>Don't display “Solo” mode in main window.</li>
|
||||
<li>Fix for saving ship loadout to file when ship name contains punctuation.</li>
|
||||
</ul>
|
||||
<h2>Release 3.01</h2>
|
||||
<ul>
|
||||
<li>Various fixes for EDSM, Inara and TCE integrations.</li>
|
||||
<li>Fix for failure to terminate cleanly.</li>
|
||||
<li>Switch ship loadout file to journal format.</li>
|
||||
</ul>
|
||||
<h2>Release 3.00</h2>
|
||||
<ul>
|
||||
<li>Support for E:D 3.0.</li>
|
||||
<li>Updates your entire fleet on EDSM and/or Inara whenever you visit the shipyard in game.</li>
|
||||
<li>Updates your current ship's loadout on EDSM and/or Inara whenever it changes.</li>
|
||||
<li>Plugin access to your dashboard status.</li>
|
||||
</ul>
|
||||
]]>
|
||||
</description>
|
||||
<enclosure
|
||||
url="https://github.com/EDCD/EDMarketConnector/releases/download/rel-344/EDMarketConnector_win_344.msi"
|
||||
sparkle:os="windows"
|
||||
sparkle:installerArguments="/passive LAUNCH=yes"
|
||||
sparkle:version="3.4.4.0"
|
||||
length="10338304"
|
||||
type="application/octet-stream"
|
||||
/>
|
||||
</item>
|
||||
|
||||
</channel>
|
||||
</rss>
|
@ -431,8 +431,8 @@ class EDLogs(FileSystemEventHandler):
|
||||
self.station = None
|
||||
self.stationtype = None
|
||||
self.stationservices = None
|
||||
elif entry['event'] in ['Location', 'FSDJump', 'Docked']:
|
||||
if entry['event'] == 'Location':
|
||||
elif entry['event'] in ['Location', 'FSDJump', 'Docked', 'CarrierJump']:
|
||||
if entry['event'] in ('Location', 'CarrierJump'):
|
||||
self.planet = entry.get('Body') if entry.get('BodyType') == 'Planet' else None
|
||||
elif entry['event'] == 'FSDJump':
|
||||
self.planet = None
|
||||
|
@ -278,7 +278,7 @@ fighter_rating_map = {
|
||||
}
|
||||
|
||||
misc_internal_map = {
|
||||
('detailedsurfacescanner', 'tiny') : ('Detailed Surface Scanner', 'C'),
|
||||
('detailedsurfacescanner', 'tiny') : ('Detailed Surface Scanner', 'I'),
|
||||
('dockingcomputer', 'advanced') : ('Advanced Docking Computer', 'E'),
|
||||
('dockingcomputer', 'standard') : ('Standard Docking Computer', 'E'),
|
||||
'planetapproachsuite' : ('Planetary Approach Suite', 'I'),
|
||||
|
10
plug.py
10
plug.py
@ -14,6 +14,7 @@ import tkinter as tk
|
||||
import myNotebook as nb
|
||||
|
||||
from config import config
|
||||
from time import time as time
|
||||
|
||||
|
||||
# Dashboard Flags constants
|
||||
@ -67,6 +68,7 @@ GuiFocusCodex = 11
|
||||
|
||||
# List of loaded Plugins
|
||||
PLUGINS = []
|
||||
PLUGINS_not_py3 = []
|
||||
|
||||
# For asynchronous error display
|
||||
last_error = {
|
||||
@ -99,6 +101,7 @@ class Plugin(object):
|
||||
self.module = module
|
||||
elif getattr(module, 'plugin_start', None):
|
||||
sys.stdout.write('plugin %s needs migrating\n' % name)
|
||||
PLUGINS_not_py3.append(self)
|
||||
else:
|
||||
sys.stdout.write('plugin %s has no plugin_start3() function\n' % name)
|
||||
except:
|
||||
@ -196,6 +199,13 @@ def load_plugins(master):
|
||||
pass
|
||||
PLUGINS.extend(sorted(found, key = lambda p: operator.attrgetter('name')(p).lower()))
|
||||
|
||||
plugins_not_py3_last = config.getint('plugins_not_py3_last') or 0
|
||||
if (plugins_not_py3_last + 86400) < int(time()) and len(PLUGINS_not_py3):
|
||||
tk.messagebox.showinfo('EDMC: Plugins Without Python 3.x Support',
|
||||
"One or more of your enabled plugins do not yet have support for Python 3.x. Please see the list on the 'Plugins' tab of 'File' > 'Settings'. You should check if there is an updated version available, else alert the developer that they need to update the code for Python 3.x\r\n\r\nYou can disable a plugin by renaming its folder to have '.disabled' on the end of the name."
|
||||
)
|
||||
config.set('plugins_not_py3_last', int(time()))
|
||||
|
||||
def provides(fn_name):
|
||||
"""
|
||||
Find plugins that provide a function
|
||||
|
@ -396,8 +396,8 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
|
||||
return filtered
|
||||
|
||||
# Track location
|
||||
if entry['event'] in ['Location', 'FSDJump', 'Docked']:
|
||||
if entry['event'] == 'Location':
|
||||
if entry['event'] in ['Location', 'FSDJump', 'Docked', 'CarrierJump']:
|
||||
if entry['event'] in ('Location', 'CarrierJump'):
|
||||
this.planet = entry.get('Body') if entry.get('BodyType') == 'Planet' else None
|
||||
elif entry['event'] == 'FSDJump':
|
||||
this.planet = None
|
||||
@ -413,10 +413,7 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
|
||||
|
||||
# Send interesting events to EDDN, but not when on a crew
|
||||
if (config.getint('output') & config.OUT_SYS_EDDN and not state['Captain'] and
|
||||
(entry['event'] == 'Location' or
|
||||
entry['event'] == 'FSDJump' or
|
||||
entry['event'] == 'Docked' or
|
||||
entry['event'] == 'Scan') and
|
||||
(entry['event'] in ('Location', 'FSDJump', 'Docked', 'Scan', 'SAASignalsFound', 'CarrierJump')) and
|
||||
('StarPos' in entry or this.coordinates)):
|
||||
# strip out properties disallowed by the schema
|
||||
for thing in ['ActiveFine', 'CockpitBreach', 'BoostUsed', 'FuelLevel', 'FuelUsed', 'JumpDist', 'Latitude', 'Longitude', 'Wanted']:
|
||||
|
@ -300,7 +300,7 @@ def worker():
|
||||
plug.show_error(_('Error: EDSM {MSG}').format(MSG=msg))
|
||||
else:
|
||||
for e, r in zip(pending, reply['events']):
|
||||
if not closing and e['event'] in ['StartUp', 'Location', 'FSDJump']:
|
||||
if not closing and e['event'] in ['StartUp', 'Location', 'FSDJump', 'CarrierJump']:
|
||||
# Update main window's system status
|
||||
this.lastlookup = r
|
||||
this.system.event_generate('<<EDSMStatus>>', when="tail") # calls update_status in main thread
|
||||
@ -347,13 +347,13 @@ def should_send(entries):
|
||||
return False
|
||||
|
||||
|
||||
# Call edsm_notify_system() in this and other interested plugins with EDSM's response to a 'StartUp', 'Location' or 'FSDJump' event
|
||||
# Call edsm_notify_system() in this and other interested plugins with EDSM's response to a 'StartUp', 'Location', 'FSDJump' or 'CarrierJump' event
|
||||
def update_status(event=None):
|
||||
for plugin in plug.provides('edsm_notify_system'):
|
||||
plug.invoke(plugin, None, 'edsm_notify_system', this.lastlookup)
|
||||
|
||||
|
||||
# Called with EDSM's response to a 'StartUp', 'Location' or 'FSDJump' event. https://www.edsm.net/en/api-journal-v1
|
||||
# Called with EDSM's response to a 'StartUp', 'Location', 'FSDJump' or 'CarrierJump' event. https://www.edsm.net/en/api-journal-v1
|
||||
# msgnum: 1xx = OK, 2xx = fatal error, 3xx = error, 4xx = ignorable errors.
|
||||
def edsm_notify_system(reply):
|
||||
if not reply:
|
||||
|
@ -374,9 +374,29 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
|
||||
[
|
||||
OrderedDict([
|
||||
('minorfactionName', f['Name']),
|
||||
('minorfactionReputation', f['MyReputation']),
|
||||
('minorfactionReputation', f['MyReputation']/100.0),
|
||||
]) for f in entry['Factions']
|
||||
])
|
||||
elif entry['event'] == 'CarrierJump':
|
||||
this.system = None
|
||||
add_event('addCommanderTravelCarrierJump', entry['timestamp'],
|
||||
OrderedDict([
|
||||
('starsystemName', entry['StarSystem']),
|
||||
('stationName', entry['StationName']),
|
||||
('marketID', entry['MarketID']),
|
||||
('shipType', state['ShipType']),
|
||||
('shipGameID', state['ShipID']),
|
||||
]))
|
||||
if entry.get('Factions'):
|
||||
add_event('setCommanderReputationMinorFaction', entry['timestamp'],
|
||||
[
|
||||
OrderedDict([
|
||||
('minorfactionName', f['Name']),
|
||||
('minorfactionReputation', f['MyReputation']/100.0),
|
||||
]) for f in entry['Factions']
|
||||
])
|
||||
# Ignore the following 'Docked' event
|
||||
this.suppress_docked = True
|
||||
|
||||
# Override standard URL functions
|
||||
if config.get('system_provider') == 'Inara':
|
||||
@ -613,20 +633,25 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
|
||||
add_event('addCommanderCombatDeath', entry['timestamp'], data)
|
||||
|
||||
elif entry['event'] == 'Interdicted':
|
||||
add_event('addCommanderCombatInterdicted', entry['timestamp'],
|
||||
OrderedDict([('starsystemName', system),
|
||||
('opponentName', entry['Interdictor']),
|
||||
data = OrderedDict([('starsystemName', system),
|
||||
('isPlayer', entry['IsPlayer']),
|
||||
('isSubmit', entry['Submitted']),
|
||||
]))
|
||||
])
|
||||
if 'Interdictor' in entry:
|
||||
data['opponentName'] = entry['Interdictor']
|
||||
elif 'Faction' in entry:
|
||||
data['opponentName'] = entry['Faction']
|
||||
elif 'Power' in entry:
|
||||
data['opponentName'] = entry['Power']
|
||||
add_event('addCommanderCombatInterdicted', entry['timestamp'], data)
|
||||
|
||||
elif entry['event'] == 'Interdiction':
|
||||
data = OrderedDict([('starsystemName', system),
|
||||
('isPlayer', entry['IsPlayer']),
|
||||
('isSuccess', entry['Success']),
|
||||
])
|
||||
if 'Interdictor' in entry:
|
||||
data['opponentName'] = entry['Interdictor']
|
||||
if 'Interdicted' in entry:
|
||||
data['opponentName'] = entry['Interdicted']
|
||||
elif 'Faction' in entry:
|
||||
data['opponentName'] = entry['Faction']
|
||||
elif 'Power' in entry:
|
||||
@ -821,7 +846,7 @@ def worker():
|
||||
print('Inara\t%s %s\t%s' % (reply_event['eventStatus'], reply_event.get('eventStatusText', ''), json.dumps(data_event)))
|
||||
if reply_event['eventStatus'] // 100 != 2:
|
||||
plug.show_error(_('Error: Inara {MSG}').format(MSG = '%s, %s' % (data_event['eventName'], reply_event.get('eventStatusText', reply_event['eventStatus']))))
|
||||
if data_event['eventName'] in ['addCommanderTravelDock', 'addCommanderTravelFSDJump', 'setCommanderTravelLocation']:
|
||||
if data_event['eventName'] in ['addCommanderTravelCarrierJump', 'addCommanderTravelDock', 'addCommanderTravelFSDJump', 'setCommanderTravelLocation']:
|
||||
this.lastlocation = reply_event.get('eventData', {})
|
||||
this.system_link.event_generate('<<InaraLocation>>', when="tail") # calls update_location in main thread
|
||||
elif data_event['eventName'] in ['addCommanderShip', 'setCommanderShip']:
|
||||
|
24
prefs.py
24
prefs.py
@ -183,6 +183,13 @@ class PreferencesDialog(tk.Toplevel):
|
||||
self.hotkey_play_btn = nb.Checkbutton(configframe, text=_('Play sound'), variable=self.hotkey_play, state = self.hotkey_code and tk.NORMAL or tk.DISABLED) # Hotkey/Shortcut setting
|
||||
self.hotkey_play_btn.grid(columnspan=4, padx=PADX, sticky=tk.W)
|
||||
|
||||
# Option to disabled Automatic Check For Updates whilst in-game
|
||||
ttk.Separator(configframe, orient=tk.HORIZONTAL).grid(columnspan=4, padx=PADX, pady=PADY*4, sticky=tk.EW)
|
||||
self.disable_autoappupdatecheckingame = tk.IntVar(value = config.getint('disable_autoappupdatecheckingame'))
|
||||
self.disable_autoappupdatecheckingame_btn = nb.Checkbutton(configframe, text=_('Disable Automatic Application Updates Check when in-game'), variable=self.disable_autoappupdatecheckingame, command=self.disable_autoappupdatecheckingame_changed)
|
||||
self.disable_autoappupdatecheckingame_btn.grid(columnspan=4, padx=PADX, sticky=tk.W)
|
||||
|
||||
|
||||
ttk.Separator(configframe, orient=tk.HORIZONTAL).grid(columnspan=4, padx=PADX, pady=PADY*4, sticky=tk.EW)
|
||||
nb.Label(configframe, text=_('Preferred websites')).grid(row=30, columnspan=4, padx=PADX, sticky=tk.W) # Settings prompt for preferred ship loadout, system and station info websites
|
||||
|
||||
@ -272,6 +279,18 @@ class PreferencesDialog(tk.Toplevel):
|
||||
label = nb.Label(plugsframe, text='%s (%s)' % (plugin.folder, plugin.name))
|
||||
label.grid(columnspan=2, padx=PADX*2, sticky=tk.W)
|
||||
|
||||
############################################################
|
||||
# Show which plugins don't have Python 3.x support
|
||||
############################################################
|
||||
if len(plug.PLUGINS_not_py3):
|
||||
ttk.Separator(plugsframe, orient=tk.HORIZONTAL).grid(columnspan=3, padx=PADX, pady=PADY * 8, sticky=tk.EW)
|
||||
nb.Label(plugsframe, text=_('Plugins Without Python 3.x Support:')+':').grid(padx=PADX, sticky=tk.W)
|
||||
for plugin in plug.PLUGINS_not_py3:
|
||||
if plugin.folder: # 'system' ones have this set to None to suppress listing in Plugins prefs tab
|
||||
nb.Label(plugsframe, text=plugin.name).grid(columnspan=2, padx=PADX*2, sticky=tk.W)
|
||||
HyperlinkLabel(plugsframe, text=_('Information on migrating plugins'), background=nb.Label().cget('background'), url='https://github.com/EDCD/EDMarketConnector/blob/master/PLUGINS.md#migration-to-python-37', underline=True).grid(columnspan=2, padx=PADX, sticky=tk.W)
|
||||
############################################################
|
||||
|
||||
disabled_plugins = [x for x in plug.PLUGINS if x.folder and not x.module]
|
||||
if len(disabled_plugins):
|
||||
ttk.Separator(plugsframe, orient=tk.HORIZONTAL).grid(columnspan=3, padx=PADX, pady=PADY * 8, sticky=tk.EW)
|
||||
@ -418,6 +437,11 @@ class PreferencesDialog(tk.Toplevel):
|
||||
self.logdir.set(config.default_journal_dir)
|
||||
self.outvarchanged()
|
||||
|
||||
def disable_autoappupdatecheckingame_changed(self):
|
||||
config.set('disable_autoappupdatecheckingame', self.disable_autoappupdatecheckingame.get())
|
||||
# If it's now False, re-enable WinSparkle ? Need access to the AppWindow.updater variable to call down
|
||||
|
||||
|
||||
def themecolorbrowse(self, index):
|
||||
(rgb, color) = tkColorChooser.askcolor(self.theme_colors[index], title=self.theme_prompts[index], parent=self.parent)
|
||||
if color:
|
||||
|
14
setup.py
14
setup.py
@ -96,7 +96,7 @@ if sys.platform=='darwin':
|
||||
],
|
||||
'LSMinimumSystemVersion': '10.10',
|
||||
'NSAppleScriptEnabled': True,
|
||||
'NSHumanReadableCopyright': u'© 2015-2019 Jonathan Harris',
|
||||
'NSHumanReadableCopyright': u'© 2015-2019 Jonathan Harris, 2020 EDCD',
|
||||
'SUEnableAutomaticChecks': True,
|
||||
'SUShowReleaseNotes': True,
|
||||
'SUAllowsAutomaticUpdates': False,
|
||||
@ -153,18 +153,18 @@ setup(
|
||||
windows = [ {'dest_base': APPNAME,
|
||||
'script': APP,
|
||||
'icon_resources': [(0, '%s.ico' % APPNAME)],
|
||||
'product_name': APPNAME, # WinSparkle
|
||||
'company_name': 'EDCD', # WinSparkle
|
||||
'product_name': APP, # WinSparkle
|
||||
'version': VERSION,
|
||||
'copyright': u'© 2015-2019 Jonathan Harris',
|
||||
'company_name': 'Marginal', # WinSparkle
|
||||
'copyright': u'© 2015-2019 Jonathan Harris, 2020 EDCD',
|
||||
'other_resources': [(24, 1, open(APPNAME+'.manifest').read())],
|
||||
} ],
|
||||
console = [ {'dest_base': APPCMDNAME,
|
||||
'script': APPCMD,
|
||||
'company_name': 'EDCD',
|
||||
'product_name': APPNAME,
|
||||
'version': VERSION,
|
||||
'copyright': u'© 2015-2019 Jonathan Harris',
|
||||
'company_name': 'Marginal',
|
||||
'copyright': u'© 2015-2019 Jonathan Harris, 2020 EDCD',
|
||||
} ],
|
||||
data_files = DATA_FILES,
|
||||
options = OPTIONS,
|
||||
@ -230,7 +230,7 @@ appcast.write('''
|
||||
\t\t\t\t]]>
|
||||
\t\t\t</description>
|
||||
\t\t\t<enclosure
|
||||
\t\t\t\turl="https://github.com/Marginal/EDMarketConnector/releases/download/rel-{1}/{2}"
|
||||
\t\t\t\turl="https://github.com/EDCD/EDMarketConnector/releases/download/rel-{1}/{2}"
|
||||
\t\t\t\tsparkle:os="{3}"
|
||||
\t\t\t\tsparkle:version="{4}"
|
||||
\t\t\t\tlength="{5}"
|
||||
|
105
theme.py
105
theme.py
@ -15,6 +15,8 @@ from ttkHyperlinkLabel import HyperlinkLabel
|
||||
|
||||
from config import appname, applongname, config
|
||||
|
||||
if __debug__:
|
||||
from traceback import print_exc
|
||||
|
||||
if platform == 'win32':
|
||||
import ctypes
|
||||
@ -33,65 +35,66 @@ elif platform == 'linux':
|
||||
Atom = c_ulong
|
||||
Display = c_void_p # Opaque
|
||||
|
||||
# Sending ClientMessage to WM using XSendEvent()
|
||||
SubstructureNotifyMask = 1<<19
|
||||
SubstructureRedirectMask = 1<<20
|
||||
ClientMessage = 33
|
||||
PropModeReplace = 0
|
||||
PropModePrepend = 1
|
||||
PropModeAppend = 2
|
||||
|
||||
_NET_WM_STATE_REMOVE = 0
|
||||
_NET_WM_STATE_ADD = 1
|
||||
_NET_WM_STATE_TOGGLE = 2
|
||||
# From xprops.h
|
||||
MWM_HINTS_FUNCTIONS = 1 << 0
|
||||
MWM_HINTS_DECORATIONS = 1 << 1
|
||||
MWM_HINTS_INPUT_MODE = 1 << 2
|
||||
MWM_HINTS_STATUS = 1 << 3
|
||||
MWM_FUNC_ALL = 1 << 0
|
||||
MWM_FUNC_RESIZE = 1 << 1
|
||||
MWM_FUNC_MOVE = 1 << 2
|
||||
MWM_FUNC_MINIMIZE = 1 << 3
|
||||
MWM_FUNC_MAXIMIZE = 1 << 4
|
||||
MWM_FUNC_CLOSE = 1 << 5
|
||||
MWM_DECOR_ALL = 1 << 0
|
||||
MWM_DECOR_BORDER = 1 << 1
|
||||
MWM_DECOR_RESIZEH = 1 << 2
|
||||
MWM_DECOR_TITLE = 1 << 3
|
||||
MWM_DECOR_MENU = 1 << 4
|
||||
MWM_DECOR_MINIMIZE = 1 << 5
|
||||
MWM_DECOR_MAXIMIZE = 1 << 6
|
||||
|
||||
class XClientMessageEvent_data(Union):
|
||||
class MotifWmHints(Structure):
|
||||
_fields_ = [
|
||||
('b', c_char * 20),
|
||||
('s', c_short * 10),
|
||||
('l', c_long * 5),
|
||||
]
|
||||
|
||||
class XClientMessageEvent(Structure):
|
||||
_fields_ = [
|
||||
('type', c_int),
|
||||
('serial', c_ulong),
|
||||
('send_event', c_int),
|
||||
('display', POINTER(Display)),
|
||||
('window', Window),
|
||||
('message_type', Atom),
|
||||
('format', c_int),
|
||||
('data', XClientMessageEvent_data),
|
||||
]
|
||||
|
||||
class XEvent(Union):
|
||||
_fields_ = [
|
||||
('xclient', XClientMessageEvent),
|
||||
('flags', c_ulong),
|
||||
('functions', c_ulong),
|
||||
('decorations', c_ulong),
|
||||
('input_mode', c_long),
|
||||
('status', c_ulong),
|
||||
]
|
||||
|
||||
try:
|
||||
xlib = cdll.LoadLibrary('libX11.so.6')
|
||||
XInternAtom = xlib.XInternAtom
|
||||
XInternAtom.argtypes = [POINTER(Display), c_char_p, c_int]
|
||||
XInternAtom.restype = Atom
|
||||
XChangeProperty = xlib.XChangeProperty
|
||||
XChangeProperty.argtypes = [POINTER(Display), Window, Atom, Atom, c_int, c_int, POINTER(MotifWmHints), c_int]
|
||||
XChangeProperty.restype = c_int
|
||||
XFlush = xlib.XFlush
|
||||
XFlush.argtypes = [POINTER(Display)]
|
||||
XFlush.restype = c_int
|
||||
XInternAtom = xlib.XInternAtom
|
||||
XInternAtom.restype = Atom
|
||||
XInternAtom.argtypes = [POINTER(Display), c_char_p, c_int]
|
||||
XOpenDisplay = xlib.XOpenDisplay
|
||||
XOpenDisplay.argtypes = [c_char_p]
|
||||
XOpenDisplay.restype = POINTER(Display)
|
||||
XQueryTree = xlib.XQueryTree
|
||||
XQueryTree.argtypes = [POINTER(Display), Window, POINTER(Window), POINTER(Window), POINTER(Window), POINTER(c_uint)]
|
||||
XQueryTree.restype = c_int
|
||||
XSendEvent = xlib.XSendEvent
|
||||
XSendEvent.argtypes = [POINTER(Display), Window, c_int, c_long, POINTER(XEvent)]
|
||||
XSendEvent.restype = c_int
|
||||
|
||||
try:
|
||||
dpy = xlib.XOpenDisplay(None)
|
||||
XA_ATOM = Atom(4)
|
||||
net_wm_state = XInternAtom(dpy, '_NET_WM_STATE', False)
|
||||
net_wm_state_above = XInternAtom(dpy, '_NET_WM_STATE_ABOVE', False)
|
||||
net_wm_state_sticky = XInternAtom(dpy, '_NET_WM_STATE_STICKY', False)
|
||||
net_wm_state_skip_pager = XInternAtom(dpy, '_NET_WM_STATE_SKIP_PAGER', False)
|
||||
net_wm_state_skip_taskbar = XInternAtom(dpy, '_NET_WM_STATE_SKIP_TASKBAR', False)
|
||||
motif_wm_hints_property = XInternAtom(dpy, b'_MOTIF_WM_HINTS', False)
|
||||
motif_wm_hints_normal = MotifWmHints(MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS,
|
||||
MWM_FUNC_RESIZE | MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE | MWM_FUNC_CLOSE,
|
||||
MWM_DECOR_BORDER | MWM_DECOR_RESIZEH | MWM_DECOR_TITLE | MWM_DECOR_MENU | MWM_DECOR_MINIMIZE,
|
||||
0, 0)
|
||||
motif_wm_hints_dark = MotifWmHints(MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS,
|
||||
MWM_FUNC_RESIZE | MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE | MWM_FUNC_CLOSE,
|
||||
0, 0, 0)
|
||||
except:
|
||||
if __debug__: print_exc()
|
||||
dpy = None
|
||||
|
||||
|
||||
@ -356,25 +359,19 @@ class _Theme(object):
|
||||
|
||||
else:
|
||||
root.withdraw()
|
||||
# https://www.tcl-lang.org/man/tcl/TkCmd/wm.htm#M19
|
||||
# https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html#STACKINGORDER
|
||||
root.attributes('-type', theme and 'splash' or 'normal')
|
||||
root.update_idletasks() # Size gets recalculated here
|
||||
root.deiconify()
|
||||
root.wait_visibility() # need main window to be displayed before returning
|
||||
if dpy and theme:
|
||||
# Try to display in the taskbar
|
||||
if dpy:
|
||||
xroot = Window()
|
||||
parent = Window()
|
||||
children = Window()
|
||||
nchildren = c_uint()
|
||||
XQueryTree(dpy, root.winfo_id(), byref(xroot), byref(parent), byref(children), byref(nchildren))
|
||||
# https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html#idm140200472615568
|
||||
xevent = XEvent(xclient = XClientMessageEvent(ClientMessage, 0, 0, None, parent, net_wm_state, 32, XClientMessageEvent_data(l = (_NET_WM_STATE_REMOVE, net_wm_state_skip_pager, net_wm_state_skip_taskbar, 1, 0))))
|
||||
XSendEvent(dpy, xroot, False, SubstructureRedirectMask | SubstructureNotifyMask, byref(xevent))
|
||||
xevent = XEvent(xclient = XClientMessageEvent(ClientMessage, 0, 0, None, parent, net_wm_state, 32, XClientMessageEvent_data(l = (_NET_WM_STATE_REMOVE, net_wm_state_sticky, 0, 1, 0))))
|
||||
XSendEvent(dpy, xroot, False, SubstructureRedirectMask | SubstructureNotifyMask, byref(xevent))
|
||||
XChangeProperty(dpy, parent, motif_wm_hints_property, motif_wm_hints_property, 32, PropModeReplace, theme and motif_wm_hints_dark or motif_wm_hints_normal, 5)
|
||||
XFlush(dpy)
|
||||
else:
|
||||
root.overrideredirect(theme and 1 or 0)
|
||||
root.deiconify()
|
||||
root.wait_visibility() # need main window to be displayed before returning
|
||||
|
||||
if not self.minwidth:
|
||||
self.minwidth = root.winfo_width() # Minimum width = width on first creation
|
||||
|
11
update.py
11
update.py
@ -20,6 +20,9 @@ if not getattr(sys, 'frozen', False):
|
||||
def __init__(self, master):
|
||||
self.root = master
|
||||
|
||||
def setAutomaticUpdatesCheck(self, onoroff):
|
||||
return
|
||||
|
||||
def checkForUpdates(self):
|
||||
thread = threading.Thread(target = self.worker, name = 'update worker')
|
||||
thread.daemon = True
|
||||
@ -58,6 +61,10 @@ elif sys.platform=='darwin':
|
||||
print_exc()
|
||||
self.updater = None
|
||||
|
||||
def setAutomaticUpdatesCheck(self, onoroff):
|
||||
if self.updater:
|
||||
self.updater.win_sparkle_set_automatic_check_for_updates(onoroff)
|
||||
|
||||
def checkForUpdates(self):
|
||||
if self.updater:
|
||||
self.updater.checkForUpdates_(None)
|
||||
@ -98,6 +105,10 @@ elif sys.platform=='win32':
|
||||
print_exc()
|
||||
self.updater = None
|
||||
|
||||
def setAutomaticUpdatesCheck(self, onoroff):
|
||||
if self.updater:
|
||||
self.updater.win_sparkle_set_automatic_check_for_updates(onoroff)
|
||||
|
||||
def checkForUpdates(self):
|
||||
if self.updater:
|
||||
self.updater.win_sparkle_check_update_with_ui()
|
||||
|
Loading…
x
Reference in New Issue
Block a user