コード例 #1
0
def main(data):

    data = expand_data(data)

    rules = json.load(open(const101.rulesDump))

    interpretRules.apply_rules(data['data'], rules, lambda rule: not any(filter(lambda key: key in ('predicate', 'fpredicate', 'content', 'locator'), rule['rule'].keys())), False)
コード例 #2
0
ファイル: __init__.py プロジェクト: GitHubTianPeng/101worker
def main(data):
    print data
    data = expand_data(data)

    rules = json.load(open(const101.rulesDump))

    fpredicate_rules = interpretRules.group_fast_predicates(rules)


    interpretRules.apply_rules(data['data'], fpredicate_rules, lambda rule: rule['rule']['fpredicate'] == "technologies/fpredicate_generic_platform/import.py", append=True)
コード例 #3
0
ファイル: __init__.py プロジェクト: GitHubTianPeng/101worker
def main(data):
    print 'match tokens'

    logging.basicConfig(filename='matchSimpleRules.log',level=logging.DEBUG)

    data = expand_data(data)

    rules = json.load(open(const101.rulesDump))
    fpredicate_rules = interpretRules.group_fast_predicates(rules)
    print fpredicate_rules

    interpretRules.apply_rules(data['data'], fpredicate_rules, lambda rule: lambda rule: rule['rule']['fpredicate'] == "technologies/fpredicate_generic_platform/tokens.py", append=True)
コード例 #4
0
ファイル: __init__.py プロジェクト: Max1412/101worker
def main(data):
    print data
    data = expand_data(data)

    rules = json.load(open(const101.rulesDump))

    fpredicate_rules = interpretRules.group_fast_predicates(rules)

    interpretRules.apply_rules(
        data['data'],
        fpredicate_rules,
        lambda rule: rule['rule']['fpredicate'] ==
        "technologies/fpredicate_generic_platform/import.py",
        append=True)
コード例 #5
0
ファイル: __init__.py プロジェクト: Max1412/101worker
def main(data):
    print 'match tokens'

    logging.basicConfig(filename='matchSimpleRules.log', level=logging.DEBUG)

    data = expand_data(data)

    rules = json.load(open(const101.rulesDump))
    fpredicate_rules = interpretRules.group_fast_predicates(rules)
    print fpredicate_rules

    interpretRules.apply_rules(
        data['data'],
        fpredicate_rules,
        lambda rule: lambda rule: rule['rule']['fpredicate'] ==
        "technologies/fpredicate_generic_platform/tokens.py",
        append=True)