Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Fractalis
fractalis
Commits
53a7f32d
Commit
53a7f32d
authored
Jun 05, 2018
by
Sascha Herzinger
Browse files
Fixed issue that occurred when ETL modules had same name
parent
79b379b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
fractalis/utils.py
View file @
53a7f32d
...
...
@@ -3,7 +3,7 @@ import inspect
import
importlib
from
pathlib
import
Path
from
typing
import
List
from
import
lib.machinery
import
SourceFileLoader
import
importlib.util
def
import_module_by_abs_path
(
module_path
:
str
)
->
object
:
...
...
@@ -12,7 +12,10 @@ def import_module_by_abs_path(module_path: str) -> object:
:return: A reference to the imported module.
"""
module_name
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
module_path
))[
0
]
return
SourceFileLoader
(
module_name
,
module_path
).
load_module
()
spec
=
importlib
.
util
.
spec_from_file_location
(
module_name
,
module_path
)
module
=
importlib
.
util
.
module_from_spec
(
spec
)
spec
.
loader
.
exec_module
(
module
)
return
module
def
list_classes_with_base_class
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment