pychecker on our files. everyone please have a look so we do not do the same mistakes and in case you catch a mistake I did when cleaning

This commit is contained in:
Nikos Kouremenos 2006-03-24 18:48:26 +00:00
parent ac0f22887e
commit 1524521c7f
15 changed files with 22 additions and 67 deletions

View file

@ -19,7 +19,6 @@ import gtk
import gtk.glade import gtk.glade
import gobject import gobject
import os import os
import sys
import common.config import common.config
import common.sleepy import common.sleepy

View file

@ -22,7 +22,7 @@ import gtk
import gtk.glade import gtk.glade
import gobject import gobject
import os import os
import Queue import sys
import gtkgui_helpers import gtkgui_helpers
import vcard import vcard
@ -34,9 +34,12 @@ try:
except: except:
HAS_GTK_SPELL = False HAS_GTK_SPELL = False
# those imports are not used in this file, but in files that import dialog
# so they can do dialog.GajimThemesWindow() for example
from filetransfers_window import FileTransfersWindow from filetransfers_window import FileTransfersWindow
from gajim_themes_window import GajimThemesWindow from gajim_themes_window import GajimThemesWindow
from advanced import AdvancedConfigurationWindow from advanced import AdvancedConfigurationWindow
from common import gajim from common import gajim
from common import helpers from common import helpers
from common import i18n from common import i18n
@ -1038,7 +1041,7 @@ class PopupNotificationWindow:
attached_keys = gajim.config.get_per('accounts', self.account, attached_keys = gajim.config.get_per('accounts', self.account,
'attached_gpg_keys').split() 'attached_gpg_keys').split()
if self.jid in attached_keys: if self.jid in attached_keys:
keyID = attached_keys[attached_keys.index(jid) + 1] keyID = attached_keys[attached_keys.index(self.jid) + 1]
if self.msg_type.find('file') != 0: if self.msg_type.find('file') != 0:
if self.msg_type == 'pm': if self.msg_type == 'pm':
room_jid, nick = self.jid.split('/', 1) room_jid, nick = self.jid.split('/', 1)
@ -1117,7 +1120,7 @@ class SingleMessageWindow:
gtkspell.Spell(self.message_textview) gtkspell.Spell(self.message_textview)
except gobject.GError, msg: except gobject.GError, msg:
#FIXME: add a ui for this use spell.set_language() #FIXME: add a ui for this use spell.set_language()
dialogs.ErrorDialog(unicode(msg), _('If that is not your language for which you want to highlight misspelled words, then please set your $LANG as appropriate. Eg. for French do export LANG=fr_FR or export LANG=fr_FR.UTF-8 in ~/.bash_profile or to make it global in /etc/profile.\n\nHighlighting misspelled words feature will not be used')).get_response() ErrorDialog(unicode(msg), _('If that is not your language for which you want to highlight misspelled words, then please set your $LANG as appropriate. Eg. for French do export LANG=fr_FR or export LANG=fr_FR.UTF-8 in ~/.bash_profile or to make it global in /etc/profile.\n\nHighlighting misspelled words feature will not be used')).get_response()
gajim.config.set('use_speller', False) gajim.config.set('use_speller', False)
self.send_button.set_no_show_all(True) self.send_button.set_no_show_all(True)

View file

@ -57,10 +57,8 @@ import pango
import dialogs import dialogs
import tooltips import tooltips
from common import helpers
from common import gajim from common import gajim
from common import xmpp from common import xmpp
from common import connection
from common import i18n from common import i18n
_ = i18n._ _ = i18n._

View file

@ -23,7 +23,6 @@ import gtk.glade
import gobject import gobject
import pango import pango
import os import os
import sys
import time import time
import gtkgui_helpers import gtkgui_helpers

View file

@ -34,8 +34,6 @@ import sys
import locale import locale
import signal import signal
signal.signal(signal.SIGINT, signal.SIG_DFL) # ^C exits the application signal.signal(signal.SIGINT, signal.SIG_DFL) # ^C exits the application
import traceback
import gobject
from common import exceptions from common import exceptions
from common import i18n from common import i18n

