def __unicode__(self): if ('Cuesheet' not in self.keys()): return ApeTag.__unicode__(self) else: import cue try: return u"%s%sCuesheet:\n%s" % \ (MetaData.__unicode__(self), os.linesep * 2, sheet_to_unicode( cue.parse( cue.tokens(unicode(self['Cuesheet']).encode( 'ascii', 'replace'))), self.frame_count)) except cue.CueException: return ApeTag.__unicode__(self)
def get_cuesheet(self): import cue metadata = self.get_metadata() if ((metadata is not None) and ('Cuesheet' in metadata.keys())): try: return cue.parse( cue.tokens( unicode(metadata['Cuesheet']).encode( 'utf-8', 'replace'))) except cue.CueException: #unlike FLAC, just because a cuesheet is embedded #does not mean it is compliant return None else: return None
def get_cuesheet(self): """Returns the embedded Cuesheet-compatible object, or None. Raises IOError if a problem occurs when reading the file.""" import cue metadata = self.get_metadata() if ((metadata is not None) and ('Cuesheet' in metadata.keys())): try: return cue.parse(cue.tokens( unicode(metadata['Cuesheet']).encode('utf-8', 'replace'))) except cue.CueException: #unlike FLAC, just because a cuesheet is embedded #does not mean it is compliant return None else: return None
def get_cuesheet(self): """Returns the embedded Cuesheet-compatible object, or None. Raises IOError if a problem occurs when reading the file.""" import cue metadata = self.get_metadata() if ((metadata is not None) and ('Cuesheet' in metadata.keys())): try: return cue.parse( cue.tokens( unicode(metadata['Cuesheet']).encode( 'utf-8', 'replace'))) except cue.CueException: #unlike FLAC, just because a cuesheet is embedded #does not mean it is compliant return None else: return None