pyloid 0.9.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyloid-0.9.5.dist-info/LICENSE +201 -0
- pyloid-0.9.5.dist-info/METADATA +185 -0
- pyloid-0.9.5.dist-info/RECORD +11 -0
- pyloid-0.9.5.dist-info/WHEEL +4 -0
- pylonic/__init__.py +6 -0
- pylonic/api.py +10 -0
- pylonic/autostart.py +101 -0
- pylonic/monitor.py +372 -0
- pylonic/pylonic.py +915 -0
- pylonic/tray.py +18 -0
- pylonic/utils.py +29 -0
pylonic/tray.py
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
from enum import Enum
|
2
|
+
from PySide6.QtWidgets import QSystemTrayIcon
|
3
|
+
|
4
|
+
|
5
|
+
class TrayEvent(Enum):
|
6
|
+
DoubleClick = QSystemTrayIcon.ActivationReason.DoubleClick
|
7
|
+
MiddleClick = QSystemTrayIcon.ActivationReason.MiddleClick
|
8
|
+
RightClick = QSystemTrayIcon.ActivationReason.Context
|
9
|
+
LeftClick = QSystemTrayIcon.ActivationReason.Trigger
|
10
|
+
Unknown = QSystemTrayIcon.ActivationReason.Unknown
|
11
|
+
|
12
|
+
def __eq__(self, other):
|
13
|
+
if isinstance(other, QSystemTrayIcon.ActivationReason):
|
14
|
+
return self.value == other
|
15
|
+
return super().__eq__(other)
|
16
|
+
|
17
|
+
def __hash__(self):
|
18
|
+
return hash(self.value)
|
pylonic/utils.py
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
import sys
|
2
|
+
import os
|
3
|
+
from typing import Optional
|
4
|
+
|
5
|
+
|
6
|
+
def get_production_path() -> Optional[str]:
|
7
|
+
"""
|
8
|
+
Returns the path to the resource files in a production environment.
|
9
|
+
If running as a regular Python script, returns None.
|
10
|
+
|
11
|
+
Returns:
|
12
|
+
str | None
|
13
|
+
"""
|
14
|
+
if getattr(sys, 'frozen', False):
|
15
|
+
# If built with PyInstaller
|
16
|
+
return sys._MEIPASS
|
17
|
+
else:
|
18
|
+
# If running as a regular Python script
|
19
|
+
return None
|
20
|
+
|
21
|
+
|
22
|
+
def is_production():
|
23
|
+
"""
|
24
|
+
Checks if the current environment is a production environment.
|
25
|
+
|
26
|
+
Returns:
|
27
|
+
bool: True if in a production environment, False otherwise.
|
28
|
+
"""
|
29
|
+
return getattr(sys, 'frozen', False)
|