1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-21 11:27:38 +03:00

Merge branch 'stable' into releases

This commit is contained in:
David Sangrey 2023-08-03 19:10:07 -04:00
commit 31cea2f762
No known key found for this signature in database
GPG Key ID: 3AEADBB0186884BC
9 changed files with 108 additions and 22 deletions

@ -1,11 +1,10 @@
---
name: Submodule Updates
on:
push:
branches: [ develop ]
# schedule:
# - cron: '0 12 * * *'
branches: [develop]
schedule:
- cron: '0 12 * * *'
jobs:
check_submodules:
@ -44,25 +43,44 @@ jobs:
echo 'changes=false' >> $GITHUB_OUTPUT
fi
exit 0
- name: Create submodules changes branch
- name: Create or Update submodules changes branch
if: steps.check_for_changes.outputs.changes == 'true'
run: |
git checkout -b "submodule-change/$GITHUB_RUN_ID" $CHECKOUT_BRANCH
git fetch origin "submodule-change/$GITHUB_RUN_ID" || git checkout -b "submodule-change/$GITHUB_RUN_ID" $CHECKOUT_BRANCH
git commit -am "updating submodules"
git push --set-upstream origin "submodule-change/$GITHUB_RUN_ID"
- name: Create pull request against target branch
- name: Create or Update pull request against target branch
if: steps.check_for_changes.outputs.changes == 'true'
uses: actions/github-script@v6
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
await github.rest.pulls.create({
const { data: pulls } = await github.rest.pulls.list({
owner: '${{ github.repository_owner }}',
repo: '${{ github.repository }}'.split('/')[1].trim(),
head: 'submodule-change/${{ github.run_id }}',
base: '${{ env.PR_AGAINST_BRANCH }}',
title: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`,
body: '${{ steps.check_for_changes.outputs.changes_text }}',
state: 'open',
});
if (pulls.length > 0) {
// If an open pull request exists, update it
const pull_number = pulls[0].number;
await github.rest.pulls.update({
owner: '${{ github.repository_owner }}',
repo: '${{ github.repository }}'.split('/')[1].trim(),
pull_number,
body: '${{ steps.check_for_changes.outputs.changes_text }}',
});
} else {
// If no open pull request exists, create a new one
await github.rest.pulls.create({
owner: '${{ github.repository_owner }}',
repo: '${{ github.repository }}'.split('/')[1].trim(),
head: 'submodule-change/${{ github.run_id }}',
base: '${{ env.PR_AGAINST_BRANCH }}',
title: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`,
body: '${{ steps.check_for_changes.outputs.changes_text }}',
});
}

@ -33,6 +33,20 @@ produce the Windows executables and installer.
currently used version in a given branch.
---
Release 5.9.2
===
This release fixes a critical issue on clean installs which would not update the
Windows registry to allow for protocol handling. All users are **strongly** encouraged to update.
- Fixes a critical bug with the installer on new installs not creating registry keys (#2046)
- Re-enables automatic submodule updates (#1443)
- Help -> About Version String can now be copied to clipboard (#1936)
- EDSM Task Manager Printout now is less useless (#2045)
- Deprecated load_module() is now retired (#1462)
- API Keys are masked in Settings (#2047)
- Installer will now refuse to install on Win7 and Earlier (#1122)
Release 5.9.1
===
This release updates the build system in use for EDMC to a more feature-rich installer, as well

@ -427,7 +427,7 @@ import tkinter as tk
import tkinter.filedialog
import tkinter.font
import tkinter.messagebox
from tkinter import ttk
from tkinter import ttk, constants as tkc
import commodity
import plug
@ -1844,7 +1844,11 @@ class AppWindow(object):
# version <link to changelog>
tk.Label(frame).grid(row=row, column=0) # spacer
row += 1
self.appversion_label = tk.Label(frame, text=appversion())
self.appversion_label = tk.Text(frame, height=1, width=len(str(appversion())), wrap=tkc.NONE, bd=0)
self.appversion_label.insert("1.0", str(appversion()))
self.appversion_label.tag_configure("center", justify="center")
self.appversion_label.tag_add("center", "1.0", "end")
self.appversion_label.config(state=tkc.DISABLED, bg=frame.cget("background"), font="TkDefaultFont")
self.appversion_label.grid(row=row, column=0, sticky=tk.E)
# LANG: Help > Release Notes
self.appversion = HyperlinkLabel(frame, compound=tk.RIGHT, text=_('Release Notes'),

@ -143,7 +143,8 @@ def build() -> None:
)
version_info: dict = {
"description": "Downloads commodity market and other station data from the game"
"description": "Elite Dangerous Market Connector (EDMC)",
"comments": "Downloads commodity market and other station data from the game"
" Elite Dangerous for use with all popular online and offline trading tools.",
"company_name": "EDCD", # Used by WinSparkle
"product_name": appname, # Used by WinSparkle

@ -52,7 +52,7 @@ appcmdname = 'EDMC'
# <https://semver.org/#semantic-versioning-specification-semver>
# Major.Minor.Patch(-prerelease)(+buildmetadata)
# NB: Do *not* import this, use the functions appversion() and appversion_nobuild()
_static_appversion = '5.9.1'
_static_appversion = '5.9.2'
_cached_version: Optional[semantic_version.Version] = None
copyright = '© 2015-2019 Jonathan Harris, 2020-2023 EDCD'

@ -58,11 +58,10 @@ class Plugin(object):
try:
filename = 'plugin_'
filename += name.encode(encoding='ascii', errors='replace').decode('utf-8').replace('.', '_')
module = importlib.machinery.SourceFileLoader(
filename,
loadfile
).load_module()
spec = importlib.util.spec_from_file_location(filename, loadfile) # type: ignore
module = importlib.util.module_from_spec(spec) # type: ignore
spec.loader.exec_module(module) # type: ignore
# These type-ignores will need to be looked at. MyPy is wrong.
if getattr(module, 'plugin_start3', None):
newname = module.plugin_start3(os.path.dirname(loadfile))
self.name = newname and str(newname) or name

@ -125,6 +125,7 @@ class This:
this = This()
show_password_var = tk.BooleanVar()
STATION_UNDOCKED: str = '×' # "Station" name to display when not docked = U+00D7
__cleanup = str.maketrans({' ': None, '\n': None})
@ -275,6 +276,14 @@ def plugin_stop() -> None:
logger.debug('Done.')
def toggle_password_visibility():
"""Toggle if the API Key is visible or not."""
if show_password_var.get():
this.apikey.config(show="") # type: ignore
else:
this.apikey.config(show="*") # type: ignore
def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> tk.Frame:
"""
Plugin preferences setup hook.
@ -346,11 +355,20 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> tk.Fr
# LANG: EDSM API key label
this.apikey_label = nb.Label(frame, text=_('API Key')) # EDSM setting
this.apikey_label.grid(row=cur_row, padx=PADX, sticky=tk.W)
this.apikey = nb.Entry(frame)
this.apikey = nb.Entry(frame, show="*", width=50)
this.apikey.grid(row=cur_row, column=1, padx=PADX, pady=PADY, sticky=tk.EW)
prefs_cmdr_changed(cmdr, is_beta)
show_password_var.set(False) # Password is initially masked
show_password_checkbox = nb.Checkbutton(
frame,
text="Show API Key",
variable=show_password_var,
command=toggle_password_visibility,
)
show_password_checkbox.grid(columnspan=2, padx=BUTTONX, pady=(5, 0), sticky=tk.W)
return frame

@ -152,6 +152,8 @@ class This:
this = This()
show_password_var = tk.BooleanVar()
# last time we updated, if unset in config this is 0, which means an instant update
LAST_UPDATE_CONF_KEY = 'inara_last_update'
EVENT_COLLECT_TIME = 31 # Minimum time to take collecting events before requesting a send
@ -242,6 +244,14 @@ def plugin_stop() -> None:
logger.debug('Done.')
def toggle_password_visibility():
"""Toggle if the API Key is visible or not."""
if show_password_var.get():
this.apikey.config(show="")
else:
this.apikey.config(show="*")
def plugin_prefs(parent: ttk.Notebook, cmdr: str, is_beta: bool) -> tk.Frame:
"""Plugin Preferences UI hook."""
x_padding = 10
@ -281,11 +291,20 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str, is_beta: bool) -> tk.Frame:
# LANG: Inara API key label
this.apikey_label = nb.Label(frame, text=_('API Key')) # Inara setting
this.apikey_label.grid(row=12, padx=x_padding, sticky=tk.W)
this.apikey = nb.Entry(frame)
this.apikey = nb.Entry(frame, show="*", width=50)
this.apikey.grid(row=12, column=1, padx=x_padding, pady=y_padding, sticky=tk.EW)
prefs_cmdr_changed(cmdr, is_beta)
show_password_var.set(False) # Password is initially masked
show_password_checkbox = nb.Checkbutton(
frame,
text="Show API Key",
variable=show_password_var,
command=toggle_password_visibility,
)
show_password_checkbox.grid(columnspan=2, padx=x_padding, pady=(5, 0), sticky=tk.W)
return frame

@ -31,6 +31,7 @@ OutputDir=.
LicenseFile=LICENSE
AlwaysShowDirOnReadyPage=yes
UninstallDisplayIcon={app}\{#MyAppExeName}
MinVersion=6.2
[Languages]
@ -65,3 +66,15 @@ begin
end;
end;
end;
[Registry]
; Create the registry key for the custom file type
Root: HKCR; Subkey: "edmc"; Flags: uninsdeletekey
; Create the registry values for the custom file type
Root: HKCR; Subkey: "edmc"; ValueType: string; ValueName: ""; ValueData: "{#MyAppName}"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "edmc\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "edmc\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""; Flags: uninsdeletevalue
; Register the URL protocol handler
Root: HKCR; Subkey: "edmc"; ValueType: string; ValueName: "URL Protocol"; ValueData: ""; Flags: uninsdeletevalue