當前位置: 首頁>>代碼示例>>Python>>正文


Python Rule.load_rules方法代碼示例

本文整理匯總了Python中rule.Rule.load_rules方法的典型用法代碼示例。如果您正苦於以下問題:Python Rule.load_rules方法的具體用法?Python Rule.load_rules怎麽用?Python Rule.load_rules使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rule.Rule的用法示例。


在下文中一共展示了Rule.load_rules方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: rules

# 需要導入模塊: from rule import Rule [as 別名]
# 或者: from rule.Rule import load_rules [as 別名]
def rules(rule_id=None):
	""" Returns all available rules """
	record = _testrecord_from_request(bottle.request)
	return json.dumps(Rule.load_rules(record), cls=JSONRuleEncoder)
開發者ID:p2,項目名稱:ae-reporting,代碼行數:6,代碼來源:wsgi.py

示例2: forever_alone

# 需要導入模塊: from rule import Rule [as 別名]
# 或者: from rule.Rule import load_rules [as 別名]

def forever_alone():
	with open('forever.txt') as handle:
		return handle.read()


# if run as a script, we kick in here
if __name__ == "__main__":
	UMLS.import_snomed_if_necessary()
	
	if _BG:
		print "->  Running as a background app"
	
	# load all rules
	rules = Rule.load_rules()
	if len(rules) < 1:
		print "There are no rules, no point in continuing"
		print forever_alone()
		sys.exit(1)
	print "->  Did load %d %s" % (len(rules), 'rule' if 1 == len(rules) else 'rules')
	
	# multiple endpoints? Ask which one to use
	ep = None
	if len(ENDPOINTS) > 1:
		print "->  These are the available SMART containers:"
		i = 0
		for dictionary in ENDPOINTS:
			i += 1
			print '    [%d]  %s (%s)' % (i, dictionary.get('name'), dictionary.get('url'))
		
開發者ID:p2,項目名稱:ae-reporting,代碼行數:31,代碼來源:run.py


注:本文中的rule.Rule.load_rules方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。