From efbea19c1362dff3e8480bcabcca9c14761d2a87 Mon Sep 17 00:00:00 2001 From: chriskiehl Date: Thu, 24 Dec 2015 16:49:48 -0500 Subject: [PATCH] Removed outdated code --- gooey/python_bindings/modules.py | 28 ---------------------------- gooey/tests/modules_unittest.py | 16 ---------------- 2 files changed, 44 deletions(-) delete mode 100644 gooey/python_bindings/modules.py delete mode 100644 gooey/tests/modules_unittest.py 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() - -