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.

Przeglądaj źródła

Expose post-installation tasks to the API

Adds `--postinstall` to the `datalad gooey`, which would trigger
post-installation tasks defined in `postinstall.py`
Michał Szczepanik 2 lat temu
rodzic
commit
4ab7c315c9
1 zmienionych plików z 15 dodań i 2 usunięć
  1. 15 2
      datalad_gooey/gooey.py

+ 15 - 2
datalad_gooey/gooey.py

@@ -10,6 +10,8 @@ from datalad.interface.utils import eval_results
 
 from datalad.interface.results import get_status_dict
 
+from .postinstall import perform_post_install_tasks
+
 import logging
 lgr = logging.getLogger('datalad.ext.gooey.gooey')
 
@@ -48,7 +50,13 @@ class Gooey(Interface):
             # documentation
             doc="""The root location from which the Gooey file explorer will be
             launched (default is current working directory)""",
-        )
+        ),
+        postinstall=Parameter(
+            args=("--postinstall",),
+            doc="Perform post-installation tasks",
+            action="store_true",
+            # default=False,
+        ),
     )
 
     @staticmethod
@@ -58,11 +66,16 @@ class Gooey(Interface):
     @eval_results
     # signature must match parameter list above
     # additional generic arguments are added by decorators
-    def __call__(path: str = None):
+    def __call__(path: str = None, postinstall: bool = False):
         # local import to keep entrypoint import independent of PySide
         # availability
         from .app import GooeyApp, QApplication
 
+        # if requested, perform post-install tasks and exit
+        if postinstall:
+            perform_post_install_tasks()
+            return
+
         qtapp = QApplication(sys.argv)
         gooey = GooeyApp(path)
         gooey.main_window.show()