예제 #1
0
 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()
예제 #2
0
 def version():
     return Version(1, 0, 0)
예제 #3
0
파일: Common.py 프로젝트: rvjmaeff/PyFlow
    >>> 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