def doImport(pyFlowInstance): name_filter = "Graph files (*.json)" openFilename, filterString = QFileDialog.getOpenFileName( filter=PythonScriptExporter.name_filter) if openFilename != "": with open(openFilename, 'r') as f: script = f.read() mem = Py3CodeCompiler().compile(code=script, scope=globals()) fileVersion = Version.fromString(mem["EXPORTER_VERSION"]) if fileVersion >= PythonScriptExporter.version( ) and PythonScriptExporter.displayName( ) == mem["EXPORTER_NAME"]: pyFlowInstance.newFile() ROOT_GRAPH = pyFlowInstance.graphManager.get( ).findRootGraph() mem["createScene"](ROOT_GRAPH) pyFlowInstance.afterLoad()
def version(): return Version(1, 0, 0)
>>> roundup(7, 8) >>> 8 >>> roundup(8, 8) >>> 8 >>> roundup(9, 8) >>> 16 :param x: value to round :param to: value x will be rounded to :returns: rounded value of x :rtype: int """ return int(math.ceil(x / to)) * to _currentVersion = Version(sys.version_info.major, sys.version_info.minor, 0) python32 = Version(3, 2, 0) if _currentVersion <= python32: def clearList(list): """Clears python list :param list: list to clear :type list: list :returns: cleared List :rtype: list """ del list[:] else: def clearList(list): """Clears python list