Skip to content

Commit

Permalink
Merge branch 'EDCD:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Rixxan authored Jun 11, 2024
2 parents 0ab2de3 + 5d43388 commit a0d5dbb
Show file tree
Hide file tree
Showing 85 changed files with 2,856 additions and 3,013 deletions.
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ exclude =
FDevIDs/
venv/
.venv/
hotkey/darwin.py # FIXME: Check under macOS VM at some point

# Show exactly where in a line the error happened
#show-source = True
Expand Down
35 changes: 23 additions & 12 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@ assignees: ''

---

**Please check the [Known Issues](https://github.com/EDCD/EDMarketConnector/issues/618) in case this has already been reported.**

**Please also check if the issue is covered in our [Troubleshooting Guide](https://github.com/EDCD/EDMarketConnector/wiki/Troubleshooting).** It might be something with a known work around, or where a third party (such as EDSM) is causing logging that is harmless.

**Please complete the following information:**
- Version: [e.g. 4.0.6 - See 'Help > About E:D Market Connector'. If running from source using git then please paste the output of `git log --decorate=full | head -1`]

[//]: # (You can gather most of this information with the EDMC System Profiler)

- Version: [e.g. 5.10.4+39af6c34`]
- Game Version: [e.g. 'Live' or 'Odyssey']
- OS: [e.g. Windows 10, Linux Debian 10.6, etc.]
- OS Locale: [e.g. English, French, Serbian...]
- If applicable: Browser [e.g. chrome, safari]
- Please attach **BOTH** log files, by dragging and dropping them into this input:
1. `%TEMP%\EDMarketConnector.log` from *immediately* after the bug occurs (re-running the application overwrites this file).
1. `%TEMP%\EDMarketConnector\EDMarketConnector-debug.log`. See [Debug Log File](https://github.com/EDCD/EDMarketConnector/wiki/Troubleshooting#debug-log-files). NB: If you don't have this log file then you're not running the latest version of the application and should update first to see if we already fixed the bug you're reporting.

**Describe the bug**
A clear and concise description of what the bug is.

[//]: # (A clear and concise description of what the bug is.)

**To Reproduce**
Steps to reproduce the behavior:
Expand All @@ -32,10 +29,24 @@ Steps to reproduce the behavior:
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

[//]: # (A clear and concise description of what you expected to happen.)

**Screenshots**
If applicable, add screenshots to help explain your problem.

[//]: # (If applicable, add screenshots to help explain your problem.)

**Additional context**
Add any other context about the problem here.

**Please Confirm the Following...**

[//]: # (Add any other context about the problem here.)
- [ ] I have checked the [Known Issues](https://github.com/EDCD/EDMarketConnector/issues/618) list to ensure this is not a duplicate
- [ ] I have checked the [Troubleshooting Guide](https://github.com/EDCD/EDMarketConnector/wiki/Troubleshooting) to check for known workarounds

**Logs**
Please attach both the EDMarketConnector.log and EDMarketConnector-debug.log if available.

You can find these logs at `%TEMP%\EDMarketConnector.log` and `%TEMP%\EDMarketConnector\EDMarketConnector-debug.log`

See [Debug Log File](https://github.com/EDCD/EDMarketConnector/wiki/Troubleshooting#debug-log-files) for information on the Debug Log files
3 changes: 2 additions & 1 deletion .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
code-checks:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

steps:

Expand Down Expand Up @@ -56,6 +56,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version-file: '.python-version'
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/push-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
jobs:
push_checks:

runs-on: ubuntu-22.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -28,6 +28,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
cache: 'pip' # caching pip dependencies
python-version-file: '.python-version'
- name: Install dependencies
run: |
Expand Down Expand Up @@ -68,3 +69,7 @@ jobs:
- name: mypy type checks
run: |
./scripts/mypy-all.sh --platform win32
- name: translation checks
run: |
python ./scripts/find_localised_strings.py --compare-lang L10n/en.template --directory . --ignore coriolis-data
26 changes: 18 additions & 8 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ jobs:
mv ../EDMarketConnector-release-${{ needs.variables.outputs.sem_ver }}.tar.gz .
- name: Upload build files
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Built files
name: built-files-linux
path: |
EDMarketConnector-release-*.tar.gz
windows_build:
needs: [variables]
name: Build EDMC
runs-on: windows-2019
runs-on: windows-latest

defaults:
run:
Expand Down Expand Up @@ -105,6 +105,7 @@ jobs:
with:
python-version-file: '.python-version'
architecture: "x86"
cache: 'pip' # caching pip dependencies

- name: Install python tools
run: |
Expand All @@ -131,22 +132,31 @@ jobs:
Get-ChildItem -Path . -Filter "EDMarketConnector_Installer_*.exe" | Rename-Item -NewName {"EDMarketConnector_Installer_Unsigned_$($_.Name -replace '^EDMarketConnector_Installer_', '')"}
- name: Upload build files
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Built files
name: built-files-windows
path: |
EDMarketConnector_Installer_*.exe
EDMarketConnector-release-*.zip
Merge:
runs-on: ubuntu-latest
needs: [ windows_build, linux_build ]
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: Built files
pattern: built-files-*

release:
name: Release new version
runs-on: ubuntu-latest
needs: [ windows_build, linux_build ]
needs: Merge
if: "${{ github.event_name != 'workflow_dispatch' }}"

steps:
- name: Download binary
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Built files
path: ./
Expand All @@ -155,7 +165,7 @@ jobs:
run: sha256sum EDMarketConnector_Installer_*.exe EDMarketConnector-release-*.{zip,tar.gz} > ./hashes.sum

- name: Create Draft Release
uses: "softprops/action-gh-release@v1"
uses: "softprops/action-gh-release@v2"
with:
token: "${{secrets.GITHUB_TOKEN}}"
draft: true
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ pylint.txt

# Ignore Submodule data directory
coriolis-data/
FDevIDs/
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "coriolis-data"]
path = coriolis-data
url = https://github.com/EDCD/coriolis-data.git
[submodule "FDevIDs"]
path = FDevIDs
url = https://github.com/EDCD/FDevIDs.git
1 change: 0 additions & 1 deletion .mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ scripts_are_modules = True
; `<var> = <value>`
; i.e. no typing info.
check_untyped_defs = True
; platform = darwin
explicit_package_bases = True
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.7
3.11.9
96 changes: 94 additions & 2 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,98 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are
in the source (not distributed with the Windows installer) for the
currently used version.
---
Release 5.11.1
===

This release fixes a bug regarding FDevID files when running from Source in a non-writable location. Additionally,
Deprecation Warnings are now more visible to aid in plugin development.

**Changes and Enhancements**
* Added a check on Git Pushes to check for updated translation strings for developers
* Enabled deprecation warnings to pass to plugins and logs
* Updated Dependencies
* Replaced infi.systray with drop-in replacement simplesystray

**Bug Fixes**
* Fixed a bug that could result in the program not updating or writing FDevID files when running from source in a location where the running user can't write to

**Plugin Developers**
* nb.Entry is deprecated, and is slated for removal in 6.0 or later. Please migrate to nb.EntryMenu
* nb.ColoredButton is deprecated, and is slated for removal in 6.0 or later. Please migrate to tk.Button
* Calling internal translations with `_()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to importing `translations` and calling `translations.translate` or `translations.tl` directly
* `Translations` as the translate system singleton is deprecated, and is slated for removal in 6.0 or later. Please migrate to the `translations` singleton
* `help_open_log_folder()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to open_folder()
* `update_feed` is deprecated, and is slated for removal in 6.0 or later. Please migrate to `get_update_feed()`.
* FDevID files (`commodity.csv` and `rare_commodity.csv`) have moved their preferred location to the app dir (same location as default Plugins folder). Please migrate to use `config.app_dir_path`.


Release 5.11.0
===

This release includes a number of new features and improvements, including a new Beta Update Track for testing future updates, enhanced context menus for text entry fields and UI elements, a revamp to the existing translation system and logging capabilities, and more. This release includes the Python Image Library (PIL) into our core bundle, adds a number of stability and configuration checks to the tool, and adds new schemas and configuration values to senders.

This release also includes a number of bug fixes, performance enhancements, and updates to various aspects of the code to enhance maintainability are included. Notably, MacOS support has been removed due to a lack of support for this OS in Elite, and a number of functions have been deprecated and will be removed in later versions. Plugin developers, take note!

**Changes and Enhancements**
* Established a Beta Update Track to allow users to assist in future update testing
* Added a global context menu for text entry fields that includes cut, copy, and paste options
* Added a context menu for Ship, System, and Station UI elements which allows opening the respective link in any of the available resource providers.
* Added translation hooks to the update available status string
* Added additional status logging when we're awaiting game log-in
* Added the Python Image Library (PIL) to the core EDMC library bundle
* Added respect for EDSM API limits to the default plugin
* Added EDDN stationType and carrierDockingAccess schemas to the sent events
* Added MaxJumpRange and CargoCapacity events to the Inara sender
* Added a high-level critical error handler to gracefully terminate the program in the event of a catastrophic error
* Added the ability to override the default language for a translation by adding the optional 'lang' parameter to the translate function for individual functions
* Added an updated template and new security reporting guidance to the documentation
* Added a new updater for the FDevID Files to keep the dependency up to date without requiring a new patch version push
* Added a System Profiler Utility to assist with gathering system and environment information for bug report purposes
* Added a new security policy for responsible disclosure of identified security issues
* Adds Additional Error Processing to the System Profiler when launched from EDMC
* Adds the ability to resize the Settings window to larger than the initial default size
* Enabled security code scanning on the GitHub repository
* Tweaked a few list length checks that could just be boolean to be bool
* Updates the look and feel of the "Already Running" popup to reduce overhead and improve the look of the popup
* Updated translations to latest versions, including a new language: Ukranian!
* Updated documentation to reflect certain changes to the code
* Updated the GitHub Bug Report template
* Updated the GitHub Pull Request template
* Updated internal workflows to more recent versions
* Updated util_ships to avoid using Windows reserved file names as output
* Converted all usages of the unnecessary OrderedDict to use the standard dict
* Clarifies the hierarchy of parent classes for custom MyNotebook classes
* Renamed the default translation function from `_()` to `tr.tl()`
* Renamed the Translations base class to conform to Pythonic standards
* Deprecated the `_Translations` class
* Deprecated the `Translations` singleton in favor of `translations`
* Unpinned several dependencies that were already dependencies of other dependencies to prevent dependency conflicts (say that 5 times fast)
* Updated a few type hints to allow updates to more updated dependencies
* Changed the translation function import to no longer rely on forcing it into Python's builtins
* Handed over a few tk classes to their ttk equivalents for better styling
* Reworked the Plugin system to no longer use the deprecated importlib.load_module()
* Deprecated nb.Entry and nb.ColoredButton as they simply point toward other classes with no processing
* Removed macOS support
* Removed deprecated modules.p and ships.p files
* Removed deprecated openurl() function

**Bug Fixes**
* Fixed a bug where certain types of exceptions from the Requests module wouldn't be handled properly regarding killswitches
* Fixed a rare bug where source builds running on 64-bit Python could generate an OverflowError in the monitor system
* Fixed a bug where EDMC would open directories in the webbrowser instead of the file explorer on Linux
* Fixed a rare bug that could cause the EDSM plugin to crash due to missing configuration values

**Plugin Developers**
* nb.Entry is deprecated, and is slated for removal in 6.0 or later. Please migrate to nb.EntryMenu
* nb.ColoredButton is deprecated, and is slated for removal in 6.0 or later. Please migrate to tk.Button
* Calling internal translations with `_()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to importing `translations` and calling `translations.translate` or `translations.tl` directly
* `Translations` as the translate system singleton is deprecated, and is slated for removal in 6.0 or later. Please migrate to the `translations` singleton
* `help_open_log_folder()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to open_folder()
* `update_feed` is deprecated, and is slated for removal in 6.0 or later. Please migrate to `get_update_feed()`.
* modules.p and ships.p are deprecated, and have been removed
* The `openurl()` function in ttkHyperlinkLabel has been removed. Please migrate to `webbrowser.open()`


Release 5.10.6
===
This release contains the data information for the new SCO modules added in Elite update 18.04.
Expand Down Expand Up @@ -175,7 +267,7 @@ for removal in the next major release! Please look for that change coming soon.

**Changes and Enhancements**
* Added new `modules.json` and `ships.json` files to improve security and readability
* Added a core Spanch URL provider plugin
* Added a core Spansh URL provider plugin
* Added a new auth response page for successful FDEV authentication
* Added a new Open Log Folder option to the Help menu
* Added a new `--start_min` command flag to force the application to start minimized
Expand Down Expand Up @@ -241,7 +333,7 @@ Known Issues

Release 5.9.3
===
This release is identical to 5.9.3, except reverts a bad change.
This release is identical to 5.9.2, except reverts a bad change.

- REVERTS Deprecated load_module() is now retired (#1462)

Expand Down
2 changes: 1 addition & 1 deletion Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ the following does not work:

```py
from sys import platform
if platform == 'darwin':
if platform == 'win32':
...
```

Expand Down
16 changes: 11 additions & 5 deletions EDMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
import commodity
import companion
import edshipyard
import l10n
from l10n import translations as tr
import loadout
import outfitting
import shipyard
import stats
from commodity import COMMODITY_DEFAULT
from config import appcmdname, appversion, config
from monitor import monitor
from update import EDMCVersion, Updater
from update import EDMCVersion, Updater, check_for_fdev_updates

sys.path.append(config.internal_plugin_dir)
# This import must be after the sys.path.append.
Expand All @@ -65,7 +65,7 @@ def log_locale(prefix: str) -> None:
)


l10n.Translations.install_dummy()
tr.install_dummy()

SERVER_RETRY = 5 # retry pause for Companion servers [s]
EXIT_SUCCESS, EXIT_SERVER, EXIT_CREDENTIALS, EXIT_VERIFICATION, EXIT_LAGGING, EXIT_SYS_ERR, EXIT_ARGS, \
Expand Down Expand Up @@ -162,7 +162,9 @@ def main(): # noqa: C901, CCR001
updater = Updater()
newversion: EDMCVersion | None = updater.check_appcast()
if newversion:
print(f'{appversion()} ({newversion.title!r} is available)')
# LANG: Update Available Text
newverstr: str = tr.tl("{NEWVER} is available").format(NEWVER=newversion.title)
print(f'{appversion()} ({newverstr})')
else:
print(appversion())
return
Expand Down Expand Up @@ -495,6 +497,10 @@ def main(): # noqa: C901, CCR001


if __name__ == '__main__':
main()
try:
check_for_fdev_updates(silent=True)
main()
except KeyboardInterrupt:
logger.info("Ctrl+C Detected, Attempting Clean Shutdown")
logger.debug('Exiting')
sys.exit(EXIT_SUCCESS)
3 changes: 3 additions & 0 deletions EDMCLogging.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import os
import pathlib
import tempfile
import warnings
from contextlib import suppress
from fnmatch import fnmatch
# So that any warning about accessing a protected member is only in one place.
Expand Down Expand Up @@ -99,6 +100,8 @@
# MAGIC-CONT: See MAGIC tagged comment in Logger.__init__()
logging.Formatter.converter = gmtime

warnings.simplefilter('default', DeprecationWarning)


def _trace_if(self: logging.Logger, condition: str, message: str, *args, **kwargs) -> None:
if any(fnmatch(condition, p) for p in config_mod.trace_on):
Expand Down
Loading

0 comments on commit a0d5dbb

Please sign in to comment.