def dump(self): """ Dump a representation of self to tgt_dir using two files: - a .yml for the rule data in YAML block format - a .RULE: the rule text as a UTF-8 file """ as_yaml = saneyaml.dump(self.asdict()) with codecs.open(self.data_file, 'wb', encoding='utf-8') as df: df.write(as_yaml)
def dump(self): """ Dump a representation of self to tgt_dir using two files: - a .yml for the rule data in YAML block format - a .RULE: the rule text as a UTF-8 file """ as_yaml = saneyaml.dump(self.asdict()) with codecs.open(self.data_file, "wb", encoding="utf-8") as df: df.write(as_yaml)
def dump(self): """ Dump a representation of self as multiple files named this way: - <key>.yml : the license data in YAML - <key>.LICENSE: the license text """ as_yaml = saneyaml.dump(self.to_dict()) self._write(self.data_file, as_yaml) if self.text: self._write(self.text_file, self.text)
def dump(self): """ Dump a representation of self to tgt_dir as two files: - a .yml for the rule data in YAML block format - a .RULE: the rule text as a UTF-8 file """ if self.data_file: as_yaml = saneyaml.dump(self.asdict()) with codecs.open(self.data_file, 'wb', encoding='utf-8') as df: df.write(as_yaml) with codecs.open(self.text_file, 'wb', encoding='utf-8') as tf: tf.write(self.text())