コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
ファイル: models.py プロジェクト: yudhik11/scancode-toolkit
 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)
コード例 #4
0
ファイル: models.py プロジェクト: ocabrisses/scancode-toolkit
 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)
コード例 #5
0
 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())