本文整理匯總了Python中Command.Command.setSyntaxOnly方法的典型用法代碼示例。如果您正苦於以下問題:Python Command.setSyntaxOnly方法的具體用法?Python Command.setSyntaxOnly怎麽用?Python Command.setSyntaxOnly使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Command.Command
的用法示例。
在下文中一共展示了Command.setSyntaxOnly方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: checkSyntax
# 需要導入模塊: from Command import Command [as 別名]
# 或者: from Command.Command import setSyntaxOnly [as 別名]
def checkSyntax(self):
test = self.getInput().strip()
if (test[0] == '{') and (test[len(test)-1] == '}'):
c = Command(test[1:len(test)-1],self) #supposed to put though everything between {}
c.setSyntaxOnly(self.syntax_only)
if not self.syntax_only:
c.setPropertyList(self.property_list) #commands should get access to all already existing propertylists?
if c.checkSyntax():
if not self.syntax_only:
cList = c.getPropertyList().getDict()
sList = self.property_list.getDict()
sList.update(cList)
return True
else:
return False
else:
print "The first symbol (currently '" + test[0] + ("') needs to be '{' and the last symbol "
"(currently '") + test[len(test)-1] + "') needs to be '}'. Therefore the block is not valid."
return False