Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

瀏覽代碼

Prevent Git terminal interaction through the entire app

Users can not be expected to have a terminal (visible). Any interaction
attempt would seemingly hang the app.

This changes turn any such event into a crash/error.

Providing GUI-based alternatives for interaction is still necessary, but
an orthogonal effort

Ping datalad/datalad-gooey#177
Closes datalad/datalad-gooey#176
Michael Hanke 2 年之前
父節點
當前提交
c4ad405303
共有 1 個文件被更改,包括 11 次插入1 次删除
  1. 11 1
      datalad_gooey/app.py

+ 11 - 1
datalad_gooey/app.py

@@ -1,8 +1,9 @@
 import logging
 import sys
 from types import MappingProxyType
-from pathlib import Path
+from os import environ
 from outdated import check_outdated
+from pathlib import Path
 from PySide6.QtWidgets import (
     QApplication,
     QMenu,
@@ -70,6 +71,12 @@ class GooeyApp(QObject):
         # we cannot handle ANSI coloring
         dlcfg.set('datalad.ui.color', 'off', scope='override', force=True)
 
+        # prevent any terminal-based interaction of Git
+        # do it here, not just for command execution to also catch any possible
+        # ad-hoc Git calls
+        self._gittermprompt = environ.get('GIT_TERMINAL_PROMPT')
+        environ['GIT_TERMINAL_PROMPT'] = '0'
+
         # setup themeing before the first dialog goes up
         self._setup_looknfeel()
 
@@ -174,6 +181,9 @@ class GooeyApp(QObject):
 
     def deinit(self):
         dlui.ui.set_backend(self._prev_ui_backend)
+        # restore any possible term prompt setup
+        if self._gittermprompt:
+            environ['GIT_TERMINAL_PROMPT'] = self._gittermprompt
 
     #@cached_property not available for PY3.7
     @property