blob: c9f745ea6a8a9c24e512bea1ddac6764bf41a2e2 [file] [log] [blame]
loadModule("/Modeling/PapyrusUtils")
loadModule("/Modeling/ECore")
import sys
def is_jython():
return hasattr(sys, 'subversion') and (sys.subversion[0]== 'Jython')
if (not is_jython()) :
class GenericRunnable:
def __init__(self,func, *args):
self.func = func
self.args = args
def run(self):
self.result= self.func(*self.args)
class Java:
implements=['java.lang.Runnable']
else:
from java.lang import Runnable
class GenericRunnable(Runnable):
def __init__(self,func, *args):
self.func = func
self.args = args
def run(self):
self.result = self.func(*self.args)
def papyrun(func, *args):
runnable = GenericRunnable(func, *args)
runOperation( runnable)
return runnable.result