chgksuite_qt 0.0.5__tar.gz → 0.0.7__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.
- {chgksuite_qt-0.0.5 → chgksuite_qt-0.0.7}/PKG-INFO +1 -1
- {chgksuite_qt-0.0.5 → chgksuite_qt-0.0.7}/chgksuite_qt/gui.py +49 -0
- chgksuite_qt-0.0.7/chgksuite_qt/version.py +1 -0
- {chgksuite_qt-0.0.5 → chgksuite_qt-0.0.7}/chgksuite_qt.egg-info/PKG-INFO +1 -1
- chgksuite_qt-0.0.5/chgksuite_qt/version.py +0 -1
- {chgksuite_qt-0.0.5 → chgksuite_qt-0.0.7}/LICENSE.txt +0 -0
- {chgksuite_qt-0.0.5 → chgksuite_qt-0.0.7}/chgksuite_qt/__main__.py +0 -0
- {chgksuite_qt-0.0.5 → chgksuite_qt-0.0.7}/chgksuite_qt.egg-info/SOURCES.txt +0 -0
- {chgksuite_qt-0.0.5 → chgksuite_qt-0.0.7}/chgksuite_qt.egg-info/dependency_links.txt +0 -0
- {chgksuite_qt-0.0.5 → chgksuite_qt-0.0.7}/chgksuite_qt.egg-info/entry_points.txt +0 -0
- {chgksuite_qt-0.0.5 → chgksuite_qt-0.0.7}/chgksuite_qt.egg-info/requires.txt +0 -0
- {chgksuite_qt-0.0.5 → chgksuite_qt-0.0.7}/chgksuite_qt.egg-info/top_level.txt +0 -0
- {chgksuite_qt-0.0.5 → chgksuite_qt-0.0.7}/pyproject.toml +0 -0
- {chgksuite_qt-0.0.5 → chgksuite_qt-0.0.7}/setup.cfg +0 -0
|
@@ -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", "")
|
|
@@ -279,8 +286,10 @@ class ParserWrapper(object):
|
|
|
279
286
|
def worker():
|
|
280
287
|
old_stdout, old_stderr = sys.stdout, sys.stderr
|
|
281
288
|
old_input = builtins.input
|
|
289
|
+
old_no_color = os.environ.get("NO_COLOR")
|
|
282
290
|
sys.stdout = sys.stderr = self.output_buffer
|
|
283
291
|
builtins.input = self.input_requester.request_input
|
|
292
|
+
os.environ["NO_COLOR"] = "1" # Disable ANSI colors in output
|
|
284
293
|
try:
|
|
285
294
|
_, resourcedir = get_source_dirs()
|
|
286
295
|
args = DefaultNamespace(self.parser.parse_args(self.cmdline_call))
|
|
@@ -290,6 +299,10 @@ class ParserWrapper(object):
|
|
|
290
299
|
finally:
|
|
291
300
|
sys.stdout, sys.stderr = old_stdout, old_stderr
|
|
292
301
|
builtins.input = old_input
|
|
302
|
+
if old_no_color is None:
|
|
303
|
+
os.environ.pop("NO_COLOR", None)
|
|
304
|
+
else:
|
|
305
|
+
os.environ["NO_COLOR"] = old_no_color
|
|
293
306
|
self.worker_done = True
|
|
294
307
|
|
|
295
308
|
self.worker_thread = threading.Thread(target=worker, daemon=True)
|
|
@@ -367,6 +380,19 @@ class ParserWrapper(object):
|
|
|
367
380
|
|
|
368
381
|
def _run_self_update(self):
|
|
369
382
|
"""Run pyapp self-update command and close the application."""
|
|
383
|
+
# Check for macOS App Translocation
|
|
384
|
+
if is_app_translocated(self.pyapp_executable):
|
|
385
|
+
QtWidgets.QMessageBox.warning(
|
|
386
|
+
self.window,
|
|
387
|
+
"Обновление невозможно",
|
|
388
|
+
"Приложение запущено из временной папки (App Translocation).\n\n"
|
|
389
|
+
"Чтобы обновить приложение:\n"
|
|
390
|
+
"1. Закройте приложение\n"
|
|
391
|
+
"2. Переместите его в папку «Программы» (Applications)\n"
|
|
392
|
+
"3. Запустите приложение снова и нажмите «Обновить»",
|
|
393
|
+
)
|
|
394
|
+
return
|
|
395
|
+
|
|
370
396
|
try:
|
|
371
397
|
# Start the update process detached from current process
|
|
372
398
|
if sys.platform == "win32":
|
|
@@ -448,6 +474,7 @@ class ParserWrapper(object):
|
|
|
448
474
|
caption = kwargs.pop("caption", None) or args[0]
|
|
449
475
|
argtype = kwargs.pop("argtype", None)
|
|
450
476
|
filetypes = kwargs.pop("filetypes", None)
|
|
477
|
+
combobox_values = kwargs.pop("combobox_values", None) or []
|
|
451
478
|
|
|
452
479
|
if not argtype:
|
|
453
480
|
if kwargs.get("action") == "store_true":
|
|
@@ -534,6 +561,28 @@ class ParserWrapper(object):
|
|
|
534
561
|
layout.addWidget(innerframe)
|
|
535
562
|
entry.textChanged.connect(var.set)
|
|
536
563
|
self.vars.append(VarWrapper(name=args[0], var=var))
|
|
564
|
+
|
|
565
|
+
elif argtype == "combobox":
|
|
566
|
+
var = QString()
|
|
567
|
+
default_val = kwargs.get("default") or ""
|
|
568
|
+
innerframe = QtWidgets.QWidget(frame)
|
|
569
|
+
innerlayout = QtWidgets.QHBoxLayout(innerframe)
|
|
570
|
+
init_layout(innerframe, innerlayout)
|
|
571
|
+
label = QtWidgets.QLabel(caption, innerframe)
|
|
572
|
+
innerlayout.addWidget(label)
|
|
573
|
+
combobox = QtWidgets.QComboBox(innerframe)
|
|
574
|
+
combobox.setEditable(True)
|
|
575
|
+
combobox.addItems(combobox_values)
|
|
576
|
+
if default_val:
|
|
577
|
+
combobox.setCurrentText(str(default_val))
|
|
578
|
+
combobox.setMinimumWidth(200)
|
|
579
|
+
innerlayout.addWidget(combobox)
|
|
580
|
+
layout.addWidget(innerframe)
|
|
581
|
+
combobox.currentTextChanged.connect(var.set)
|
|
582
|
+
# Initialize var with current combobox text
|
|
583
|
+
var.set(combobox.currentText())
|
|
584
|
+
self.vars.append(VarWrapper(name=args[0], var=var))
|
|
585
|
+
|
|
537
586
|
self.parser.add_argument(*args, **kwargs)
|
|
538
587
|
|
|
539
588
|
def add_subparsers(self, *args, **kwargs):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.7"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.5"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|