Changeset 9597

Show
Ignore:
Timestamp:
05/08/08 23:18:39 (3 months ago)
Author:
steve-e
Message:

Coding standards.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/roster_window.py

    r9595 r9597  
    247247                 
    248248                         
    249 ################################################################################                 
     249#############################################################################            
    250250### Methods for adding and removing roster window items 
    251 ################################################################################ 
     251############################################################################# 
    252252         
    253253        def add_account(self, account): 
     
    318318 
    319319         
    320         def _add_entity(self, contact, account, groups = None, big_brother_contact = None,  
    321         big_brother_account = None): 
     320        def _add_entity(self, contact, account, groups = None, 
     321        big_brother_contact = None, big_brother_account = None): 
    322322                '''Add the given contact to roster data model. 
    323323                 
     
    418418                        all_iters = iters[:] 
    419419                        group_iters = [self._get_group_iter(group, account) for group in groups] 
    420                         iters = [iter for iter in all_iters if self.model.iter_parent(iter) in group_iters]  
     420                        iters = [iter for iter in all_iters  
     421                                if self.model.iter_parent(iter) in group_iters]  
    421422 
    422423                iter_children = self.model.iter_children(iters[0]) 
     
    462463                big_brother_jid = big_brother_data['jid'] 
    463464                big_brother_account = big_brother_data['account'] 
    464                 big_brother_contact = gajim.contacts.get_first_contact_from_jid(big_brother_account, big_brother_jid) 
    465  
    466                 assert len(self._get_contact_iter(big_brother_jid, big_brother_account, big_brother_contact, self.model)) == 0,\ 
     465                big_brother_contact = gajim.contacts.get_first_contact_from_jid( 
     466                        big_brother_account, big_brother_jid) 
     467 
     468                assert len(self._get_contact_iter(big_brother_jid, big_brother_account, 
     469                        big_brother_contact, self.model)) == 0,\ 
    467470                        "Big brother %s already in roster  \n Family: %s" % (big_brother_jid, family) 
    468471                self._add_entity(big_brother_contact, big_brother_account) 
     
    482485                                continue 
    483486                         
    484                         assert len(self._get_contact_iter(_jid, _account, _contact, self.model)) == 0,\ 
    485                                 "%s already in roster. \n Family: " % (_jid, nearby_family) 
     487                        assert len(self._get_contact_iter(_jid, _account, _contact, self.model) 
     488                                ) == 0, "%s already in roster. \n Family: " % (_jid, nearby_family) 
    486489                        self._add_entity(_contact, _account, big_brother_contact = big_brother_contact, 
    487490                                big_brother_account = big_brother_account) 
     
    518521                                # Only try to remove what is actually in the roster 
    519522                                continue 
    520                         assert iters, "%s shall be removed but is not in roster \n Family: %s" % (_jid, family) 
     523                        assert iters, "%s shall be removed but is not in roster \ 
     524                                \n Family: %s" % (_jid, family) 
    521525 
    522526                        family_in_roster = True 
     
    540544                        return False 
    541545 
    542                 iters = self._get_contact_iter(old_big_jid, old_big_account, old_big_contact, self.model) 
     546                iters = self._get_contact_iter(old_big_jid, old_big_account, old_big_contact, 
     547                        self.model) 
    543548                assert len(iters) > 0, "Old Big Brother %s is not in roster anymore" % old_big_jid 
    544549                assert not self.model.iter_children(iters[0]),\ 
     
    551556                ok = self._remove_entity(old_big_contact, old_big_account) 
    552557                assert ok, "Old Big Brother %s not removed" % old_big_jid 
    553                 assert len(self._get_contact_iter(old_big_jid, old_big_account, old_big_contact, self.model)) == 0,\ 
     558                assert len(self._get_contact_iter(old_big_jid, old_big_account, old_big_contact, 
     559                        self.model)) == 0,\ 
    554560                        "Old Big Brother %s is removed but still in roster" % old_big_jid 
    555561                         
     
    12201226                return False 
    12211227 
    1222 ################################################################################ 
     1228############################################################################## 
    12231229### Roster and Modelfilter handling 
    1224 ################################################################################                         
     1230##############################################################################                   
    12251231                 
    12261232        def _search_roster_func(self, model, column, key, iter): 
     
    20482054                gajim.events.add_event(account, fjid, event) 
    20492055                if popup: 
    2050                         # FIXME: What is happening here. What does "OR he is not in the roster at all" mean 
     2056                        # FIXME: What is happening here. 
     2057                        # What does "OR he is not in the roster at all" mean 
    20512058                        if not ctrl: 
    20522059                                gajim.interface.new_chat(contact, account, \ 
     
    34823489 
    34833490        def on_model_row_has_child_toggled(self, model, path, iter): 
    3484                 '''This signal is emitted when a row has gotten the first child row or lost its last child row. 
     3491                '''Called when a row has gotten the first or lost its last child row. 
     3492 
    34853493                Expand Parent if necessary. 
    34863494                ''' 
     
    57525760                self._music_track_changed_signal = None 
    57535761                gajim.interface.msg_win_mgr = MessageWindowMgr(self.window, self.hpaned) 
    5754                 gajim.interface.msg_win_mgr.connect('window-delete', self.on_message_window_delete) 
     5762                gajim.interface.msg_win_mgr.connect('window-delete', 
     5763                        self.on_message_window_delete) 
    57555764                self.advanced_menus = [] # We keep them to destroy them 
    57565765                if gajim.config.get('roster_window_skip_taskbar'): 
     
    57995808                self.modelfilter = self.model.filter_new() 
    58005809                self.modelfilter.set_visible_func(self._visible_func) 
    5801                  
    5802                  
    5803                 self.modelfilter.connect('row-has-child-toggled', self.on_model_row_has_child_toggled) 
     5810                self.modelfilter.connect('row-has-child-toggled', 
     5811                        self.on_model_row_has_child_toggled) 
     5812                self.tree.set_model(self.modelfilter) 
    58045813                # Workaroung: For strange reasons signal is behaving like row-changed 
    58055814                self._toggeling_row = False 
    5806                  
    5807                 self.tree.set_model(self.modelfilter) 
    58085815 
    58095816                # when this value become 0 we quit main application. If it's more than 0 
     
    58385845                for show in ('online', 'chat', 'away', 'xa', 'dnd', 'invisible'): 
    58395846                        uf_show = helpers.get_uf_show(show) 
    5840                         liststore.append([uf_show, gajim.interface.jabber_state_images['16'][show], show, 
    5841                                 True]) 
     5847                        liststore.append([uf_show, gajim.interface.jabber_state_images['16'][show], 
     5848                                show, True]) 
    58425849                # Add a Separator (self._iter_is_separator() checks on string SEPARATOR) 
    58435850                liststore.append(['SEPARATOR', None, '', True])