コード例 #1
0
    def _getCodeId(self, clazz):
        tree = clazz.tree()
        qxDefine = treeutil.findQxDefine(tree)
        className = treeutil.getClassName(qxDefine)

        illegal = self._illegalIdentifierExpr.search(className)
        if illegal:
            raise ValueError, "Item name '%s' contains illegal character '%s'" % (className, illegal.group(0))

        # print "found", className
        return className
コード例 #2
0
    def _getCodeId(self, clazz):
        tree = clazz.tree()
        qxDefine = treeutil.findQxDefine(tree)
        className = treeutil.getClassName(qxDefine)

        illegal = self._illegalIdentifierExpr.search(className)
        if illegal:
            raise ValueError, "Item name '%s' contains illegal character '%s'" % (
                className, illegal.group(0))

        #print "found", className
        return className
コード例 #3
0
ファイル: Library.py プロジェクト: Amsoft-Systems/qooxdoo
    def _getCodeId(self, clazz):
        className = None  # not-found return value
        tree     = clazz.tree()
        qxDefine = treeutil.findQxDefine (tree)
        if qxDefine:
            className = treeutil.getClassName (qxDefine)
            if not className:  # might be u''
                className = None
            else:
                illegal = self._illegalIdentifierExpr.search(className)
                if illegal:
                    raise ValueError, "Item name '%s' contains illegal character '%s'" % (className,illegal.group(0))

        return className
コード例 #4
0
    def _getCodeId(self, clazz):
        className = None  # not-found return value
        tree = clazz.tree()
        qxDefine = treeutil.findQxDefine(tree)
        if qxDefine:
            className = treeutil.getClassName(qxDefine)
            if not className:  # might be u''
                className = None
            else:
                illegal = self._illegalIdentifierExpr.search(className)
                if illegal:
                    raise ValueError, "Item name '%s' contains illegal character '%s'" % (
                        className, illegal.group(0))

        return className
コード例 #5
0
    def checkClassId(self, tree):
        className = None  # not-found return value
        filePathId = self.id
        qxDefine = treeutil.findQxDefine(tree)
        if qxDefine:
            className = treeutil.getClassName(qxDefine)
            if not className:  # might be u''
                className = None
            else:
                illegal = self._illegalIdentifierExpr.search(className)
                if illegal:
                    raise ValueError, "Item name '%s' contains illegal character '%s'" % (className,illegal.group(0))
        if className and className != filePathId:
            errmsg = [
                u"Detected conflict between filename and classname!\n",
                u"    Classname: %s\n" % className,
                u"    Path: %s\n" % filePathId,
            ]
            raise RuntimeError(u''.join(errmsg))

        return