Commit f7a3c762954f85eef9dce718892a7858cffd35b4

new convention
  
1import sys
2sys.path += ["lib","/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages"]
13
4caller = sys._getframe(1).f_globals["__name__"]
5exec "import %s as target" % caller
6
7target.timeit = __import__("timeit")
8
9modules = (
10 "sys",
11 "os",
12 "matplotlib",
13 "mpmath",
14 "numpy",
15 "scipy",
16 "timeit"
17)
18
19for module_name in modules:
20 target.__dict__[module_name] = __import__(module_name)
21
22target.matplotlib.use("Agg")
23target.mpmath.mp.dps = 100
24
25target.__dict__["pylab"] = __import__("pylab")
26target.__dict__["pprint"] = __import__("pprint").pprint
27
28
29# below is obsolete
30# {{{
31
232def import_convention(scope):
333 code =\
434"""
535import sys, os, matplotlib, mpmath, numpy
636sys.path += ["lib","/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages"]
37mpmath.mp.dps = 100
738matplotlib.use("Agg")
839import pylab
940import scipy
1041from pprint import pprint
42import fdtd
1143"""
1244 exec code in scope
1345 pass
46
47# }}}