1
2
3 import libpyshared
4 from libpyshared import *
5
6 import libpyempro
7 from libpyempro import *
8 from libpyempro import _calcbridge
9
10 import layout_wrapper
11 import _deprecation
23
35 __metaclass__ = _ActiveProjectMeta
36
39
40 - def __exit__(self, type, value, traceback):
42
46
49
58
64
67
68 @_deprecation.deprecated(390, "Use empro.activeProject.analyses instead.")
71
72 @_deprecation.deprecated(390, "Use empro.activeProject.analyses instead.")
75
77 if self.createSimulationData().parameterSweepEnabled == False:
78 return self._createSimulation(iQueue)
79 else:
80 return self._createParameterizedSimulations(iQueue)
81
82 @staticmethod
85
86 @staticmethod
89
90 @_deprecation.deprecated(390, "Use empro.activeProject.rootdir instead.")
93 @_deprecation.deprecated(390, "Use empro.activeProject.rootdir instead.")
96
97 @_deprecation.deprecated(390, "Use empro.activeProject.location instead.")
100 @_deprecation.deprecated(390, "Use empro.activeProject.location instead.")
103
104 @_deprecation.deprecated(390, "Use empro.activeProject.readOnly instead.")
107 @_deprecation.deprecated(390, "Use empro.activeProject.readOnly instead.")
110
111 @_deprecation.deprecated(390, "Use empro.activeProject.lastSavedTime instead.")
114
115 @_deprecation.deprecated(390, "Use empro.activeProject.displayUnits instead.")
118
119 @_deprecation.deprecated(390, "Use empro.activeProject._skinUndoable instead.")
122 @_deprecation.deprecated(390, "Use empro.activeProject._skinUndoable instead.")
125
126 @_deprecation.deprecated(390, "Use empro.activeProject.skin instead.")
129 @_deprecation.deprecated(390, "Use empro.activeProject.skin instead.")
132
133 @_deprecation.deprecated(390, "Use empro.activeProject.verticalAxis instead.")
136 @_deprecation.deprecated(390, "Use empro.activeProject.verticalAxis instead.")
139
140 @_deprecation.deprecated(390, "Use empro.activeProject.useCustomTimestepMultiplier instead.")
143 @_deprecation.deprecated(390, "Use empro.activeProject.useCustomTimestepMultiplier instead.")
146
147 @_deprecation.deprecated(390, "Use empro.activeProject.customTimestepMultiplier instead.")
150 @_deprecation.deprecated(390, "Use empro.activeProject.customTimestepMultiplier instead.")
153
154 @_deprecation.deprecated(390, "Use empro.activeProject.name instead.")
157 @_deprecation.deprecated(390, "Use empro.activeProject.name instead.")
160
161 @_deprecation.deprecated(390, "Use empro.activeProject.notes instead.")
164 @_deprecation.deprecated(390, "Use empro.activeProject.notes instead.")
167
168 @_deprecation.deprecated(390, "Use empro.activeProject.layout instead.")
171
172 @property
175
176
177 activeProject = ActiveProject()
188
194
197 import sys
198 import os
199 import atexit
200 import inspect
201
202
203 for symbol,value in libpyshared.gui.__dict__.iteritems():
204 if not symbol.startswith("__"):
205 libpyempro.gui.__dict__[symbol] = value
206
207 for name, member in inspect.getmembers(libpyempro):
208 if inspect.ismodule(member):
209 sys.modules["{}.{}".format(__name__, name)] = member
210
211 if os.getenv('EMPROHOME') is None:
212 parent_dir = os.path.join(os.path.dirname(__file__), os.pardir)
213 os.environ['EMPROHOME'] = os.path.abspath(parent_dir)
214
215 os.environ['PCELLBROKER_HOME'] = os.path.join(os.environ['EMPROHOME'], 'broker')
216 pcellBrokerEnv = [x for x in os.environ.get('PCELLBROKER_ENV', '').split('=') if x]
217 for name in ['LD_LIBRARY_PATH', 'OA_PLUGIN_PATH', 'PATH', 'PYTHONHOME', 'PYTHONPATH']:
218 if name not in pcellBrokerEnv:
219 pcellBrokerEnv.append(name)
220 if name in os.environ:
221 os.environ['PCELLBROKER_ENV_{}'.format(name)] = os.environ[name]
222 os.environ['PCELLBROKER_ENV'] = ''.join([(x + '=') for x in pcellBrokerEnv])
223
224 if os.getenv('PYTHONHOME') is None:
225
226 os.environ['PYTHONHOME'] = sys.prefix + os.pathsep + sys.exec_prefix
227
228 global emproCleanWorkDirOnExitTargets
229 emproCleanWorkDirOnExitTargets = []
230 atexit.register(_empro_at_exit)
231
232 import compatibility
233 compatibility.useAll()
234
235 return os.environ['EMPROHOME']
236
237 emprohome = _empro_init()
238
239
240
241