changeset 0086c1032eaa in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=0086c1032eaa description: print -> print()
diffstat:
src/adhoc_commands.py | 2 +- src/common/check_paths.py | 54 ++++++++++---------- src/common/configpaths.py | 4 +- src/common/connection_handlers.py | 4 +- src/common/connection_handlers_events.py | 8 +- src/common/dbus_support.py | 16 +++--- src/common/idle.py | 4 +- src/common/jingle_transport.py | 2 +- src/common/logger.py | 4 +- src/common/logging_helpers.py | 4 +- src/common/multimedia_helpers.py | 2 +- src/common/optparser.py | 5 +- src/common/resolver.py | 2 +- src/common/rst_xhtml_generator.py | 12 ++-- src/common/zeroconf/roster_zeroconf.py | 12 ---- src/dataforms_widget.py | 2 +- src/dialogs.py | 1 - src/gajim-remote.py | 27 +++++---- src/gajim.py | 28 +++++----- src/gtkgui_helpers.py | 14 ++-- src/gui_interface.py | 4 +- src/ipython_view.py | 4 +- src/music_track_listener.py | 8 +- test/integration/test_resolver.py | 2 +- test/integration/test_xmpp_client_nb.py | 2 +- test/runtests.py | 8 +- test/unit/test_socks5.py | 84 ++++++++++++++++---------------- 27 files changed, 154 insertions(+), 165 deletions(-)
diffs (truncated from 1009 to 300 lines):
diff -r 093f965f539c -r 0086c1032eaa src/adhoc_commands.py --- a/src/adhoc_commands.py Wed Jan 02 00:31:13 2013 +0400 +++ b/src/adhoc_commands.py Tue Jan 01 19:36:56 2013 +0100 @@ -159,7 +159,7 @@ return self.stage_adhoc_commands_window_delete_event(self.window)
def __del__(self): - print 'Object has been deleted.' + print('Object has been deleted.')
# stage 1: waiting for command list def stage1(self): diff -r 093f965f539c -r 0086c1032eaa src/common/check_paths.py --- a/src/common/check_paths.py Wed Jan 02 00:31:13 2013 +0400 +++ b/src/common/check_paths.py Tue Jan 01 19:36:56 2013 +0100 @@ -36,7 +36,7 @@ import sqlite3 as sqlite
def create_log_db(): - print _('creating logs database') + print(_('creating logs database')) con = sqlite.connect(logger.LOG_DB_PATH) os.chmod(logger.LOG_DB_PATH, 0600) # rw only for us cur = con.cursor() @@ -84,7 +84,7 @@ con.close()
def create_cache_db(): - print _('creating cache database') + print(_('creating cache database')) con = sqlite.connect(logger.CACHE_DB_PATH) os.chmod(logger.CACHE_DB_PATH, 0600) # rw only for us cur = con.cursor() @@ -128,7 +128,7 @@ con.close()
def split_db(): - print 'spliting database' + print('spliting database') if os.name == 'nt': try: import configpaths @@ -162,8 +162,8 @@ cur.executescript('DROP TABLE %s;' % table) con.commit() except sqlite.OperationalError, e: - print >> sys.stderr, 'error moving table %s to cache.db: %s' % \ - (table, str(e)) + print('error moving table %s to cache.db: %s' % (table, str(e)), + file=sys.stderr) con.close() logger.CACHE_DB_PATH = tmp
@@ -249,7 +249,7 @@ continue if not os.path.exists(src): continue - print 'moving %s to %s' % (src, dst) + print(_('moving %s to %s') % (src, dst)) shutil.move(src, dst) gajim.logger.init_vars() gajim.logger.attach_cache_database() @@ -275,57 +275,57 @@ if not os.path.exists(MY_DATA): create_path(MY_DATA) elif os.path.isfile(MY_DATA): - print _('%s is a file but it should be a directory') % MY_DATA - print _('Gajim will now exit') + print(_('%s is a file but it should be a directory') % MY_DATA) + print(_('Gajim will now exit')) sys.exit()
if not os.path.exists(MY_CONFIG): create_path(MY_CONFIG) elif os.path.isfile(MY_CONFIG): - print _('%s is a file but it should be a directory') % MY_CONFIG - print _('Gajim will now exit') + print(_('%s is a file but it should be a directory') % MY_CONFIG) + print(_('Gajim will now exit')) sys.exit()
if not os.path.exists(MY_CACHE): create_path(MY_CACHE) elif os.path.isfile(MY_CACHE): - print _('%s is a file but it should be a directory') % MY_CACHE - print _('Gajim will now exit') + print(_('%s is a file but it should be a directory') % MY_CACHE) + print(_('Gajim will now exit')) sys.exit()
if not os.path.exists(VCARD_PATH): create_path(VCARD_PATH) elif os.path.isfile(VCARD_PATH): - print _('%s is a file but it should be a directory') % VCARD_PATH - print _('Gajim will now exit') + print(_('%s is a file but it should be a directory') % VCARD_PATH) + print(_('Gajim will now exit')) sys.exit()
if not os.path.exists(AVATAR_PATH): create_path(AVATAR_PATH) elif os.path.isfile(AVATAR_PATH): - print _('%s is a file but it should be a directory') % AVATAR_PATH - print _('Gajim will now exit') + print(_('%s is a file but it should be a directory') % AVATAR_PATH) + print(_('Gajim will now exit')) sys.exit()
if not os.path.exists(LOG_DB_FOLDER): create_path(LOG_DB_FOLDER) elif os.path.isfile(LOG_DB_FOLDER): - print _('%s is a file but it should be a directory') % LOG_DB_FOLDER - print _('Gajim will now exit') + print(_('%s is a file but it should be a directory') % LOG_DB_FOLDER) + print(_('Gajim will now exit')) sys.exit()
if not os.path.exists(PLUGINS_CONFIG_PATH): create_path(PLUGINS_CONFIG_PATH) elif os.path.isfile(PLUGINS_CONFIG_PATH): - print _('%s is a file but it should be a directory') % PLUGINS_CONFIG_PATH - print _('Gajim will now exit') + print(_('%s is a file but it should be a directory') % PLUGINS_CONFIG_PATH) + print(_('Gajim will now exit')) sys.exit()
if not os.path.exists(CACHE_DB_FOLDER): create_path(CACHE_DB_FOLDER) elif os.path.isfile(CACHE_DB_FOLDER): - print _('%s is a file but it should be a directory') % CACHE_DB_FOLDER - print _('Gajim will now exit') + print(_('%s is a file but it should be a directory') % CACHE_DB_FOLDER) + print(_('Gajim will now exit')) sys.exit()
check_and_possibly_move_config() @@ -334,16 +334,16 @@ create_log_db() gajim.logger.init_vars() elif os.path.isdir(LOG_DB_PATH): - print _('%s is a directory but should be a file') % LOG_DB_PATH - print _('Gajim will now exit') + print(_('%s is a directory but should be a file') % LOG_DB_PATH) + print(_('Gajim will now exit')) sys.exit()
if not os.path.exists(CACHE_DB_PATH): create_cache_db() gajim.logger.attach_cache_database() elif os.path.isdir(CACHE_DB_PATH): - print _('%s is a directory but should be a file') % CACHE_DB_PATH - print _('Gajim will now exit') + print(_('%s is a directory but should be a file') % CACHE_DB_PATH) + print(_('Gajim will now exit')) sys.exit()
if not os.path.exists(XTLS_CERTS): @@ -363,5 +363,5 @@ create_path(head) if os.path.exists(directory): return - print _('creating %s directory') % directory + print(('creating %s directory') % directory) os.mkdir(directory, 0700) diff -r 093f965f539c -r 0086c1032eaa src/common/configpaths.py --- a/src/common/configpaths.py Wed Jan 02 00:31:13 2013 +0400 +++ b/src/common/configpaths.py Tue Jan 01 19:36:56 2013 +0100 @@ -162,8 +162,8 @@ try: self.add('TMP', None, fse(tempfile.gettempdir())) except IOError, e: - print >> sys.stderr, 'Error opening tmp folder: %s\nUsing %s' % ( - str(e), os.path.expanduser('~')) + print('Error opening tmp folder: %s\nUsing %s' % (str(e), + os.path.expanduser('~')), file=sys.stderr) self.add('TMP', None, fse(os.path.expanduser('~')))
try: diff -r 093f965f539c -r 0086c1032eaa src/common/connection_handlers.py --- a/src/common/connection_handlers.py Wed Jan 02 00:31:13 2013 +0400 +++ b/src/common/connection_handlers.py Tue Jan 01 19:36:56 2013 +0100 @@ -593,7 +593,7 @@
elif self.awaiting_answers[id_][0] == ARCHIVING_COLLECTIONS_ARRIVED: # TODO - print 'ARCHIVING_COLLECTIONS_ARRIVED' + print('ARCHIVING_COLLECTIONS_ARRIVED')
elif self.awaiting_answers[id_][0] == ARCHIVING_COLLECTION_ARRIVED: def save_if_not_exists(with_, nick, direction, tim, payload): @@ -603,7 +603,7 @@ gajim.logger.save_if_not_exists(with_, direction, tim, msg=payload[0].getData(), nick=nick) elif payload[0].getName() == 'message': - print 'Not implemented' + print('Not implemented') chat = iq_obj.getTag('chat') if chat: with_ = chat.getAttr('with') diff -r 093f965f539c -r 0086c1032eaa src/common/connection_handlers_events.py --- a/src/common/connection_handlers_events.py Wed Jan 02 00:31:13 2013 +0400 +++ b/src/common/connection_handlers_events.py Tue Jan 01 19:36:56 2013 +0100 @@ -366,10 +366,10 @@ try: j = helpers.parse_jid(jid) except Exception: - print >> sys.stderr, _('JID %s is not RFC compliant. It ' - 'will not be added to your roster. Use roster ' - 'management tools such as ' - 'http://jru.jabberstudio.org/ to remove it') % jid + print(_('JID %s is not RFC compliant. It will not be added ' + 'to your roster. Use roster management tools such as ' + 'http://jru.jabberstudio.org/ to remove it') % jid, + file=sys.stderr) else: infos = raw_roster[jid] if jid != our_jid and (not infos['subscription'] or \ diff -r 093f965f539c -r 0086c1032eaa src/common/dbus_support.py --- a/src/common/dbus_support.py Wed Jan 02 00:31:13 2013 +0400 +++ b/src/common/dbus_support.py Tue Jan 01 19:36:56 2013 +0100 @@ -38,8 +38,8 @@ except ImportError: supported = False if not os.name == 'nt': # only say that to non Windows users - print _('D-Bus python bindings are missing in this computer') - print _('D-Bus capabilities of Gajim cannot be used') + print(_('D-Bus python bindings are missing in this computer')) + print(_('D-Bus capabilities of Gajim cannot be used')) else: try: # test if dbus-x11 is installed @@ -49,14 +49,14 @@ except dbus.DBusException: supported = False if not os.name == 'nt': # only say that to non Windows users - print _('D-Bus does not run correctly on this machine') - print _('D-Bus capabilities of Gajim cannot be used') + print(_('D-Bus does not run correctly on this machine')) + print(_('D-Bus capabilities of Gajim cannot be used')) except exceptions.SystemBusNotPresent: - print _('D-Bus does not run correctly on this machine: system bus not ' - 'present') + print(_('D-Bus does not run correctly on this machine: system bus not ' + 'present')) except exceptions.SessionBusNotPresent: - print _('D-Bus does not run correctly on this machine: session bus not ' - 'present') + print(_('D-Bus does not run correctly on this machine: session bus not ' + 'present'))
class SystemBus: """ diff -r 093f965f539c -r 0086c1032eaa src/common/idle.py --- a/src/common/idle.py Wed Jan 02 00:31:13 2013 +0400 +++ b/src/common/idle.py Tue Jan 01 19:36:56 2013 +0100 @@ -94,6 +94,6 @@ if __name__ == '__main__': import time time.sleep(2.1) - print getIdleSec() + print(getIdleSec()) close() - print getIdleSec() + print(getIdleSec()) diff -r 093f965f539c -r 0086c1032eaa src/common/jingle_transport.py --- a/src/common/jingle_transport.py Wed Jan 02 00:31:13 2013 +0400 +++ b/src/common/jingle_transport.py Tue Jan 01 19:36:56 2013 +0100 @@ -401,7 +401,7 @@ if 'type' in candidate and candidate['type'] in types: cand.type = types[candidate['type']] else: - print 'Unknown type %s', candidate['type'] + print('Unknown type %s' % candidate['type']) candidates.append(cand) self.remote_candidates.extend(candidates) return candidates diff -r 093f965f539c -r 0086c1032eaa src/common/logger.py --- a/src/common/logger.py Wed Jan 02 00:31:13 2013 +0400 +++ b/src/common/logger.py Tue Jan 01 19:36:56 2013 +0100 @@ -169,7 +169,7 @@ try: self.con.commit() except sqlite.OperationalError, e: - print >> sys.stderr, str(e) + print(str(e), file=sys.stderr) self.commit_timout_id = None return False
@@ -415,7 +415,7 @@ self.con.commit() message_id = self.cur.lastrowid except sqlite.OperationalError, e: - print >> sys.stderr, str(e) + print(str(e), file=sys.stderr) else: self._timeout_commit() if message_id: diff -r 093f965f539c -r 0086c1032eaa src/common/logging_helpers.py --- a/src/common/logging_helpers.py Wed Jan 02 00:31:13 2013 +0400 +++ b/src/common/logging_helpers.py Tue Jan 01 19:36:56 2013 +0100