Commit Graph
74 Commits
Author SHA1 Message Date
David Sangrey 7d2618b0c4 Fix Memory Leak in Windows, Use Threaded HTTP server for linux 2026-06-01 19:01:22 -04:00
David Sangrey f0f26fb275 Revert Context Manager Run 2026-01-04 21:10:15 -05:00
David Sangrey beb68efae8 [2568] Fix Ships JSON Typo 2025-12-25 01:36:24 -05:00
David Sangrey 2041b3d3d3 [Minor] Update Type Hints and Alias Usages 2025-12-01 22:04:28 -05:00
David Sangrey 26db3ad099 [2113] Initiate ProtocolHandler, refactor WndProc for x64 2025-11-09 13:37:14 -05:00
David Sangrey 0a4fe05594 Merge pull request #2416 from HullSeals/enhancement/1805/more-pywin32-handoffs
[#1805/#2389] Fix Hotkey and Reduce Ctypes
2025-04-29 22:51:41 -04:00
David Sangrey 65273742d0 [#1775] Retire Usage of Assert
Removes assert statements from EDMC non-test code, paving the way to enable -OO code.
2025-04-27 21:58:01 -04:00
David Sangrey 272a0c6cb3 [1805] Update Some Protocol.py ctypes 2025-04-27 12:40:12 -04:00
David Sangrey 20b39e3afc [1805] Remove windll call 2025-04-27 11:20:37 -04:00
David Sangrey dab510bb21 [PRE-RELEASE] .12.1-rc4 2024-10-01 18:23:06 -04:00
David Sangrey ab02f49aba [#2303] Revert Prototyping for Protocol 2024-10-01 17:55:54 -04:00
David Sangrey 625856c31c [1805] Apply More Pywin32 2024-06-11 11:36:43 -04:00
David Sangrey 571558daff [1805] Additional Handover 2024-06-11 11:06:58 -04:00
David Sangrey c14bd826d0 [Minor] Additional Visual Padding Fixes 2024-04-06 16:52:45 -04:00
David Sangrey fbdc441390 [Minor] Return Visual Padding
Just makes it nicer to read.
2024-04-05 17:28:08 -04:00
David Sangrey b5a4ee6ed2 [Nit] Cleanup some Flake8 2024-03-28 10:49:01 -04:00
David Sangrey 57cd75e75e [2186] Additional Files 2024-03-27 19:39:51 -04:00
David Sangrey 4dd83f5fa4 [2051] And a few more, with timezones 2023-11-17 19:44:36 -05:00
Athanasius 7e6f3251bb Merge pull request #1703 from EDCD/enhancement/64-bit
Make runnable under 64-bit Python
2022-12-30 16:57:29 +00:00
Athanasius 08d28c6f3d protocol: Properly prototype GetMessageW & comment about 'exception'
* In trying to fix the return type 'exception' I first decided to properly
  prototype GetMessageW().
* But it turns out that you just can't get rid of that exception, so I just
  added a comment about it being harmless, because the functionality works
  as intended anyway.
2022-12-23 16:41:07 +00:00
A_D a930f5b902 protocol.py: Make mypy happy
This adds an assert that mypy will understand, and a type ignore because
it seems to ignore those asserts in imports
2022-12-23 18:25:14 +02:00
Athanasius f141fccd86 protocol.py: Change definition of DefWindowProcW to work on 64-bit
Given this is the form of definition in the official Python docs I'm
wondering if this only ever worked on 32-bit by accident.

So, it was nothing to do with the type needing to be changed for 64-bit.
The error:

    ctypes.ArgumentError: argument 4: <class 'OverflowError'>: int too long to convert

was a red herring in those terms.
2022-12-23 15:44:34 +00:00
Athanasius 0d2505ea48 protocol.py: mypy pass
* 'type: ignore' some ctypes operations on variables.
* Use `c_long(<value>)` on some returns.  The ctypes types do work that way
  as constructors.
* Fix the BAseHTTPHandler.log_request() types to match superclass.
2022-12-03 15:13:59 +00:00
Athanasius bb2bf53647 protocol.py: flake8 pass
This is flake8 objecting to the "initialised later" `protocolhandler`.
2022-12-03 14:51:54 +00:00
A_D 5b68aad184 Remove protocol.protocolhandler singleton auto-init
In general, doing things like this on import is bad, but this was
changed specifically to remove a bug that causes
--force-localserver-auth to do nothing.

That is caused because while we were careful not to import protocol
until after we were done doing arg things, we did not check to make sure
something else didn't. Companion imports protocol, which thus always
instantiates WindowsProtocolHandler before we can modify some config
state to indicate that we want LinuxProtocolHandler.
2021-09-24 16:39:30 +02:00
Athanasius 305f8ca6b0 protocol.py: Use logger.trace_if(...) 2021-08-13 15:14:02 +01:00
Athanasius 9c95a11b8f protocol.py: Fix minor typo in logging 2021-06-19 14:04:43 +01:00
Athanasius cf1655894b protocol: Pay attention to config.auth_force_edmc_protocol 2021-04-12 16:32:58 +01:00
Athanasius efc3c9030d protocol.py: Silence web server INFO if running without UI
Testing the outfitting.py changes brought this to light.  I know, e.g.
TCE that uses EDMC.exe likes to have no extraneous output.
2021-04-12 08:31:48 +01:00
Athanasius bc6557dd9c Quieten various TRACE log output.
* A lot of this is commented out.  It might be useful in the future, but
  is just too noisy for now.
* Changed the protocol webserver to info, as it is.
* Left the EDSM 'not 1XX, 2XX or 5XX' in as it's a warning, so 'pass's
  on the conditional bodies that would be empty now trace's are
  commented.
2021-04-12 08:31:47 +01:00
Athanasius 740da49ce1 Add similar extra logging for localhost handler
* This also adjusts the logging in Session.auth_callback() because it
  can be called from either protocol.  Saying 'edmc://' there is
  misleading.
2021-04-01 14:45:51 +01:00
Athanasius baa86b4fbf Add extra logging for Frontier Auth, especially via edmc:// 2021-04-01 14:45:51 +01:00
Athanasius 1504f25d8f protocol: Expand slightly on WNDCLASS with some references. 2021-04-01 14:45:49 +01:00
Athanasius 1692cac51c protocol: docstring WNDCLASS structure
* Built with py2exe.
* Frontier Auth from scratch works on Windows 10 native.
2021-04-01 14:45:49 +01:00
Athanasius 165f55bba4 protocol: Work around incompatible types using conditional on wine_get_version 2021-04-01 14:45:49 +01:00
A_D ceb2f74855 Final type annotation pass 2021-04-01 14:45:49 +01:00
A_D adba94efa2 re-added appname import from constants 2021-04-01 14:45:49 +01:00
A_D 660878dcff removed object 2021-04-01 14:45:49 +01:00
A_D a55e43c0b5 Made linters happy 2021-04-01 14:45:49 +01:00
A_D 4e75941311 Made sure windll names are correct
A/W has meaning and should ALWAYS be noted
2021-04-01 14:45:49 +01:00
Athanasius 67d41d63dc Added more comments to windows DDE
# Conflicts:
#	protocol.py
2021-04-01 14:45:49 +01:00
A_D 96ac23a6eb Made sure to use super() call
Assuming you know what your super is is a bad idea
2021-04-01 14:45:49 +01:00
A_D 1b0b482105 Replaced old formatting with fstring 2021-04-01 14:45:49 +01:00
A_D d5670d9b08 Simplified GET response 2021-04-01 14:45:49 +01:00
Athanasius 65645ee224 Added docstrings
# Conflicts:
#	protocol.py
2021-04-01 14:45:49 +01:00
A_D 4d7ec87746 Renamed ProtocolHandler implementations so not to clash 2021-04-01 14:45:49 +01:00
A_D 52494893e5 Refactored WindowProc callback
Who knew comments and a bit of explanation could help?
2021-04-01 14:45:49 +01:00
A_D 328f8c7397 Broke up giant if 2021-04-01 14:45:49 +01:00
A_D d4cce9ee84 Removed * Imports 2021-04-01 14:45:49 +01:00
A_D 47d5dce6fe Autoformatted code 2021-04-01 14:45:49 +01:00