示例#1
0
    def ingest_all_at_path(self, path):
        facts = {}
        p = path_mod(path)

        for f in p.files():
            fact = Fact.from_file(f)
            facts[fact.fact_id] = fact

        return facts
示例#2
0
    def ingest_all_at_path(self, path):
        facts = {}
        p = path_mod(path)

        for f in p.files():
            fact = Fact.from_file(f)
            facts[fact.fact_id] = fact

        return facts
示例#3
0
 def write(self, fact):
     path = fact.get_path()
     abs_path = path_mod(self.path) / path
     f = file(abs_path, 'w')
     data = fact.metadata
     data['fact_type'] = fact.fact_type
     data['name'] = fact.name
     f.write("-- %s\n" % (json.dumps(data)))
     f.write(fact.body)
     f.close()
示例#4
0
 def write(self, fact):
     path = fact.get_path()
     abs_path = path_mod(self.path) / path
     f = file(abs_path, "w")
     data = fact.metadata
     data["fact_type"] = fact.fact_type
     data["name"] = fact.name
     f.write("-- %s\n" % (json.dumps(data)))
     f.write(fact.body)
     f.close()