def getScript(self, scriptUri): try: log.debug("getScript " + scriptUri + " invoked") storageUri = self.provCtx.getStorageUrlFromPersistentUrl( self.provCtx.uriHelper.getStorageURI(scriptUri)) log.debug("getScript: storageUri = " + storageUri) fileUri = storageUri[0:storageUri.find("$")] funcName = storageUri[storageUri.find("$") + 1:len(storageUri)] # retrieve arguments in parenthesis funcName, funcArgs = self.getFunctionArguments(funcName) log.debug(" getScript : parsed funcname " + str(funcName)) log.debug(" getScript : func args " + str(funcArgs)) mod = self.provCtx.getModuleByUrl(fileUri) log.debug(" got mod " + str(mod)) func = mod.__dict__[funcName] log.debug("got func " + str(func)) return PythonScript(func, mod, funcArgs) except: text = lastException2String() log.error(text) raise ScriptFrameworkErrorException(text, self, scriptUri, LANGUAGENAME, 0)
def getScript( self, scriptUri ): try: log.debug( "getScript " + scriptUri + " invoked") storageUri = self.provCtx.getStorageUrlFromPersistentUrl( self.provCtx.uriHelper.getStorageURI(scriptUri) ); log.debug( "getScript: storageUri = " + storageUri) fileUri = storageUri[0:storageUri.find( "$" )] funcName = storageUri[storageUri.find( "$" )+1:len(storageUri)] mod = self.provCtx.getModuleByUrl( fileUri ) log.debug( " got mod " + str(mod) ) func = mod.__dict__[ funcName ] log.debug( "got func " + str( func ) ) return PythonScript( func, mod ) except: text = lastException2String() log.error( text ) raise ScriptFrameworkErrorException( text, self, scriptUri, LANGUAGENAME, 0 )