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

5.9.2 Collective Roundup - Frontier Auth Registry Keys #2049

Merged
merged 11 commits into from
Aug 3, 2023
40 changes: 29 additions & 11 deletions .github/workflows/submodule-update.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
name: Submodule Updates

on:
push:
branches: [ develop ]
# schedule:
# - cron: '0 12 * * *'
branches: [develop]
schedule:
- cron: '0 12 * * *'

jobs:
check_submodules:
Expand Down Expand Up @@ -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 }}',
});
}
15 changes: 15 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ produce the Windows executables and installer.
currently used version in a given branch.

---
Release 5.9.1
===
This release updates the build system in use for EDMC to a more feature-rich installer, as well
as updating the commodity information to be up-to-date for Update 16.

NOTE: This version hands over the installer to an EXE file for Windows instead of an MSI.
This does not change any functionality or plugin capability of EDMC. You **_may_** need to
manually close EDMC during the update process if updating from version 5.9.0 or earlier.

* Removed the old WiX Build System
* Handed over the Build system to Inno Setup
* Broke apart the Build and Installer scripts for ease of development
* Updated FDevIDs to latest version
* Updated coriolis-data to latest version
* Updated some internal documentation.

Release 5.9.0
===
Expand Down
8 changes: 6 additions & 2 deletions EDMarketConnector.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def _(x: str) -> str:
import tkinter.filedialog
import tkinter.font
import tkinter.messagebox
from tkinter import ttk
from tkinter import ttk, constants as tkc

import commodity
import plug
Expand Down Expand Up @@ -1844,7 +1844,11 @@ def __init__(self, parent: tk.Tk):
# 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'),
Expand Down
3 changes: 2 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# <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-alpha0'
_static_appversion = '5.9.2'
_cached_version: Optional[semantic_version.Version] = None
copyright = '© 2015-2019 Jonathan Harris, 2020-2023 EDCD'

Expand Down
9 changes: 4 additions & 5 deletions plug.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ def __init__(self, name: str, loadfile: Optional[str], plugin_logger: Optional[l
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
Expand Down
20 changes: 19 additions & 1 deletion plugins/edsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def __init__(self):


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})
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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


Expand Down
21 changes: 20 additions & 1 deletion plugins/inara.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ def filter_events(self, key: Credentials, predicate: Callable[[Event], bool]) ->


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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down
13 changes: 13 additions & 0 deletions resources/EDMC_Installer_Config_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ OutputDir=.
LicenseFile=LICENSE
AlwaysShowDirOnReadyPage=yes
UninstallDisplayIcon={app}\{#MyAppExeName}
MinVersion=6.2


[Languages]
Expand Down Expand Up @@ -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