Commit Graph
26 Commits
Author SHA1 Message Date
Athanasius 5609b908fb ttkHyperlinkLabel: Remove un-used typing.Optional import 2022-12-23 14:47:34 +00:00
Athanasius e45a89d970 EDMarketConnector.py: Minor type fixes & ttkHyperlink.py too 2022-12-23 14:47:28 +00:00
Athanasius 115b5be3bf ttkHyperlinkLabel: Just use webbrowser.open(url) unconditionally
See the expanded docstring on the `openurl()` function.
2022-12-06 14:50:05 +00:00
Athanasius ab979ed043 ttkHyperlinkLabel: Use Any where it's appropriate in function signatures 2022-12-05 10:58:16 +00:00
Athanasius b57a8f99ae ttkHyperlinkLabel: Now passing flake8 & mypy
* `openurl()` - Don't pass `None` as second parameter to `QueryValueEx()`.
  Passing `''` was tested as still working.
2022-12-03 21:04:50 +00:00
Athanasius e280d6c283 ttkHyperlinklabel.py: Initial flake8 pass (and some mypy)
This fixes an apparently harmless bug in the `openurl()` function defined
in this module (it's not part of the class).

1. On `win32` lookup the user setting for opening HTTPS URLs.
2. If that doesn't look like IE or Edge...
3. Set `cls` to the value for that.
4. Now look up the 'use this command' for *that* ...
5. And if it doesn't have `iexplore` in it...
6. Use `subprocess.Popen()` to invoke that browser with the given URL.

The problem is that step 6 still tries to use `buf.value`.  But `buf` is
no longer present as it was from before 5989acd0d3
changed over to `winreg`.  It should be just `value` from the winreg
calls.

That exception is then caught and ignored, and it ends up just running
`webbrowser.open(url)` anyway.

To be honest, this feels like we should just make this an unconditional
call to `webbrowser.open(url)` now, given apparently no-one's complained
about it always actually using that not working for them.  Given Edge is
Chrome-based now, and any supported OS should have Edge, Chrome or Firefox
(OK, maybe Safari and some others) as the HTTPS browser, I don't see this
being an issue.
2022-12-03 18:21:16 +00:00
A_D bff6175ee7 Update to use sys.platform over platform 2022-01-26 18:51:49 +02:00
Athanasius 631446f619 Translations: Final LANG comments
The script now outputs nothing about Unknown comments
2021-06-07 16:02:39 +01:00
A_D e293f0f334 Removed star import 2021-04-01 14:45:50 +01:00
A_D 99014dd970 Added a config to use the new file based shipyard
This also reverts commenting out the old solution for long URLs
2020-07-23 14:36:02 +01:00
A_D b818922193 Fixed issues with super long links for shipyards
This works by creating a temp file at config.app_dir and storing the
link in there, followed by directing the local browser to open the file.

HTML meta tags are then used to direct the browser to refresh to a URL
of our choosing (which is HTML escaped, just in case someone tries
something clever)

This should work everywhere, and on any browser (as the file:// format
is defined at https://tools.ietf.org/html/rfc1738 which was posted in
1994).

The URI used (`file://localhost/path`) ensures that we only ever
ask for a localhost file at our path.

The HTML format should be completely compliant with all major browsers
as well, ensuring that behaviour is consistent (assuming they support
HTML meta tags)
2020-07-23 14:36:02 +01:00
Athanasius 71bb14a737 Document allowed imports for PLUGINS
* List added in 'Available imports' section of PLUGINS.md
* Various *.py files now have comments about things being allowed for
 plugin import.
2020-07-12 19:25:47 +01:00
Jonathan Harris 5989acd0d3 Switch to built-in winreg module on Windows 2019-09-30 03:07:38 +01:00
Athanasius 14d6d353a8 Fixes registry browser lookup, and confirms EDDB system/station lookups work 2019-09-26 11:40:42 +01:00
Athanasius 218c068ee5 Running EDMarketConnector.py 'works'.
First pass utilising 'futurize' to do most of the work.

  There's an issue with ur'\"' in l10n.py which I'm not sure how to
properly fix.

  This now has errors when hitting the 'Update' button.
2019-09-26 11:40:38 +01:00
Jonathan Harris 274867ca67 url parameter no longer mandatory for HyperlinkLabel 2017-07-29 15:36:44 +01:00
Jonathan Harris b794e19d75 Automatically highlight widgets that set a custom cursor 2017-07-29 14:41:59 +01:00
Jonathan Harris d5e8ee3710 Fix for configuring widget-specific state 2017-05-03 13:09:17 +01:00
Jonathan Harris cf98234f9a Maintain custom colours when changing state 2017-04-12 01:44:08 +01:00
Jonathan Harris d1cdc89ecd Work around Windows limit on ShellExecute arg len 2016-11-20 01:00:17 +00:00
Jonathan Harris 33f322e1ae Allow changing of url after creation 2016-11-17 17:29:15 -08:00
Jonathan Harris 740627f043 Fix underline font init syntax 2016-07-26 23:31:48 +01:00
Jonathan Harris e7a727acde Fix main window system & station alignment on OSX.
Broken by 84a66c5.
2016-01-03 22:59:43 +00:00
Jonathan Harris 84a66c5285 Split settings into tabbed notebook.
Fixes #53.
2016-01-02 01:59:16 +00:00
Jonathan Harris a4e38f7c63 Remove label underline before opening URL in browser window. 2015-11-08 15:19:23 +00:00
Jonathan Harris a74a928764 Split out ttk HyperlinkLabel widget into a separate file and generalise. 2015-10-13 23:10:21 +01:00