Skip to content

Commit 9301935

Browse files
arbitrary_subfolders: Make import_class_by_fullname not a private method, it is used by NI_DAQmx
code to import subclasses programatically.
1 parent a8273e6 commit 9301935

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def null_decorator(cls):
149149
runviewer_parser = ClassRegister('runviewer_parser')
150150

151151

152-
def _import_class_by_fullname(fullname):
152+
def import_class_by_fullname(fullname):
153153
"""Import and return a class defined by its fully qualified name as an absolute
154154
import path, i.e. "module.submodule.ClassName"."""
155155
split = fullname.split('.')
@@ -169,7 +169,7 @@ def deprecated_import_alias(fullname):
169169
cls = []
170170
def wrapper(*args, **kwargs):
171171
if not cls:
172-
cls.append(_import_class_by_fullname(fullname))
172+
cls.append(import_class_by_fullname(fullname))
173173
shortname = fullname.split('.')[-1]
174174
newmodule = '.'.join(fullname.split('.')[:-1])
175175
msg = """Importing %s from %s is deprecated, please instead import it from
@@ -194,7 +194,7 @@ def get_BLACS_tab(name):
194194
if not BLACS_tab_registry:
195195
populate_registry()
196196
if name in BLACS_tab_registry:
197-
return _import_class_by_fullname(BLACS_tab_registry[name])
197+
return import_class_by_fullname(BLACS_tab_registry[name])
198198
# Fall back on file naming convention + decorator method:
199199
return BLACS_tab[name]
200200

@@ -203,7 +203,7 @@ def get_runviewer_parser(name):
203203
if not runviewer_parser_registry:
204204
populate_registry()
205205
if name in runviewer_parser_registry:
206-
return _import_class_by_fullname(runviewer_parser_registry[name])
206+
return import_class_by_fullname(runviewer_parser_registry[name])
207207
# Fall back on file naming convention + decorator method:
208208
return runviewer_parser[name]
209209

0 commit comments

Comments
 (0)