diff --git a/gooey/python_bindings/modules.py b/gooey/python_bindings/modules.py deleted file mode 100644 index c2bb0f5..0000000 --- a/gooey/python_bindings/modules.py +++ /dev/null @@ -1,28 +0,0 @@ - -import os -import time -import hashlib -from itertools import dropwhile -import sys -import tempfile - -sys.path.append(os.path.dirname(__file__)) - -def load(module_source): - descriptor, tmpfilepath = tempfile.mkstemp(suffix='.py') - - tmpfiledir = os.path.dirname(tmpfilepath) - tmpfilename = os.path.splitext(os.path.split(tmpfilepath)[-1])[0] - - sys.path.append(tmpfiledir) - try: - with open(tmpfilepath, 'w') as f: - f.write(module_source) - return __import__(tmpfilename) - finally: - os.close(descriptor) - os.remove(tmpfilepath) - -if __name__ == '__main__': - pass - diff --git a/gooey/tests/modules_unittest.py b/gooey/tests/modules_unittest.py deleted file mode 100644 index 8656a45..0000000 --- a/gooey/tests/modules_unittest.py +++ /dev/null @@ -1,16 +0,0 @@ -from gooey.python_bindings import modules - -module_source = \ -''' -some_var = 1234 - -def fooey(): - return 10 - -''' - -def test_load_creates_and_imports_module_from_string_source(): - module = modules.load(module_source) - assert 10 == module.fooey() - -