Changeset 10534
- Timestamp:
- 10/14/08 17:33:20 (6 weeks ago)
- Location:
- branches/osx_newbuildsys
- Files:
-
- 1 removed
- 76 modified
-
gajim.iss (deleted)
-
setup_osx.py (modified) (4 diffs)
-
src/advanced.py (modified) (4 diffs)
-
src/cell_renderer_image.py (modified) (1 diff)
-
src/chat_control.py (modified) (7 diffs)
-
src/common/atom.py (modified) (2 diffs)
-
src/common/caps.py (modified) (6 diffs)
-
src/common/commands.py (modified) (7 diffs)
-
src/common/config.py (modified) (2 diffs)
-
src/common/connection_handlers.py (modified) (16 diffs)
-
src/common/connection.py (modified) (10 diffs)
-
src/common/crypto.py (modified) (1 diff)
-
src/common/dataforms.py (modified) (4 diffs)
-
src/common/GnuPG.py (modified) (6 diffs)
-
src/common/helpers.py (modified) (17 diffs)
-
src/common/idle_c/Makefile (modified) (1 diff)
-
src/common/logger.py (modified) (3 diffs)
-
src/common/nslookup.py (modified) (4 diffs)
-
src/common/optparser.py (modified) (4 diffs)
-
src/common/pubsub.py (modified) (2 diffs)
-
src/common/sleepy.py (modified) (2 diffs)
-
src/common/socks5.py (modified) (11 diffs)
-
src/common/stanza_session.py (modified) (4 diffs)
-
src/common/xmpp/auth_nb.py (modified) (4 diffs)
-
src/common/xmpp/auth.py (modified) (3 diffs)
-
src/common/xmpp/browser.py (modified) (4 diffs)
-
src/common/xmpp/c14n.py (modified) (2 diffs)
-
src/common/xmpp/client_nb.py (modified) (2 diffs)
-
src/common/xmpp/client.py (modified) (3 diffs)
-
src/common/xmpp/commands.py (modified) (5 diffs)
-
src/common/xmpp/debug.py (modified) (8 diffs)
-
src/common/xmpp/dispatcher_nb.py (modified) (8 diffs)
-
src/common/xmpp/dispatcher.py (modified) (6 diffs)
-
src/common/xmpp/features.py (modified) (3 diffs)
-
src/common/xmpp/filetransfer.py (modified) (1 diff)
-
src/common/xmpp/protocol.py (modified) (9 diffs)
-
src/common/xmpp/roster.py (modified) (1 diff)
-
src/common/xmpp/session.py (modified) (7 diffs)
-
src/common/xmpp/simplexml.py (modified) (5 diffs)
-
src/common/xmpp/transports_nb.py (modified) (8 diffs)
-
src/common/xmpp/transports.py (modified) (5 diffs)
-
src/common/zeroconf/connection_handlers_zeroconf.py (modified) (10 diffs)
-
src/common/zeroconf/connection_zeroconf.py (modified) (5 diffs)
-
src/common/zeroconf/roster_zeroconf.py (modified) (1 diff)
-
src/common/zeroconf/zeroconf_bonjour.py (modified) (1 diff)
-
src/config.py (modified) (11 diffs)
-
src/conversation_textview.py (modified) (10 diffs)
-
src/dataforms_widget.py (modified) (1 diff)
-
src/dialogs.py (modified) (26 diffs)
-
src/disco.py (modified) (16 diffs)
-
src/features_window.py (modified) (11 diffs)
-
src/filetransfers_window.py (modified) (8 diffs)
-
src/gajim.py (modified) (22 diffs)
-
src/gajim-remote.py (modified) (7 diffs)
-
src/groupchat_control.py (modified) (17 diffs)
-
src/gtkexcepthook.py (modified) (2 diffs)
-
src/gtkgui_helpers.py (modified) (7 diffs)
-
src/htmltextview.py (modified) (9 diffs)
-
src/ipython_view.py (modified) (1 diff)
-
src/lastfm.py (modified) (2 diffs)
-
src/message_control.py (modified) (2 diffs)
-
src/message_window.py (modified) (17 diffs)
-
src/music_track_listener.py (modified) (5 diffs)
-
src/network_manager_listener.py (modified) (1 diff)
-
src/notify.py (modified) (6 diffs)
-
src/osx/growler.py (modified) (2 diffs)
-
src/osx/growl/Growl.py (modified) (2 diffs)
-
src/remote_control.py (modified) (4 diffs)
-
src/roster_window.py (modified) (15 diffs)
-
src/session.py (modified) (2 diffs)
-
src/systray.py (modified) (2 diffs)
-
src/tooltips.py (modified) (3 diffs)
-
src/vcard.py (modified) (1 diff)
-
test/lib/mock.py (modified) (3 diffs)
-
test/lib/mocks.py (modified) (1 diff)
-
test/runtests.py (modified) (1 diff)
-
test/test_misc_interface.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/osx_newbuildsys/setup_osx.py
r10247 r10534 71 71 72 72 def check(ret): 73 if type(ret) == types.ListType:73 if isinstance(ret, list): 74 74 if ret[0] != 0: 75 75 raise Exception("Command failed: " + ret[1]) 76 elif type(ret) == types.IntType:76 elif isinstance(ret, int): 77 77 if ret != 0: 78 78 raise Exception("Command failed") … … 83 83 try: 84 84 func() 85 except :85 except Exception: 86 86 pass 87 87 return … … 89 89 90 90 def writeScript(filename, contents): 91 script = file(filename, "w+")91 script = open(filename, "w+") 92 92 script.write(contents) 93 93 script.close() … … 149 149 move("dist/Gajim.app/Contents/Resources/__boot__.py", 150 150 "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") 153 153 for line in org: 154 154 new.write(line) -
branches/osx_newbuildsys/src/advanced.py
r10501 r10534 103 103 gajim.interface.instances['advanced_config'] = self 104 104 105 def cb_value_column_data(self, col, cell, model, iter ):105 def cb_value_column_data(self, col, cell, model, iter_): 106 106 '''check if it's boolen or holds password stuff and if yes 107 107 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] 110 110 if opttype == self.types['boolean'] or optname == 'password': 111 111 cell.set_property('editable', False) … … 113 113 cell.set_property('editable', True) 114 114 115 def get_option_path(self, model, iter ):115 def get_option_path(self, model, iter_): 116 116 # It looks like path made from reversed array 117 117 # path[0] is the true one optname … … 119 119 # path[2] is the root of tree 120 120 # 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_) 123 123 while parent: 124 124 path.append(model[parent][0].decode('utf-8')) … … 250 250 model.append(iter, [name, value, type]) 251 251 252 def visible_func(self, model, iter ):252 def visible_func(self, model, iter_): 253 253 str = self.entry.get_text().decode('utf-8') 254 254 if str in (None, ''): 255 255 return True # show all 256 name = model[iter ][C_PREFNAME].decode('utf-8')256 name = model[iter_][C_PREFNAME].decode('utf-8') 257 257 # 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_) 260 260 while iterC: 261 261 nameC = model[iterC][C_PREFNAME].decode('utf-8') -
branches/osx_newbuildsys/src/cell_renderer_image.py
r10250 r10534 46 46 return getattr(self, pspec.name) 47 47 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: 50 51 return 51 52 self.redraw = 1 -
branches/osx_newbuildsys/src/chat_control.py
r10501 r10534 57 57 import gtkspell 58 58 HAS_GTK_SPELL = True 59 except :59 except Exception: 60 60 HAS_GTK_SPELL = False 61 61 … … 282 282 try: 283 283 spell.set_language(langs[lang]) 284 except :284 except Exception: 285 285 del langs[lang] 286 286 # now set the one the user selected … … 594 594 return False 595 595 596 def send_message(self, message, keyID = '', type = 'chat', chatstate = None,596 def send_message(self, message, keyID = '', type_ = 'chat', chatstate = None, 597 597 msg_id = None, composing_xep = None, resource = None, 598 598 process_command = True): … … 605 605 606 606 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_, 608 608 chatstate = chatstate, msg_id = msg_id, 609 609 composing_xep = composing_xep, resource = resource, … … 1721 1721 1722 1722 id = ChatControlBase.send_message(self, message, keyID, 1723 type = 'chat', chatstate = chatstate_to_send,1723 type_ = 'chat', chatstate = chatstate_to_send, 1724 1724 composing_xep = composing_xep, 1725 1725 process_command = process_command) … … 2343 2343 self.contact, 'notexistant'): 2344 2344 self.begin_e2e_negotiation() 2345 self.no_autonegotiation = True2346 2345 else: 2347 2346 self.send_chatstate('active', self.contact) … … 2578 2577 2579 2578 def begin_e2e_negotiation(self): 2579 self.no_autonegotiation = True 2580 2580 2581 if not self.session: 2581 2582 fjid = self.contact.get_full_jid() -
branches/osx_newbuildsys/src/common/atom.py
r10501 r10534 108 108 try: 109 109 return self.getTag('feed').getTags('link',{'rel':'alternate'})[1].getData() 110 except :110 except Exception: 111 111 return None 112 112 … … 125 125 or without rel attribute). ''' 126 126 for element in self.getTags('link'): 127 if 'rel' in element.attrs and element.attrs['rel'] <>'alternate': continue127 if 'rel' in element.attrs and element.attrs['rel']!='alternate': continue 128 128 try: 129 129 return element.attrs['href'] -
branches/osx_newbuildsys/src/common/caps.py
r10433 r10534 90 90 # (strings given in xmpppy)? 91 91 __names = {} 92 def __init__(ciself, hash_method, hash ):92 def __init__(ciself, hash_method, hash_): 93 93 # cached into db 94 94 ciself.hash_method = hash_method 95 ciself.hash = hash 95 ciself.hash = hash_ 96 96 ciself._features = [] 97 97 ciself._identities = [] … … 175 175 return x 176 176 177 def preload(self, con, jid, node, hash_method, hash ):177 def preload(self, con, jid, node, hash_method, hash_): 178 178 ''' Preload data about (node, ver, exts) caps using disco 179 179 query to jid using proper connection. Don't query if 180 180 the data is already in cache. ''' 181 181 if hash_method == 'old': 182 q = self[(hash_method, node + '#' + hash )]182 q = self[(hash_method, node + '#' + hash_)] 183 183 else: 184 q = self[(hash_method, hash )]184 q = self[(hash_method, hash_)] 185 185 186 186 if q.queried==0: … … 191 191 con.discoverInfo(jid) 192 192 else: 193 con.discoverInfo(jid, '%s#%s' % (node, hash ))193 con.discoverInfo(jid, '%s#%s' % (node, hash_)) 194 194 195 195 def is_supported(self, contact, feature): … … 229 229 # for disco... so that disco will learn how to interpret 230 230 # these caps 231 pm_ctrl = None 231 232 jid = helpers.get_full_jid_from_iq(presence) 232 233 contact = gajim.contacts.get_contact_from_full_jid(self.name, jid) … … 235 236 contact = gajim.contacts.get_gc_contact( 236 237 self.name, room_jid, nick) 238 pm_ctrl = gajim.interface.msg_win_mgr.get_control(jid, self.name) 237 239 if contact is None: 238 240 # TODO: a way to put contact not-in-roster … … 268 270 contact.caps_hash_method = hash_method 269 271 contact.caps_hash = hash 272 if pm_ctrl: 273 pm_ctrl.update_contact() 270 274 271 275 def _capsDiscoCB(self, jid, node, identities, features, dataforms): -
branches/osx_newbuildsys/src/common/commands.py
r10501 r10534 122 122 form = dataforms.SimpleDataForm(extend = request.getTag('command').\ 123 123 getTag('x')) 124 except :124 except Exception: 125 125 self.badRequest(request) 126 126 return False … … 132 132 self.badRequest(request) 133 133 return False 134 except : # KeyError if there's no presence-type field in form or134 except Exception: # KeyError if there's no presence-type field in form or 135 135 # AttributeError if that field is of wrong type 136 136 self.badRequest(request) … … 139 139 try: 140 140 presencedesc = form['presence-desc'].value 141 except : # same exceptions as in last comment141 except Exception: # same exceptions as in last comment 142 142 presencedesc = u'' 143 143 … … 220 220 form = dataforms.SimpleDataForm(extend = request.getTag('command').\ 221 221 getTag('x')) 222 except :222 except Exception: 223 223 self.badRequest(request) 224 224 return False … … 226 226 try: 227 227 gc = form['groupchats'].values 228 except : # KeyError if there's no groupchats in form228 except Exception: # KeyError if there's no groupchats in form 229 229 self.badRequest(request) 230 230 return False … … 241 241 continue 242 242 gc_control.parent_win.remove_tab(gc_control, None, force = True) 243 except : # KeyError if there's no such room opened243 except Exception: # KeyError if there's no such room opened 244 244 self.badRequest(request) 245 245 return False … … 272 272 for event in events[jid]: 273 273 self.connection.send_message(j, event.parameters[0], '', 274 type =event.type_, subject=event.parameters[1],274 type_=event.type_, subject=event.parameters[1], 275 275 resource=resource, forward_from=jid, delayed=event.time_) 276 276 -
branches/osx_newbuildsys/src/common/config.py
r10501 r10534 482 482 try: 483 483 ival = int(val) 484 except :484 except Exception: 485 485 return None 486 486 return ival … … 503 503 return val 504 504 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': 509 509 return self.is_valid_bool(val) 510 elif type [0] == 'integer':510 elif type_[0] == 'integer': 511 511 return self.is_valid_int(val) 512 elif type [0] == 'string':512 elif type_[0] == 'string': 513 513 return self.is_valid_string(val) 514 514 else: 515 if re.match(type [1], val):515 if re.match(type_[1], val): 516 516 return val 517 517 else: -
branches/osx_newbuildsys/src/common/connection_handlers.py
r10501 r10534 68 68 try: 69 69 import idle 70 except :70 except Exception: 71 71 gajim.log.debug(_('Unable to load idle module')) 72 72 HAS_IDLE = False … … 154 154 if not self.connection or self.connected < 2: 155 155 return 156 if type(self.peerhost) != tuple:156 if not isinstance(self.peerhost, tuple): 157 157 return 158 158 port = gajim.config.get('file_transfers_port') … … 462 462 try: 463 463 streamhost = query.getTag('streamhost-used') 464 except : # this bytestream result is not what we need464 except Exception: # this bytestream result is not what we need 465 465 pass 466 466 id = real_id[3:] … … 471 471 if streamhost is None: 472 472 # proxy approves the activate query 473 if real_id [:3] == 'au_':473 if real_id.startswith('au_'): 474 474 id = real_id[3:] 475 475 if 'streamhost-used' not in file_props or \ … … 489 489 raise common.xmpp.NodeProcessed 490 490 491 if real_id [:3] == 'au_':491 if real_id.startswith('au_'): 492 492 if 'stopped' in file and file_props['stopped']: 493 493 self.remove_transfer(file_props) … … 945 945 try: 946 946 card = common.xmpp.Node(node = c) 947 except :947 except Exception: 948 948 # We are unable to parse it. Remove it 949 949 os.remove(path_to_file) … … 999 999 for j in vcard[i]: 1000 1000 iq3.addChild(j).setData(vcard[i][j]) 1001 elif type(vcard[i]) == type([]):1001 elif isinstance(vcard[i], list): 1002 1002 for j in vcard[i]: 1003 1003 iq3 = iq2.addChild(i) … … 1108 1108 try: 1109 1109 order = int(order) 1110 except :1110 except Exception: 1111 1111 order = 0 1112 1112 if order is not None: … … 1175 1175 photo_decoded = base64.decodestring(photo) 1176 1176 &n
