Ejemplo n.º 1
0
 def save(self):
     """
     Save the metadata for 'filename' - no questions asked
     """
     plugin.run('metadata_prepare', self)
     plugin.run('pre_metadata_save', self)
     with open(self.metafile, 'w') as F:
         F.write(yaml.dump(self.metadata, default_flow_style=False))
Ejemplo n.º 2
0
    def load(self):
        """
        Check if there is a metadata file for *filename*.

        If so - load
        if not - return an empty dict

        """
        if os.path.exists(self.metafile):
            G.debug("loading metadata")
            with open(self.metafile) as F:
                self.metadata = yaml.load(F)

        plugin.run('post_metadata_load', self)