From 7e343b8c4084e096c2a406e09df385a09addaf3a Mon Sep 17 00:00:00 2001 From: Mike Urich Date: Thu, 19 Apr 2018 16:24:00 -0400 Subject: [PATCH] Single-line OpenFL module imports Tested as best as I could on my system with: ``` modulename = "FLP"; if 'FLP' not in sys.modules: print 'You have not imported the {} module'.format(modulename) ``` but I don't own a Form printer. --- tests/context.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/context.py b/tests/context.py index 17a8f05..d741d8d 100644 --- a/tests/context.py +++ b/tests/context.py @@ -1,13 +1,15 @@ # -*- coding: utf-8 -*- -import sys -import os -import inspect -from os.path import dirname +#Import OpenFL modules from relative parent directory +from ..OpenFL import FLP, Printer -# Add parent directory to sys.path so we find OpenFL. -sys.path.insert(0, dirname(dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))) +#import sys +#import os +#import inspect +#from os.path import dirname +## Add parent directory to sys.path so we find OpenFL. +#sys.path.insert(0, dirname(dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))) -from OpenFL import FLP -from OpenFL import Printer +#from OpenFL import FLP +#from OpenFL import Printer