当前位置: 首页>>代码示例>>Python>>正文


Python Logger.showWarning方法代码示例

本文整理汇总了Python中utils.Logger.showWarning方法的典型用法代码示例。如果您正苦于以下问题:Python Logger.showWarning方法的具体用法?Python Logger.showWarning怎么用?Python Logger.showWarning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在utils.Logger的用法示例。


在下文中一共展示了Logger.showWarning方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from utils import Logger [as 别名]
# 或者: from utils.Logger import showWarning [as 别名]
	def __init__(self, xml_element):
		self.event = xml_element.get("event","").strip()
		scope_string = xml_element.get("scope","").strip().lower()
		self.target = xml_element.get("target","").strip()
		self.port = xml_element.get("port","").strip()
		
		if scope_string == "local" :
			self.scope = self.LOCAL_SCOPE
		elif scope_string == "broad" :
			self.scope = self.BROAD_SCOPE
		elif scope_string == "output" :
			self.scope = self.OUTPUT_SCOPE
		elif scope_string == "narrow" :
			self.scope = self.NARROW_SCOPE
		elif scope_string == "cd" :
			self.scope = self.CD_SCOPE
		elif scope_string == "" :
			#Calculate scope depending on present attributes
			if self.target and self.port :
				raise CompilerException("Both target and port attribute detected without a scope defined.")
			elif self.port :
				self.scope = self.OUTPUT_SCOPE
			elif self.target :
				self.scope = self.NARROW_SCOPE
			else :
				self.scope = self.LOCAL_SCOPE  
			
		else :
			raise CompilerException("Illegal scope attribute; needs to be one of the following : local, broad, narrow, output, cd or nothing.");  
				
		if self.scope == self.LOCAL_SCOPE or self.scope == self.BROAD_SCOPE or self.scope == self.CD_SCOPE:
			if self.target :
				Logger.showWarning("Raise event target detected, not matching with scope. Ignored.")
				self.target = ""
			if self.port :
				Logger.showWarning("Raise event port detected, not matching with scope. Ignored.")
				self.port = ""
		if self.scope == self.NARROW_SCOPE and self.port :
			Logger.showWarning("Raise event port detected, not matching with scope. Ignored.")
			self.port = ""
		if self.scope == self.OUTPUT_SCOPE and self.target :
			Logger.showWarning("Raise event target detected, not matching with scope. Ignored.")
			self.target = ""
				
		self.params = []
		parameters = xml_element.findall('parameter')	
		for p in parameters :
			value = p.get("expr","")
			if not value :
				raise CompilerException("Parameter without value detected.")
			self.params.append(Expression(value))
开发者ID:hergin,项目名称:AToMPM,代码行数:53,代码来源:sccd_constructs.py

示例2: visit_Class

# 需要导入模块: from utils import Logger [as 别名]
# 或者: from utils.Logger import showWarning [as 别名]
	def visit_Class(self, c):
		# replace super class names by super class objects
		for s in c.super_classes:
			super_class = None
			for clas in c.class_diagram.classes:
				if clas.name == s:
					super_class = clas
			if super_class == None:
				Logger.showWarning("Class <" + c.name + "> has undefined super class <" + s + ">.")
			else:
				c.super_class_objs[s] = super_class

		# calculate list of abstract methods
		c.abstract_method_names = getClassAbstractMethodNames(c)

		# check if <super> tags exist for all inherited classes
		for name,obj in c.super_class_objs.iteritems():
			if obj:
				if name not in c.constructors[0].super_class_parameters:
					num_params = len(obj.constructors[0].parameters)
					if num_params > 0:
						raise CompilerException("Class <" + c.name + "> inherits <" + name + "> and <" + name + ">'s constructor has " + str(num_params) + " parameter(s), but there's no <super> entry for that class in <" + c.name + ">'s constructor.")
开发者ID:hergin,项目名称:AToMPM,代码行数:24,代码来源:super_class_linker.py

示例3: processInheritances

# 需要导入模块: from utils import Logger [as 别名]
# 或者: from utils.Logger import showWarning [as 别名]
 def processInheritances(self, inheritances):
     # process each inheritance, stores a dict with each subclass as the key
     # and a list of tuples (superclass, priority) as the value. The priority
     # tells us which class to inherit from first for multiple inheritance. Gives
     # a WARNING with a given inheritance order if two priorities are the same
     for i in inheritances :
         self.super_classes.append((i.get("class",""),i.get("priority",1)))
         
     self.super_classes.sort(lambda a, b: cmp(a[1], b[1]))
     priorityChecker = {}
     for super_class, priority in self.super_classes:
         if priority in priorityChecker:
             checkIt = priorityChecker[priority]
         else:
             checkIt = []
         if super_class not in checkIt:
             checkIt.append(super_class)
         priorityChecker[priority] = checkIt
     for priority, checkIt in priorityChecker.iteritems():
         if len(checkIt) > 1:
             Logger.showWarning("Class <" + self.name + "> inherits from classes <" + ", ".join(checkIt) + "> with same priority <" + str(priority) + ">. Given inheritance order is chosen.")
             
     self.super_classes = [entry[0] for entry in self.super_classes]        
开发者ID:SimonVM,项目名称:SimpleMvKFrontEnd,代码行数:25,代码来源:constructs.py


注:本文中的utils.Logger.showWarning方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。