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:
parent
ac0f22887e
commit
1524521c7f
|
@ -19,7 +19,6 @@ import gtk
|
|||
import gtk.glade
|
||||
import gobject
|
||||
import os
|
||||
import sys
|
||||
import common.config
|
||||
import common.sleepy
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import gtk
|
|||
import gtk.glade
|
||||
import gobject
|
||||
import os
|
||||
import Queue
|
||||
import sys
|
||||
|
||||
import gtkgui_helpers
|
||||
import vcard
|
||||
|
@ -34,9 +34,12 @@ try:
|
|||
except:
|
||||
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 gajim_themes_window import GajimThemesWindow
|
||||
from advanced import AdvancedConfigurationWindow
|
||||
|
||||
from common import gajim
|
||||
from common import helpers
|
||||
from common import i18n
|
||||
|
@ -1038,7 +1041,7 @@ class PopupNotificationWindow:
|
|||
attached_keys = gajim.config.get_per('accounts', self.account,
|
||||
'attached_gpg_keys').split()
|
||||
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 == 'pm':
|
||||
room_jid, nick = self.jid.split('/', 1)
|
||||
|
@ -1117,7 +1120,7 @@ class SingleMessageWindow:
|
|||
gtkspell.Spell(self.message_textview)
|
||||
except gobject.GError, msg:
|
||||
#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)
|
||||
|
||||
self.send_button.set_no_show_all(True)
|
||||
|
|
|
@ -57,10 +57,8 @@ import pango
|
|||
import dialogs
|
||||
import tooltips
|
||||
|
||||
from common import helpers
|
||||
from common import gajim
|
||||
from common import xmpp
|
||||
from common import connection
|
||||
from common import i18n
|
||||
|
||||
_ = i18n._
|
||||
|
|
|
@ -23,7 +23,6 @@ import gtk.glade
|
|||
import gobject
|
||||
import pango
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import gtkgui_helpers
|
||||
|
|
|
@ -34,8 +34,6 @@ import sys
|
|||
import locale
|
||||
import signal
|
||||
signal.signal(signal.SIGINT, signal.SIG_DFL) # ^C exits the application
|
||||
import traceback
|
||||
import gobject
|
||||
|
||||
from common import exceptions
|
||||
from common import i18n
|
||||
|
|
24
src/gajim.py
24
src/gajim.py
|
@ -31,7 +31,6 @@ exec python -OOt "$0" ${1+"$@"}
|
|||
|
||||
import sys
|
||||
import os
|
||||
import pygtk
|
||||
|
||||
import message_control
|
||||
|
||||
|
@ -90,10 +89,7 @@ if '.svn' in os.listdir(path) or '_svn' in os.listdir(path):
|
|||
del path
|
||||
|
||||
import gobject
|
||||
# TODO remove this comment
|
||||
# testing how it works without threads_init
|
||||
|
||||
import pango
|
||||
import sre
|
||||
import signal
|
||||
import getopt
|
||||
|
@ -111,7 +107,6 @@ from common import nslookup
|
|||
from common import proxy65_manager
|
||||
from common import socks5
|
||||
from common import gajim
|
||||
from common import connection
|
||||
from common import helpers
|
||||
from common import optparser
|
||||
|
||||
|
@ -151,7 +146,6 @@ import systray
|
|||
import dialogs
|
||||
import vcard
|
||||
import config
|
||||
import disco
|
||||
|
||||
GTKGUI_GLADE = 'gtkgui.glade'
|
||||
|
||||
|
@ -599,7 +593,7 @@ class Interface:
|
|||
show = 'offline'
|
||||
gc_c = gajim.contacts.create_gc_contact(room_jid = jid,
|
||||
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)
|
||||
ctrl = self.msg_win_mgr.get_control(fjid, account)
|
||||
ctrl.print_conversation('Error %s: %s' % (array[1], array[2]),
|
||||
|
@ -1702,19 +1696,9 @@ class Interface:
|
|||
self.systray_capabilities = True
|
||||
self.systray = systraywin32.SystrayWin32()
|
||||
else:
|
||||
try:
|
||||
import egg.trayicon # use gnomepythonextras trayicon
|
||||
except:
|
||||
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()
|
||||
self.systray_capabilities = systray.HAS_SYSTRAY_CAPABILITIES
|
||||
if self.systray_capabilities:
|
||||
self.systray = systray.Systray()
|
||||
|
||||
if self.systray_capabilities and gajim.config.get('trayicon'):
|
||||
self.show_systray()
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
import gtk
|
||||
import gtk.glade
|
||||
import gobject
|
||||
import pango
|
||||
import dialogs
|
||||
import gtkgui_helpers
|
||||
|
|
|
@ -33,18 +33,13 @@ import dialogs
|
|||
import config
|
||||
import vcard
|
||||
import cell_renderer_image
|
||||
import history_window
|
||||
import tooltips
|
||||
|
||||
from common import gajim
|
||||
from common import helpers
|
||||
|
||||
from common import gajim
|
||||
from chat_control import ChatControl
|
||||
from chat_control import ChatControlBase
|
||||
from conversation_textview import ConversationTextview
|
||||
from message_textview import MessageTextView
|
||||
from gettext import ngettext
|
||||
from common import i18n
|
||||
|
||||
_ = i18n._
|
||||
|
|
|
@ -13,10 +13,7 @@
|
|||
##
|
||||
import gtk
|
||||
import gtk.glade
|
||||
import pango
|
||||
import gobject
|
||||
import common
|
||||
import gtkgui_helpers
|
||||
|
||||
from common import gajim
|
||||
|
||||
|
@ -112,9 +109,10 @@ class MessageControl:
|
|||
(label_str, color) either of which can be None
|
||||
if chatstate is given that means we have HE SENT US a chatstate and
|
||||
we want it displayed'''
|
||||
# NOTE: Derived classes SHOULD implement this
|
||||
# Return a markup'd label and optional gtk.Color
|
||||
return (label_str, None) #FIXME: label_str is not defined. pychecker your files
|
||||
# NOTE: Derived classes MUST implement this
|
||||
# Return a markup'd label and optional gtk.Color in a tupple like:
|
||||
#return (label_str, None)
|
||||
pass
|
||||
|
||||
def get_tab_image(self):
|
||||
'''Return a suitable tab image for display. None clears any current label.'''
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
import gtk
|
||||
import gtk.glade
|
||||
import pango
|
||||
import gobject
|
||||
|
||||
import common
|
||||
|
|
|
@ -29,12 +29,10 @@
|
|||
##
|
||||
|
||||
import os
|
||||
import gajim
|
||||
import dialogs
|
||||
import gobject
|
||||
|
||||
from common import gajim
|
||||
from common import exceptions
|
||||
from common import i18n
|
||||
i18n.init()
|
||||
_ = i18n._
|
||||
|
|
|
@ -26,13 +26,8 @@
|
|||
##
|
||||
|
||||
import gobject
|
||||
import gtk
|
||||
import os
|
||||
import sys
|
||||
|
||||
import systray
|
||||
|
||||
from common import exceptions
|
||||
from common import gajim
|
||||
from common import helpers
|
||||
from time import time
|
||||
|
@ -108,7 +103,7 @@ def get_dbus_struct(obj):
|
|||
if isinstance(obj, float):
|
||||
return DBUS_DOUBLE(obj)
|
||||
if isinstance(obj, bool):
|
||||
return DBUS_BOLEAN(obj)
|
||||
return DBUS_BOOLEAN(obj)
|
||||
if isinstance(obj, (list, tuple)):
|
||||
result = [DBUS_VARIANT(get_dbus_struct(i)) for i in obj]
|
||||
if result == []:
|
||||
|
|
|
@ -31,6 +31,8 @@ from common import gajim
|
|||
from common import helpers
|
||||
from common import i18n
|
||||
|
||||
HAS_SYSTRAY_CAPABILITIES = True
|
||||
|
||||
try:
|
||||
import egg.trayicon as trayicon # gnomepythonextras trayicon
|
||||
except:
|
||||
|
@ -38,7 +40,7 @@ except:
|
|||
import trayicon # our trayicon
|
||||
except:
|
||||
gajim.log.debug('No trayicon module available')
|
||||
pass
|
||||
HAS_SYSTRAY_CAPABILITIES = False
|
||||
|
||||
_ = i18n._
|
||||
APP = i18n.APP
|
||||
|
|
|
@ -98,18 +98,6 @@ class SystrayWINAPI:
|
|||
msg_map[key] = value
|
||||
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):
|
||||
""" Removes the notify icon. """
|
||||
if self.notify_icon:
|
||||
|
|
|
@ -20,11 +20,11 @@ import urllib
|
|||
import base64
|
||||
import mimetypes
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import locale
|
||||
|
||||
import gtkgui_helpers
|
||||
import dialogs
|
||||
import locale
|
||||
|
||||
from common import helpers
|
||||
from common import gajim
|
||||
|
@ -502,8 +502,8 @@ class VcardWindow:
|
|||
self.xml.get_widget('PHOTO_image').set_from_pixbuf(None)
|
||||
gajim.connections[self.account].request_vcard(self.jid)
|
||||
else:
|
||||
ErrorDialog(_('You are not connected to the server'),
|
||||
_('Without a connection, you can not get your contact information.')).get_response()
|
||||
dialogs.ErrorDialog(_('You are not connected to the server'),
|
||||
_('Without a connection, you can not get your contact information.')).get_response()
|
||||
|
||||
def change_to_vcard(self):
|
||||
self.xml.get_widget('information_notebook').remove_page(0)
|
||||
|
|
Loading…
Reference in New Issue