chgksuite_qt 0.0.4b0__tar.gz → 0.0.6__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chgksuite_qt
3
- Version: 0.0.4b0
3
+ Version: 0.0.6
4
4
  Summary: A GUI wrapper for chgksuite using PyQt6
5
5
  Author-email: Alexander Pecheny <ap@pecheny.me>
6
6
  License-Expression: MIT
@@ -14,7 +14,7 @@ import urllib.request
14
14
 
15
15
  try:
16
16
  from PyQt6 import QtWidgets, QtGui
17
- from PyQt6.QtCore import QTimer, pyqtSignal, QObject
17
+ from PyQt6.QtCore import QTimer, pyqtSignal, QObject, QThread
18
18
 
19
19
  PYQT = True
20
20
  except ImportError:
@@ -31,6 +31,13 @@ from chgksuite.version import __version__
31
31
  from chgksuite.cli import ArgparseBuilder, single_action
32
32
 
33
33
 
34
+ def is_app_translocated(path):
35
+ """Check if the app is running from macOS App Translocation."""
36
+ if sys.platform == "darwin" and path:
37
+ return "/AppTranslocation/" in path
38
+ return False
39
+
40
+
34
41
  def get_pyapp_executable():
35
42
  """Return the pyapp executable path if running inside pyapp, else None."""
36
43
  pyapp_env = os.environ.get("PYAPP", "")
@@ -87,6 +94,16 @@ def check_for_updates():
87
94
  return False, current, None
88
95
 
89
96
 
97
+ class UpdateChecker(QObject):
98
+ """Worker to check for updates in background thread."""
99
+
100
+ finished = pyqtSignal(object, object, object) # has_update, details, error
101
+
102
+ def run(self):
103
+ has_update, details, error = check_for_updates()
104
+ self.finished.emit(has_update, details, error)
105
+
106
+
90
107
  LANGS = ["by", "by_tar", "en", "kz_cyr", "ru", "sr", "ua", "uz", "uz_cyr"] + ["custom"]
91
108
 
92
109
  debug = False
@@ -312,15 +329,14 @@ class ParserWrapper(object):
312
329
  self.update_button.setEnabled(False)
313
330
  self.update_button.setText("Проверка обновлений...")
314
331
 
315
- # Check for updates in a thread to avoid blocking UI
316
- def check_thread():
317
- has_update, details, error = check_for_updates()
318
- # Schedule UI update on main thread
319
- QTimer.singleShot(
320
- 0, lambda: self._handle_update_check(has_update, details, error)
321
- )
322
-
323
- threading.Thread(target=check_thread, daemon=True).start()
332
+ # Check for updates in a QThread to safely update UI
333
+ self._update_thread = QThread()
334
+ self._update_checker = UpdateChecker()
335
+ self._update_checker.moveToThread(self._update_thread)
336
+ self._update_thread.started.connect(self._update_checker.run)
337
+ self._update_checker.finished.connect(self._handle_update_check)
338
+ self._update_checker.finished.connect(self._update_thread.quit)
339
+ self._update_thread.start()
324
340
 
325
341
  def _handle_update_check(self, has_update, details, error):
326
342
  """Handle update check result on main thread."""
@@ -358,6 +374,19 @@ class ParserWrapper(object):
358
374
 
359
375
  def _run_self_update(self):
360
376
  """Run pyapp self-update command and close the application."""
377
+ # Check for macOS App Translocation
378
+ if is_app_translocated(self.pyapp_executable):
379
+ QtWidgets.QMessageBox.warning(
380
+ self.window,
381
+ "Обновление невозможно",
382
+ "Приложение запущено из временной папки (App Translocation).\n\n"
383
+ "Чтобы обновить приложение:\n"
384
+ "1. Закройте приложение\n"
385
+ "2. Переместите его в папку «Программы» (Applications)\n"
386
+ "3. Запустите приложение снова и нажмите «Обновить»",
387
+ )
388
+ return
389
+
361
390
  try:
362
391
  # Start the update process detached from current process
363
392
  if sys.platform == "win32":
@@ -0,0 +1 @@
1
+ __version__ = "0.0.6"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chgksuite_qt
3
- Version: 0.0.4b0
3
+ Version: 0.0.6
4
4
  Summary: A GUI wrapper for chgksuite using PyQt6
5
5
  Author-email: Alexander Pecheny <ap@pecheny.me>
6
6
  License-Expression: MIT
@@ -3,12 +3,6 @@ pyproject.toml
3
3
  chgksuite_qt/__main__.py
4
4
  chgksuite_qt/gui.py
5
5
  chgksuite_qt/version.py
6
- chgksuite_qt.egg-info/._PKG-INFO
7
- chgksuite_qt.egg-info/._SOURCES.txt
8
- chgksuite_qt.egg-info/._dependency_links.txt
9
- chgksuite_qt.egg-info/._entry_points.txt
10
- chgksuite_qt.egg-info/._requires.txt
11
- chgksuite_qt.egg-info/._top_level.txt
12
6
  chgksuite_qt.egg-info/PKG-INFO
13
7
  chgksuite_qt.egg-info/SOURCES.txt
14
8
  chgksuite_qt.egg-info/dependency_links.txt
@@ -1 +0,0 @@
1
- __version__ = "0.0.4b0"
File without changes
File without changes