View file

@ -31,7 +31,6 @@ exec python -OOt "$0" ${1+"$@"}
import sys import sys
import os import os
import pygtk
import message_control import message_control
@ -90,10 +89,7 @@ if '.svn' in os.listdir(path) or '_svn' in os.listdir(path):
del path del path
import gobject import gobject
# TODO remove this comment
# testing how it works without threads_init
import pango
import sre import sre
import signal import signal
import getopt import getopt
@ -111,7 +107,6 @@ from common import nslookup
from common import proxy65_manager from common import proxy65_manager
from common import socks5 from common import socks5
from common import gajim from common import gajim
from common import connection
from common import helpers from common import helpers
from common import optparser from common import optparser
@ -151,7 +146,6 @@ import systray
import dialogs import dialogs
import vcard import vcard
import config import config
import disco
GTKGUI_GLADE = 'gtkgui.glade' GTKGUI_GLADE = 'gtkgui.glade'
@ -599,7 +593,7 @@ class Interface:
show = 'offline' show = 'offline'
gc_c = gajim.contacts.create_gc_contact(room_jid = jid, gc_c = gajim.contacts.create_gc_contact(room_jid = jid,
name = nick, show = show) name = nick, show = show)
c = gajim.contacts.contact_from_gc_contct(c) c = gajim.contacts.contact_from_gc_contact(gc_c)
self.roster.new_chat(c, account, private_chat = True) self.roster.new_chat(c, account, private_chat = True)
ctrl = self.msg_win_mgr.get_control(fjid, account) ctrl = self.msg_win_mgr.get_control(fjid, account)
ctrl.print_conversation('Error %s: %s' % (array[1], array[2]), ctrl.print_conversation('Error %s: %s' % (array[1], array[2]),
@ -1702,19 +1696,9 @@ class Interface:
self.systray_capabilities = True self.systray_capabilities = True
self.systray = systraywin32.SystrayWin32() self.systray = systraywin32.SystrayWin32()
else: else:
try: self.systray_capabilities = systray.HAS_SYSTRAY_CAPABILITIES
import egg.trayicon # use gnomepythonextras trayicon if self.systray_capabilities:
except: self.systray = systray.Systray()
try:
import trayicon # use the one we distribute
except: # user doesn't have trayicon capabilities
pass
else:
self.systray_capabilities = True
self.systray = systray.Systray()
else:
self.systray_capabilities = True
self.systray = systray.Systray()
if self.systray_capabilities and gajim.config.get('trayicon'): if self.systray_capabilities and gajim.config.get('trayicon'):
self.show_systray() self.show_systray()

View file

@ -26,7 +26,6 @@
import gtk import gtk
import gtk.glade import gtk.glade
import gobject
import pango import pango
import dialogs import dialogs
import gtkgui_helpers import gtkgui_helpers

View file

@ -33,18 +33,13 @@ import dialogs
import config import config
import vcard import vcard
import cell_renderer_image import cell_renderer_image
import history_window
import tooltips
from common import gajim from common import gajim
from common import helpers from common import helpers
from common import gajim
from chat_control import ChatControl from chat_control import ChatControl
from chat_control import ChatControlBase from chat_control import ChatControlBase
from conversation_textview import ConversationTextview from conversation_textview import ConversationTextview
from message_textview import MessageTextView
from gettext import ngettext
from common import i18n from common import i18n
_ = i18n._ _ = i18n._

View file

@ -13,10 +13,7 @@
## ##
import gtk import gtk
import gtk.glade import gtk.glade
import pango
import gobject import gobject
import common
import gtkgui_helpers
from common import gajim from common import gajim
@ -112,9 +109,10 @@ class MessageControl:
(label_str, color) either of which can be None (label_str, color) either of which can be None
if chatstate is given that means we have HE SENT US a chatstate and if chatstate is given that means we have HE SENT US a chatstate and
we want it displayed''' we want it displayed'''
# NOTE: Derived classes SHOULD implement this # NOTE: Derived classes MUST implement this
# Return a markup'd label and optional gtk.Color # Return a markup'd label and optional gtk.Color in a tupple like:
return (label_str, None) #FIXME: label_str is not defined. pychecker your files #return (label_str, None)
pass
def get_tab_image(self): def get_tab_image(self):
'''Return a suitable tab image for display. None clears any current label.''' '''Return a suitable tab image for display. None clears any current label.'''

View file

@ -23,7 +23,6 @@
import gtk import gtk
import gtk.glade import gtk.glade
import pango
import gobject import gobject
import common import common

View file

@ -29,12 +29,10 @@
## ##
import os import os
import gajim
import dialogs import dialogs
import gobject import gobject
from common import gajim from common import gajim
from common import exceptions
from common import i18n from common import i18n
i18n.init() i18n.init()
_ = i18n._ _ = i18n._

View file

@ -26,13 +26,8 @@
## ##
import gobject import gobject
import gtk
import os import os
import sys
import systray
from common import exceptions
from common import gajim from common import gajim
from common import helpers from common import helpers
from time import time from time import time
@ -108,7 +103,7 @@ def get_dbus_struct(obj):
if isinstance(obj, float): if isinstance(obj, float):
return DBUS_DOUBLE(obj) return DBUS_DOUBLE(obj)
if isinstance(obj, bool): if isinstance(obj, bool):
return DBUS_BOLEAN(obj) return DBUS_BOOLEAN(obj)
if isinstance(obj, (list, tuple)): if isinstance(obj, (list, tuple)):
result = [DBUS_VARIANT(get_dbus_struct(i)) for i in obj] result = [DBUS_VARIANT(get_dbus_struct(i)) for i in obj]
if result == []: if result == []:

View file

@ -31,6 +31,8 @@ from common import gajim
from common import helpers from common import helpers
from common import i18n from common import i18n
HAS_SYSTRAY_CAPABILITIES = True
try: try:
import egg.trayicon as trayicon # gnomepythonextras trayicon import egg.trayicon as trayicon # gnomepythonextras trayicon
except: except:
@ -38,7 +40,7 @@ except:
import trayicon # our trayicon import trayicon # our trayicon
except: except:
gajim.log.debug('No trayicon module available') gajim.log.debug('No trayicon module available')
pass HAS_SYSTRAY_CAPABILITIES = False
_ = i18n._ _ = i18n._
APP = i18n.APP APP = i18n.APP

View file

@ -98,18 +98,6 @@ class SystrayWINAPI:
msg_map[key] = value msg_map[key] = value
self._message_map.update(msg_map) self._message_map.update(msg_map)
def message_unmap(self, msg, callback=None):
if self._message_map.has_key(msg):
if callback:
cblist = self._message_map[key]
if isinstance(cblist, list):
if not len(cblist) < 2:
for i in xrange(len(cblist)):
if cblist[i] == callback:
del self._message_map[key][i]
return
del self._message_map[key]
def remove_notify_icon(self): def remove_notify_icon(self):
""" Removes the notify icon. """ """ Removes the notify icon. """
if self.notify_icon: if self.notify_icon:

View file

@ -20,11 +20,11 @@ import urllib
import base64 import base64
import mimetypes import mimetypes
import os import os
import sys
import time import time
import locale
import gtkgui_helpers import gtkgui_helpers
import dialogs import dialogs
import locale
from common import helpers from common import helpers
from common import gajim from common import gajim
@ -502,8 +502,8 @@ class VcardWindow:
self.xml.get_widget('PHOTO_image').set_from_pixbuf(None) self.xml.get_widget('PHOTO_image').set_from_pixbuf(None)
gajim.connections[self.account].request_vcard(self.jid) gajim.connections[self.account].request_vcard(self.jid)
else: else:
ErrorDialog(_('You are not connected to the server'), dialogs.ErrorDialog(_('You are not connected to the server'),
_('Without a connection, you can not get your contact information.')).get_response() _('Without a connection, you can not get your contact information.')).get_response()
def change_to_vcard(self): def change_to_vcard(self):
self.xml.get_widget('information_notebook').remove_page(0) self.xml.get_widget('information_notebook').remove_page(0)