Changeset 10534

Show
Ignore:
Timestamp:
10/14/08 17:33:20 (6 weeks ago)
Author:
js
Message:

Merge with trunk r10533.

Location:
branches/osx_newbuildsys
Files:
1 removed
76 modified

Legend:

Unmodified
Added
Removed
  • branches/osx_newbuildsys/setup_osx.py

    r10247 r10534  
    7171 
    7272def check(ret): 
    73         if type(ret) == types.ListType: 
     73        if isinstance(ret, list): 
    7474                if ret[0] != 0: 
    7575                        raise Exception("Command failed: " + ret[1]) 
    76         elif type(ret) == types.IntType: 
     76        elif isinstance(ret, int): 
    7777                if ret != 0: 
    7878                        raise Exception("Command failed") 
     
    8383        try: 
    8484                func() 
    85         except: 
     85        except Exception: 
    8686                pass 
    8787        return 
     
    8989 
    9090def writeScript(filename, contents): 
    91         script = file(filename, "w+") 
     91        script = open(filename, "w+") 
    9292        script.write(contents) 
    9393        script.close() 
     
    149149        move("dist/Gajim.app/Contents/Resources/__boot__.py", 
    150150                 "dist/Gajim.app/Contents/Resources/__boot__.py.org") 
    151         new = file("dist/Gajim.app/Contents/Resources/__boot__.py", "w+") 
    152         org = file("dist/Gajim.app/Contents/Resources/__boot__.py.org") 
     151        new = open("dist/Gajim.app/Contents/Resources/__boot__.py", "w+") 
     152        org = open("dist/Gajim.app/Contents/Resources/__boot__.py.org") 
    153153        for line in org: 
    154154                new.write(line) 
  • branches/osx_newbuildsys/src/advanced.py

    r10501 r10534  
    103103                gajim.interface.instances['advanced_config'] = self 
    104104 
    105         def cb_value_column_data(self, col, cell, model, iter): 
     105        def cb_value_column_data(self, col, cell, model, iter_): 
    106106                '''check if it's boolen or holds password stuff and if yes 
    107107                make the cellrenderertext not editable else it's editable''' 
    108                 optname = model[iter][C_PREFNAME] 
    109                 opttype = model[iter][C_TYPE] 
     108                optname = model[iter_][C_PREFNAME] 
     109                opttype = model[iter_][C_TYPE] 
    110110                if opttype == self.types['boolean'] or optname == 'password': 
    111111                        cell.set_property('editable', False) 
     
    113113                        cell.set_property('editable', True) 
    114114 
    115         def get_option_path(self, model, iter): 
     115        def get_option_path(self, model, iter_): 
    116116                # It looks like path made from reversed array 
    117117                # path[0] is the true one optname 
     
    119119                # path[2] is the root of tree 
    120120                # last two is optional 
    121                 path = [model[iter][0].decode('utf-8')] 
    122                 parent = model.iter_parent(iter) 
     121                path = [model[iter_][0].decode('utf-8')] 
     122                parent = model.iter_parent(iter_) 
    123123                while parent: 
    124124                        path.append(model[parent][0].decode('utf-8')) 
     
    250250                model.append(iter, [name, value, type]) 
    251251 
    252         def visible_func(self, model, iter): 
     252        def visible_func(self, model, iter_): 
    253253                str = self.entry.get_text().decode('utf-8') 
    254254                if str in (None, ''): 
    255255                        return True # show all 
    256                 name = model[iter][C_PREFNAME].decode('utf-8') 
     256                name = model[iter_][C_PREFNAME].decode('utf-8') 
    257257                # If a child of the iter matches, we return True 
    258                 if model.iter_has_child(iter): 
    259                         iterC = model.iter_children(iter) 
     258                if model.iter_has_child(iter_): 
     259                        iterC = model.iter_children(iter_) 
    260260                        while iterC: 
    261261                                nameC = model[iterC][C_PREFNAME].decode('utf-8') 
  • branches/osx_newbuildsys/src/cell_renderer_image.py

    r10250 r10534  
    4646                return getattr(self, pspec.name) 
    4747 
    48         def func(self, model, path, iter, (image, tree)): 
    49                 if model.get_value(iter, self.tv_index) != image: 
     48        def func(self, model, path, iter_, image_tree): 
     49                image, tree = image_tree         
     50                if model.get_value(iter_, self.tv_index) != image: 
    5051                        return 
    5152                self.redraw = 1 
  • branches/osx_newbuildsys/src/chat_control.py

    r10501 r10534  
    5757        import gtkspell 
    5858        HAS_GTK_SPELL = True 
    59 except: 
     59except Exception: 
    6060        HAS_GTK_SPELL = False 
    6161 
     
    282282                                        try: 
    283283                                                spell.set_language(langs[lang]) 
    284                                         except: 
     284                                        except Exception: 
    285285                                                del langs[lang] 
    286286                                # now set the one the user selected 
     
    594594                return False 
    595595 
    596         def send_message(self, message, keyID = '', type = 'chat', chatstate = None, 
     596        def send_message(self, message, keyID = '', type_ = 'chat', chatstate = None, 
    597597        msg_id = None, composing_xep = None, resource = None, 
    598598        process_command = True): 
     
    605605 
    606606                if not process_command or not self._process_command(message): 
    607                         ret = MessageControl.send_message(self, message, keyID, type = type, 
     607                        ret = MessageControl.send_message(self, message, keyID, type_ = type_, 
    608608                                chatstate = chatstate, msg_id = msg_id, 
    609609                                composing_xep = composing_xep, resource = resource, 
     
    17211721 
    17221722                id = ChatControlBase.send_message(self, message, keyID, 
    1723                         type = 'chat', chatstate = chatstate_to_send, 
     1723                        type_ = 'chat', chatstate = chatstate_to_send, 
    17241724                        composing_xep = composing_xep, 
    17251725                        process_command = process_command) 
     
    23432343                        self.contact, 'notexistant'): 
    23442344                                self.begin_e2e_negotiation() 
    2345                                 self.no_autonegotiation = True 
    23462345                else: 
    23472346                        self.send_chatstate('active', self.contact) 
     
    25782577 
    25792578        def begin_e2e_negotiation(self): 
     2579                self.no_autonegotiation = True 
     2580 
    25802581                if not self.session: 
    25812582                        fjid = self.contact.get_full_jid() 
  • branches/osx_newbuildsys/src/common/atom.py

    r10501 r10534  
    108108                try: 
    109109                        return self.getTag('feed').getTags('link',{'rel':'alternate'})[1].getData() 
    110                 except: 
     110                except Exception: 
    111111                        return None 
    112112 
     
    125125                or without rel attribute). ''' 
    126126                for element in self.getTags('link'): 
    127                         if 'rel' in element.attrs and element.attrs['rel']<>'alternate': continue 
     127                        if 'rel' in element.attrs and element.attrs['rel']!='alternate': continue 
    128128                        try: 
    129129                                return element.attrs['href'] 
  • branches/osx_newbuildsys/src/common/caps.py

    r10433 r10534  
    9090                        #   (strings given in xmpppy)? 
    9191                        __names = {} 
    92                         def __init__(ciself, hash_method, hash): 
     92                        def __init__(ciself, hash_method, hash_): 
    9393                                # cached into db 
    9494                                ciself.hash_method = hash_method 
    95                                 ciself.hash = hash 
     95                                ciself.hash = hash_ 
    9696                                ciself._features = [] 
    9797                                ciself._identities = [] 
     
    175175                return x 
    176176 
    177         def preload(self, con, jid, node, hash_method, hash): 
     177        def preload(self, con, jid, node, hash_method, hash_): 
    178178                ''' Preload data about (node, ver, exts) caps using disco 
    179179                query to jid using proper connection. Don't query if 
    180180                the data is already in cache. ''' 
    181181                if hash_method == 'old': 
    182                         q = self[(hash_method, node + '#' + hash)] 
     182                        q = self[(hash_method, node + '#' + hash_)] 
    183183                else: 
    184                         q = self[(hash_method, hash)] 
     184                        q = self[(hash_method, hash_)] 
    185185 
    186186                if q.queried==0: 
     
    191191                                con.discoverInfo(jid) 
    192192                        else: 
    193                                 con.discoverInfo(jid, '%s#%s' % (node, hash)) 
     193                                con.discoverInfo(jid, '%s#%s' % (node, hash_)) 
    194194 
    195195        def is_supported(self, contact, feature): 
     
    229229                # for disco... so that disco will learn how to interpret 
    230230                # these caps 
     231                pm_ctrl = None 
    231232                jid = helpers.get_full_jid_from_iq(presence) 
    232233                contact = gajim.contacts.get_contact_from_full_jid(self.name, jid) 
     
    235236                        contact = gajim.contacts.get_gc_contact( 
    236237                                self.name, room_jid, nick) 
     238                        pm_ctrl = gajim.interface.msg_win_mgr.get_control(jid, self.name) 
    237239                        if contact is None: 
    238240                                # TODO: a way to put contact not-in-roster 
     
    268270                contact.caps_hash_method = hash_method 
    269271                contact.caps_hash = hash 
     272                if pm_ctrl: 
     273                        pm_ctrl.update_contact() 
    270274 
    271275        def _capsDiscoCB(self, jid, node, identities, features, dataforms): 
  • branches/osx_newbuildsys/src/common/commands.py

    r10501 r10534  
    122122                        form = dataforms.SimpleDataForm(extend = request.getTag('command').\ 
    123123                                getTag('x')) 
    124                 except: 
     124                except Exception: 
    125125                        self.badRequest(request) 
    126126                        return False 
     
    132132                                self.badRequest(request) 
    133133                                return False 
    134                 except: # KeyError if there's no presence-type field in form or 
     134                except Exception:       # KeyError if there's no presence-type field in form or 
    135135                        # AttributeError if that field is of wrong type 
    136136                        self.badRequest(request) 
     
    139139                try: 
    140140                        presencedesc = form['presence-desc'].value 
    141                 except: # same exceptions as in last comment 
     141                except Exception:       # same exceptions as in last comment 
    142142                        presencedesc = u'' 
    143143 
     
    220220                        form = dataforms.SimpleDataForm(extend = request.getTag('command').\ 
    221221                                getTag('x')) 
    222                 except: 
     222                except Exception: 
    223223                        self.badRequest(request) 
    224224                        return False 
     
    226226                try: 
    227227                        gc = form['groupchats'].values 
    228                 except: # KeyError if there's no groupchats in form 
     228                except Exception:       # KeyError if there's no groupchats in form 
    229229                        self.badRequest(request) 
    230230                        return False 
     
    241241                                        continue 
    242242                                gc_control.parent_win.remove_tab(gc_control, None, force = True) 
    243                 except: # KeyError if there's no such room opened 
     243                except Exception:       # KeyError if there's no such room opened 
    244244                        self.badRequest(request) 
    245245                        return False 
     
    272272                        for event in events[jid]: 
    273273                                self.connection.send_message(j, event.parameters[0], '', 
    274                                         type=event.type_, subject=event.parameters[1], 
     274                                        type_=event.type_, subject=event.parameters[1], 
    275275                                        resource=resource, forward_from=jid, delayed=event.time_) 
    276276 
  • branches/osx_newbuildsys/src/common/config.py

    r10501 r10534  
    482482                try: 
    483483                        ival = int(val) 
    484                 except: 
     484                except Exception: 
    485485                        return None 
    486486                return ival 
     
    503503                return val 
    504504 
    505         def is_valid(self, type, val): 
    506                 if not type: 
    507                         return None 
    508                 if type[0] == 'boolean': 
     505        def is_valid(self, type_, val): 
     506                if not type_: 
     507                        return None 
     508                if type_[0] == 'boolean': 
    509509                        return self.is_valid_bool(val) 
    510                 elif type[0] == 'integer': 
     510                elif type_[0] == 'integer': 
    511511                        return self.is_valid_int(val) 
    512                 elif type[0] == 'string': 
     512                elif type_[0] == 'string': 
    513513                        return self.is_valid_string(val) 
    514514                else: 
    515                         if re.match(type[1], val): 
     515                        if re.match(type_[1], val): 
    516516                                return val 
    517517                        else: 
  • branches/osx_newbuildsys/src/common/connection_handlers.py

    r10501 r10534  
    6868try: 
    6969        import idle 
    70 except: 
     70except Exception: 
    7171        gajim.log.debug(_('Unable to load idle module')) 
    7272        HAS_IDLE = False 
     
    154154                if not self.connection or self.connected < 2: 
    155155                        return 
    156                 if type(self.peerhost) != tuple: 
     156                if not isinstance(self.peerhost, tuple): 
    157157                        return 
    158158                port = gajim.config.get('file_transfers_port') 
     
    462462                try: 
    463463                        streamhost = query.getTag('streamhost-used') 
    464                 except: # this bytestream result is not what we need 
     464                except Exception: # this bytestream result is not what we need 
    465465                        pass 
    466466                id = real_id[3:] 
     
    471471                if streamhost is None: 
    472472                        # proxy approves the activate query 
    473                         if real_id[:3] == 'au_': 
     473                        if real_id.startswith('au_'): 
    474474                                id = real_id[3:] 
    475475                                if 'streamhost-used' not in file_props or \ 
     
    489489                        raise common.xmpp.NodeProcessed 
    490490 
    491                 if real_id[:3] == 'au_': 
     491                if real_id.startswith('au_'): 
    492492                        if 'stopped' in file and file_props['stopped']: 
    493493                                self.remove_transfer(file_props) 
     
    945945                try: 
    946946                        card = common.xmpp.Node(node = c) 
    947                 except: 
     947                except Exception: 
    948948                        # We are unable to parse it. Remove it 
    949949                        os.remove(path_to_file) 
     
    999999                                for j in vcard[i]: 
    10001000                                        iq3.addChild(j).setData(vcard[i][j]) 
    1001                         elif type(vcard[i]) == type([]): 
     1001                        elif isinstance(vcard[i], list): 
    10021002                                for j in vcard[i]: 
    10031003                                        iq3 = iq2.addChild(i) 
     
    11081108                                        try: 
    11091109                                                order = int(order) 
    1110                                         except: 
     1110                                        except Exception: 
    11111111                                                order = 0 
    11121112                                        if order is not None: 
     
    11751175                                photo_decoded = base64.decodestring(photo) 
    11761176                            &n