Esempio n. 1
0
    def hasCBI(self):
        if self.has_cbi is None:

            #if ( not ( self.isZip() or self.isRar()) or not self.seemsToBeAComicArchive() ):
            if not self.seemsToBeAComicArchive():
                self.has_cbi = False
            else:
                comment = self.archiver.getArchiveComment()
                self.has_cbi = ComicBookInfo().validateString(comment)

        return self.has_cbi
Esempio n. 2
0
    def readCBI(self):
        if self.cbi_md is None:
            raw_cbi = self.readRawCBI()
            if raw_cbi is None:
                self.cbi_md = GenericMetadata()
            else:
                self.cbi_md = ComicBookInfo().metadataFromString(raw_cbi)

            self.cbi_md.setDefaultPageList(self.getNumberOfPages())

        return self.cbi_md
Esempio n. 3
0
 def writeCBI(self, metadata):
     if metadata is not None:
         self.applyArchiveInfoToMetadata(metadata)
         cbi_string = ComicBookInfo().stringFromMetadata(metadata)
         write_success = self.archiver.setArchiveComment(cbi_string)
         if write_success:
             self.has_cbi = True
             self.cbi_md = metadata
         self.resetCache()
         return write_success
     else:
         return False