Browse Source

Ready for code import

Michael Hanke 1 year ago
parent
commit
ca26822f4d

+ 24 - 0
datalad_gooey/__init__.py

@@ -0,0 +1,24 @@
+"""DataLad Gooey"""
+
+__docformat__ = 'restructuredtext'
+
+import logging
+lgr = logging.getLogger('datalad.ext.gooey')
+
+# Defines a datalad command suite.
+# This variable must be bound as a setuptools entrypoint
+# to be found by datalad
+command_suite = (
+    # description of the command suite, displayed in cmdline help
+    "GUI",
+    [
+        (
+            'datalad_gooey.gooey',
+            'Gooey',
+        ),
+    ]
+)
+
+from ._version import get_versions
+__version__ = get_versions()['version']
+del get_versions

datalad_helloworld/_version.py → datalad_gooey/_version.py


datalad_helloworld/conftest.py → datalad_gooey/conftest.py


+ 3 - 3
datalad_helloworld/hello_cmd.py

@@ -15,13 +15,13 @@ from datalad.support.constraints import EnsureChoice
 from datalad.interface.results import get_status_dict
 
 import logging
-lgr = logging.getLogger('datalad.ext.gooey.hello_cmd')
+lgr = logging.getLogger('datalad.ext.gooey.gooey')
 
 
 # decoration auto-generates standard help
 @build_doc
 # all commands must be derived from Interface
-class HelloWorld(Interface):
+class Gooey(Interface):
     # first docstring line is used a short description in the cmdline help
     # the rest is put in the verbose help and manpage
     """Short description of the command
@@ -44,7 +44,7 @@ class HelloWorld(Interface):
 
     @staticmethod
     # decorator binds the command to the Dataset class as a method
-    @datasetmethod(name='hello_cmd')
+    @datasetmethod(name='gooey')
     # generic handling of command results (logging, rendering, filtering, ...)
     @eval_results
     # signature must match parameter list above

datalad_helloworld/tests/__init__.py → datalad_gooey/tests/__init__.py


+ 2 - 2
datalad_helloworld/tests/test_register.py

@@ -3,9 +3,9 @@ from datalad.tests.utils_pytest import assert_result_count
 
 def test_register():
     import datalad.api as da
-    assert hasattr(da, 'hello_cmd')
+    assert hasattr(da, 'gooey')
     assert_result_count(
-        da.hello_cmd(),
+        da.gooey(),
         1,
         action='demo')
 

+ 0 - 31
datalad_helloworld/__init__.py

@@ -1,31 +0,0 @@
-"""DataLad demo extension"""
-
-__docformat__ = 'restructuredtext'
-
-import logging
-lgr = logging.getLogger('datalad.ext.gooey')
-
-# Defines a datalad command suite.
-# This variable must be bound as a setuptools entrypoint
-# to be found by datalad
-command_suite = (
-    # description of the command suite, displayed in cmdline help
-    "Demo DataLad command suite",
-    [
-        # specification of a command, any number of commands can be defined
-        (
-            # importable module that contains the command implementation
-            'datalad_gooey.hello_cmd',
-            # name of the command class implementation in above module
-            'HelloWorld',
-            # optional name of the command in the cmdline API
-            'hello-cmd',
-            # optional name of the command in the Python API
-            'hello_cmd'
-        ),
-    ]
-)
-
-from ._version import get_versions
-__version__ = get_versions()['version']
-del get_versions

+ 2 - 2
docs/source/index.rst

@@ -15,7 +15,7 @@ High-level API commands
 .. autosummary::
    :toctree: generated
 
-   hello_cmd
+   gooey
 
 
 Command line reference
@@ -24,7 +24,7 @@ Command line reference
 .. toctree::
    :maxdepth: 1
 
-   generated/man/datalad-hello-cmd
+   generated/man/datalad-gooey
 
 
 Indices and tables

+ 2 - 1
setup.cfg

@@ -14,7 +14,8 @@ classifiers =
 [options]
 python_requires = >= 3.7
 install_requires =
-    datalad >= 0.17.0
+    datalad_next >= 0.6.0
+    pyside6
 packages = find_namespace:
 include_package_data = True