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
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
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
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
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