Example #1
0
    def __setitem__(self,key,value):
        if key.startswith('__'):

            if key == '__image':
                self.images = value
            elif key in fn_hash:
                setattr(self, fn_hash[key], value)
            elif key == '__total' and 'track' in self:
                if set_total(self, value):
                    return
            return
        elif isempty(value):
            del(self[key])
        elif key in self.__rtranslate:
            self.__tags[key] = unicode_list(value)
Example #2
0
 def __setitem__(self, key, value):
     if key.startswith('__'):
         if key == '__image':
             self.images = value
         elif key == '__total':
             set_total(self, value)
         elif key in fn_hash:
             setattr(self, fn_hash[key], value)
     elif isempty(value):
         if key in self:
             del(self[key])
         else:
             return
     else:
         if isinstance(value, (int, long)):
             self.__tags[key.lower()] = [unicode(value)]
         else:
             self.__tags[key.lower()] = unicode_list(value)
Example #3
0
        def __setitem__(self, key, value):
            if not isinstance(key, basestring):
                self.__tags[key] = value
                return
            if key.startswith('__'):
                if key == '__image':
                    self.images = value
                elif key in fn_hash:
                    setattr(self, fn_hash[key], value)
                elif key == '__total':
                    set_total(self, value)
                return

            value = unicode_list(value)

            if isempty(value):
                if key in self:
                    del (self[key])
                return

            if key in self.__tags:
                self.__tags[key].set_value(value)
            else:
                if key in write_frames:
                    self.__tags.update(write_frames[key](value))
                elif key == u'comment':
                    frame = {'comment': create_comment('', value)['comment:']}
                    self.__tags.update(frame)
                elif key.startswith('comment:'):
                    self.__tags.update(
                        create_comment(key[len('comment:'):], value))
                elif key.startswith('www:'):
                    self.__tags.update(create_userurl(key, value))
                elif key.startswith('ufid:'):
                    self.__tags.update(create_ufid(key, value))
                elif key.startswith('rgain:'):
                    self.__tags.update(create_rgain(key, value))
                elif key.startswith('unsyncedlyrics:'):
                    self.__tags.update(create_uslt(key, value))
                else:
                    self.__tags.update(create_usertext(key, value))
Example #4
0
        def __setitem__(self, key, value):

            if key == '__image':
                self.images = value
                return

            if key.startswith('__'):
                if key == '__image':
                    self.images = value
                elif key == '__total':
                    set_total(self, value)
                elif key in fn_hash:
                    setattr(self, fn_hash[key], value)
                return
            elif isempty(value):
                if key in self:
                    del (self[key])
            else:
                value = unicode_list(value)
                if isempty(value): return
                self.__tags[key] = value
Example #5
0
        def __setitem__(self, key, value):
            
            if key == '__image':
                self.images = value
                return

            if key.startswith('__'):
                if key == '__image':
                    self.images = value
                elif key == '__total':
                    set_total(self, value)
                elif key in fn_hash:
                    setattr(self, fn_hash[key], value)
                return
            elif isempty(value):
                if key in self:
                    del(self[key])
            else:
                value = unicode_list(value)
                if isempty(value): return
                self.__tags[key] = value
Example #6
0
        def __setitem__(self, key, value):
            if not isinstance(key, basestring):
                self.__tags[key] = value
                return
            if key.startswith('__'):
                if key == '__image':
                    self.images = value
                elif key in fn_hash:
                    setattr(self, fn_hash[key], value)
                elif key == '__total':
                    set_total(self, value)
                return

            value = unicode_list(value)

            if isempty(value):
                if key in self:
                    del(self[key])
                return

            if key in self.__tags:
                self.__tags[key].set_value(value)
            else:
                if key in write_frames:
                    self.__tags.update(write_frames[key](value))
                elif key == u'comment':
                    frame = {'comment': create_comment('', value)['comment:']}
                    self.__tags.update(frame)
                elif key.startswith('comment:'):
                    self.__tags.update(create_comment(key[len('comment:'):], value))
                elif key.startswith('www:'):
                    self.__tags.update(create_userurl(key, value))
                elif key.startswith('ufid:'):
                    self.__tags.update(create_ufid(key, value))
                elif key.startswith('rgain:'):
                    self.__tags.update(create_rgain(key, value))
                elif key.startswith('unsyncedlyrics:'):
                    self.__tags.update(create_uslt(key, value))
                else:
                    self.__tags.update(create_usertext(key, value))