Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 48 additions & 46 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 5 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,20 @@ requires-python = ">=3.14, <3.15"
dependencies = [
"pyside6>=6.10.2",
"packaging>=26.0",
"porringer>=0.2.1.dev49",
"porringer>=0.2.1.dev48",
"qasync>=0.28.0",
"velopack>=0.0.1369.dev7516",
"typer>=0.24.0",
"typer>=0.24.1",
]

[project.urls]
homepage = "https://github.com/synodic/synodic-client"
repository = "https://github.com/synodic/synodic-client"

[dependency-groups]
build = [
"pyinstaller>=6.19.0",
]
lint = [
"ruff>=0.15.2",
"pyrefly>=0.53.0",
]
test = [
"pytest>=9.0.2",
"pytest-cov>=7.0.0",
"pytest-mock>=3.15.1",
]
build = ["pyinstaller>=6.19.0"]
lint = ["ruff>=0.15.2", "pyrefly>=0.54.0"]
test = ["pytest>=9.0.2", "pytest-cov>=7.0.0", "pytest-mock>=3.15.1"]

[project.scripts]
synodic-c = "synodic_client.cli:app"
Expand Down Expand Up @@ -104,10 +95,6 @@ serve = "zensical serve"
data = [{ path = "data/**/*", relative-to = "data/" }]


[tool.pdm.dev-dependencies]
dev = [
"-e file:///d:/Projects/Synodic/porringer#egg=porringer",
]
[build-system]
build-backend = "pdm.backend"
requires = ["pdm.backend"]
10 changes: 5 additions & 5 deletions synodic_client/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
STARTUP_VALUE_NAME = 'SynodicClient'
"""Registry value name used in the ``Run`` key."""

_RUN_KEY_PATH = r'Software\Microsoft\Windows\CurrentVersion\Run'
RUN_KEY_PATH = r'Software\Microsoft\Windows\CurrentVersion\Run'


if sys.platform == 'win32':
import winreg

def register_startup(exe_path: str) -> None:
"""Register the application to start automatically on login.
r"""Register the application to start automatically on login.

Writes a value to ``HKCU\Software\Microsoft\Windows\CurrentVersion\Run``
pointing to *exe_path*. Calling this repeatedly is safe and will
Expand All @@ -32,7 +32,7 @@ def register_startup(exe_path: str) -> None:
exe_path: Absolute path to the application executable.
"""
try:
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, _RUN_KEY_PATH, 0, winreg.KEY_SET_VALUE) as key:
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, RUN_KEY_PATH, 0, winreg.KEY_SET_VALUE) as key:
winreg.SetValueEx(key, STARTUP_VALUE_NAME, 0, winreg.REG_SZ, f'"{exe_path}"')
logger.info('Registered auto-startup -> %s', exe_path)
except OSError:
Expand All @@ -44,7 +44,7 @@ def remove_startup() -> None:
Silently succeeds if the value does not exist.
"""
try:
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, _RUN_KEY_PATH, 0, winreg.KEY_SET_VALUE) as key:
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, RUN_KEY_PATH, 0, winreg.KEY_SET_VALUE) as key:
winreg.DeleteValue(key, STARTUP_VALUE_NAME)
logger.info('Removed auto-startup registration')
except FileNotFoundError:
Expand All @@ -59,7 +59,7 @@ def is_startup_registered() -> bool:
``True`` if the ``Run`` key contains the startup value.
"""
try:
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, _RUN_KEY_PATH, 0, winreg.KEY_QUERY_VALUE) as key:
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, RUN_KEY_PATH, 0, winreg.KEY_QUERY_VALUE) as key:
winreg.QueryValueEx(key, STARTUP_VALUE_NAME)
return True
except FileNotFoundError:
Expand Down
Loading
Loading