gajim: prevent traceback when obj.msg_id is not set

2011-10-16 Thread Yann Leboulanger
changeset 1667779e44fb in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=1667779e44fb
description: prevent traceback when obj.msg_id is not set

diffstat:

 src/session.py |  14 ++
 1 files changed, 6 insertions(+), 8 deletions(-)

diffs (52 lines):

diff -r 77435d3a9d12 -r 1667779e44fb src/session.py
--- a/src/session.pySat Oct 15 10:47:22 2011 +0200
+++ b/src/session.pySun Oct 16 11:14:40 2011 +0200
@@ -73,7 +73,7 @@
 if self.control and self.control.resource:
 self.control.change_resource(self.resource)
 
-msg_id = None
+obj.msg_id = None
 
 if obj.mtype == 'chat':
 if not obj.stanza.getTag('body') and obj.chatstate is None:
@@ -89,7 +89,7 @@
 msg_to_log = obj.xhtml
 else:
 msg_to_log = obj.msgtxt
-msg_id = gajim.logger.write(log_type, obj.fjid,
+obj.msg_id = gajim.logger.write(log_type, obj.fjid,
 msg_to_log, tim=obj.timestamp, subject=obj.subject)
 except exceptions.PysqliteOperationalError, e:
 self.conn.dispatch('ERROR', (_('Disk WriteError'), str(e)))
@@ -101,8 +101,6 @@
 common.logger.LOG_DB_PATH
 self.conn.dispatch('ERROR', (pritext, sectext))
 
-obj.msg_id = msg_id
-
 treat_as = gajim.config.get('treat_incoming_messages')
 if treat_as:
 obj.mtype = treat_as
@@ -132,8 +130,8 @@
 # Brand new message, incoming.
 contact.our_chatstate = obj.chatstate
 contact.chatstate = obj.chatstate
-if msg_id: # Do not overwrite an existing msg_id with None
-contact.msg_id = msg_id
+if obj.msg_id: # Do not overwrite an existing msg_id with None
+contact.msg_id = obj.msg_id
 
 # THIS MUST BE AFTER chatstates handling
 # AND BEFORE playsound (else we ear sounding on chatstates!)
@@ -166,8 +164,8 @@
 if gajim.interface.remote_ctrl:
 gajim.interface.remote_ctrl.raise_signal('NewMessage', (
 self.conn.name, [obj.fjid, obj.msgtxt, obj.timestamp,
-obj.encrypted, obj.mtype, obj.subject, obj.chatstate, msg_id,
-obj.user_nick, obj.xhtml, obj.form_node]))
+obj.encrypted, obj.mtype, obj.subject, obj.chatstate,
+obj.msg_id, obj.user_nick, obj.xhtml, obj.form_node]))
 
 def roster_message2(self, obj):
 
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: catch the error in the plugins manifest file

2011-10-16 Thread Fomin Denis
changeset a59be967aa02 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=a59be967aa02
description: catch the error in the plugins manifest file

diffstat:

 src/plugins/pluginmanager.py |  8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (18 lines):

diff -r 1667779e44fb -r a59be967aa02 src/plugins/pluginmanager.py
--- a/src/plugins/pluginmanager.py  Sun Oct 16 11:14:40 2011 +0200
+++ b/src/plugins/pluginmanager.py  Sun Oct 16 22:40:42 2011 +0300
@@ -480,6 +480,14 @@
 # all fields are required
 log.debug('%s : %s' % (module_attr_name,
 'wrong manifest file. all fields are required!'))
+except ConfigParser.NoSectionError, type_error:
+# info section are required
+log.debug('%s : %s' % (module_attr_name,
+'wrong manifest file. info section are required!'))
+except ConfigParser.MissingSectionHeaderError, type_error:
+# info section are required
+log.debug('%s : %s' % (module_attr_name,
+'wrong manifest file. section are required!'))
 
 return plugins_found
 
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits