Update of /cvsroot/freevo/freevo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2495/src
Modified Files: config.py item.py osd.py Log Message: fix unicode handling Index: config.py =================================================================== RCS file: /cvsroot/freevo/freevo/src/config.py,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** config.py 5 Feb 2004 02:52:20 -0000 1.93 --- config.py 5 Feb 2004 19:26:41 -0000 1.94 *************** *** 23,26 **** --- 23,29 ---- # ----------------------------------------------------------------------- # $Log$ + # Revision 1.94 2004/02/05 19:26:41 dischi + # fix unicode handling + # # Revision 1.93 2004/02/05 02:52:20 gsbarbieri # Handle filenames internally as unicode objects. *************** *** 862,871 **** encoding = os.environ[ 'LC_ALL' ].split( '.' )[ 1 ] except: ! encoding = sys.getdefaultencoding() ! print "WARNING:" + \ ! "Could not determine system encoding! Did look in FREEVO_LOCALE, LANG and LC_ALL environment variables for 'language.encoding' pair, but nothing found! Using %s" % encoding if not encoding: ! encoding = sys.getdefaultencoding() _debug_( "Using '%s' encoding" % encoding ) --- 865,872 ---- encoding = os.environ[ 'LC_ALL' ].split( '.' )[ 1 ] except: ! encoding = LOCALE if not encoding: ! encoding = LOCALE _debug_( "Using '%s' encoding" % encoding ) Index: item.py =================================================================== RCS file: /cvsroot/freevo/freevo/src/item.py,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** item.py 5 Feb 2004 07:17:23 -0000 1.63 --- item.py 5 Feb 2004 19:26:41 -0000 1.64 *************** *** 10,13 **** --- 10,16 ---- # ----------------------------------------------------------------------- # $Log$ + # Revision 1.64 2004/02/05 19:26:41 dischi + # fix unicode handling + # # Revision 1.63 2004/02/05 07:17:23 gsbarbieri # typo *************** *** 110,114 **** import gettext import shutil - import util.mediainfo import config --- 113,116 ---- *************** *** 117,120 **** --- 119,124 ---- import util + from util import mediainfo, vfs, Unicode + class FileInformation: """ *************** *** 202,209 **** self.parent = parent # parent item to pass unmapped event self.icon = None ! if info and isinstance(info, util.mediainfo.Info): self.info = copy.copy(info) else: ! self.info = util.mediainfo.Info(None, None, info) self.menuw = None self.description = '' --- 206,213 ---- self.parent = parent # parent item to pass unmapped event self.icon = None ! if info and isinstance(info, mediainfo.Info): self.info = copy.copy(info) else: ! self.info = mediainfo.Info(None, None, info) self.menuw = None self.description = '' *************** *** 242,246 **** if skin_info.has_key(skin_type): skin_info = skin_info[skin_type] ! self.name = skin_info.name self.image = skin_info.image if skin_info.icon: --- 246,250 ---- if skin_info.has_key(skin_type): skin_info = skin_info[skin_type] ! self.name = Unicode(skin_info.name) self.image = skin_info.image if skin_info.icon: *************** *** 289,304 **** self.mimetype = self.filename[self.filename.rfind('.')+1:].lower() if info: ! self.info = util.mediainfo.get(self.filename) try: if self.parent.DIRECTORY_USE_MEDIAID_TAG_NAMES: self.name = self.info['title'] or self.name - if type( self.name ) == str: - try: - self.name = unicode( self.name, config.encoding ) - except UnicodeDecodeError, e: - _debug_( "WARNING: " + \ - "Could not convert %s to unicode using \"%s\" encoding: %s" % \ - ( repr( self.name ), encoding, e ) - ) except: pass --- 293,300 ---- self.mimetype = self.filename[self.filename.rfind('.')+1:].lower() if info: ! self.info = mediainfo.get(self.filename) try: if self.parent.DIRECTORY_USE_MEDIAID_TAG_NAMES: self.name = self.info['title'] or self.name except: pass *************** *** 313,317 **** self.mimetype = self.type if not self.name: ! self.name = self.url --- 309,313 ---- self.mimetype = self.type if not self.name: ! self.name = Unicode(self.url) *************** *** 335,339 **** store the key/value in metadata """ ! if isinstance(self.info, util.mediainfo.Info): if not self.info.store(key, value): _debug_('unable to store info for \'%s\'' % self.name, 0) --- 331,335 ---- store the key/value in metadata """ ! if isinstance(self.info, mediainfo.Info): if not self.info.store(key, value): _debug_('unable to store info for \'%s\'' % self.name, 0) *************** *** 346,350 **** delete entry for metadata """ ! if isinstance(self.info, util.mediainfo.Info): return self.info.delete(key) else: --- 342,346 ---- delete entry for metadata """ ! if isinstance(self.info, mediainfo.Info): return self.info.delete(key) else: *************** *** 517,528 **** else: r = self.__getitem__(attr) ! if type( r ) == str: ! try: ! r = unicode( r, config.encoding ) ! except UnicodeDecodeError, e: ! _debug_( "WARNING: " + \ ! "Could not convert %s to unicode using \"%s\" encoding: %s" % \ ! ( repr( r ), encoding, e ) ! ) ! ! return r --- 513,515 ---- else: r = self.__getitem__(attr) ! return Unicode(r) Index: osd.py =================================================================== RCS file: /cvsroot/freevo/freevo/src/osd.py,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** osd.py 5 Feb 2004 02:52:25 -0000 1.132 --- osd.py 5 Feb 2004 19:26:41 -0000 1.133 *************** *** 11,14 **** --- 11,17 ---- # ----------------------------------------------------------------------- # $Log$ + # Revision 1.133 2004/02/05 19:26:41 dischi + # fix unicode handling + # # Revision 1.132 2004/02/05 02:52:25 gsbarbieri # Handle filenames internally as unicode objects. *************** *** 1261,1267 **** return None - if type( url ) == unicode: - url = url.encode( config.encoding ) - thumbnail = False filename = url --- 1264,1267 ---- ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Freevo-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freevo-cvslog