diff --git a/src/chat_control.py b/src/chat_control.py
index ae59d9f18d58019124b2d41bbeaa225e739e2bc8..274d5b72df5af4ca033fb6893d0edca321adf813 100644
--- a/src/chat_control.py
+++ b/src/chat_control.py
@@ -1120,7 +1120,6 @@ class ChatControl(ChatControlBase):
 		self.reset_kbd_mouse_timeout_vars()
 
 		contact = self.contact
-		jid = self.contact.jid
 
 		keyID = ''
 		encrypted = False
@@ -1189,7 +1188,6 @@ class ChatControl(ChatControlBase):
 		if yes we go active
 		if no we go inactive '''
 		contact = self.contact
-		jid = contact.jid
 
 		current_state = contact.our_chatstate
 		if current_state is False: # jid doesn't support chatstates
@@ -1439,7 +1437,6 @@ class ChatControl(ChatControlBase):
 				# contact was from pm in MUC, and left the room so contact is None
 				# so we cannot send chatstate anymore
 				return
-		jid = contact.jid
 
 		# Don't send chatstates to offline contacts
 		if contact.show == 'offline':
diff --git a/src/common/atom.py b/src/common/atom.py
index 508b3db5c64443a4d7a994dc879b7682ce36f4ab..7490f3bc755c76d31a516091652055037162a49a 100644
--- a/src/common/atom.py
+++ b/src/common/atom.py
@@ -58,8 +58,6 @@ class OldEntry(xmpp.Node, object):
 	def get_feed_title(self):
 		''' Returns title of feed, where the entry was created. The result is the feed name
 		concatenated with source-feed title. '''
-		title = u''
-
 		if self.parent is not None:
 			main_feed = self.parent.getTagData('title')
 		else:
diff --git a/src/common/configpaths.py b/src/common/configpaths.py
index 0fce3d1dac646d310c47137834f3339ff1c074d7..d3c188607289484c5b7e5df39329493afe851677 100644
--- a/src/common/configpaths.py
+++ b/src/common/configpaths.py
@@ -26,11 +26,11 @@ def fse(s):
 	return unicode(s, sys.getfilesystemencoding())
 
 class ConfigPaths:
-	def __init__(this, root=None):
-		this.root = root
-		this.paths = {}
+	def __init__(self, root=None):
+		self.root = root
+		self.paths = {}
 
-		if this.root is None:
+		if self.root is None:
 			if os.name == 'nt':
 				try:
 					# Documents and Settings\[User Name]\Application Data\Gajim
@@ -38,35 +38,35 @@ class ConfigPaths:
 					# How are we supposed to know what encoding the environment
 					# variable 'appdata' is in? Assuming it to be in filesystem
 					# encoding.
-					this.root = os.path.join(fse(os.environ[u'appdata']), u'Gajim')
+					self.root = os.path.join(fse(os.environ[u'appdata']), u'Gajim')
 				except KeyError:
 					# win9x, in cwd
-					this.root = u''
+					self.root = u''
 			else: # Unices
 				# Pass in an Unicode string, and hopefully get one back.
-				this.root = os.path.expanduser(u'~/.gajim')
+				self.root = os.path.expanduser(u'~/.gajim')
 
-	def add_from_root(this, name, path):
-		this.paths[name] = (True, path)
+	def add_from_root(self, name, path):
+		self.paths[name] = (True, path)
 
-	def add(this, name, path):
-		this.paths[name] = (False, path)
+	def add(self, name, path):
+		self.paths[name] = (False, path)
 
-	def __getitem__(this, key):
-		relative, path = this.paths[key]
+	def __getitem__(self, key):
+		relative, path = self.paths[key]
 		if not relative:
 			return path
-		return os.path.join(this.root, path)
+		return os.path.join(self.root, path)
 
-	def get(this, key, default=None):
+	def get(self, key, default=None):
 		try:
-			return this[key]
+			return self[key]
 		except KeyError:
 			return default
 
-	def iteritems(this):
-		for key in this.paths.iterkeys():
-			yield (key, this[key])
+	def iteritems(self):
+		for key in self.paths.iterkeys():
+			yield (key, self[key])
 
 def windowsify(s):
 	if os.name == 'nt':
diff --git a/src/common/proxy65_manager.py b/src/common/proxy65_manager.py
index 5145632db5eacc9bedd7b586b6fda5ec9ccff9f6..4dd5080299fe8abea915fba22d9ef73e779c6d13 100644
--- a/src/common/proxy65_manager.py
+++ b/src/common/proxy65_manager.py
@@ -107,8 +107,11 @@ class ProxyResolver:
 		query = iq.setTag('query')
 		query.setNamespace(common.xmpp.NS_BYTESTREAM)
 		query.setAttr('sid',  self.sid)
-		activate = query.setTag('activate')
+		
+		query.setTag('activate')
+		# activate = query.setTag('activate')
 		# activate.setData(self.jid + "/" + self.sid)
+
 		if self.active_connection:
 			self.active_connection.send(iq)
 			self.state = S_ACTIVATED
diff --git a/src/conversation_textview.py b/src/conversation_textview.py
index 834ec6acd62bb87e2b568720b635d37ef724cc73..15db014ee491ccf5f8ae5b4bedaec2808b5c4899 100644
--- a/src/conversation_textview.py
+++ b/src/conversation_textview.py
@@ -268,7 +268,6 @@ class ConversationTextview:
 		if over_line and not self.line_tooltip.win:
 			# check if the current pointer is still over the line
 			position = self.tv.window.get_origin()
-			win = self.tv.get_toplevel()
 			self.line_tooltip.show_tooltip(_('Text below this line is what has '
 			'been said since the last time you paid attention to this group chat'),	8, position[1] + pointer[1])
 
@@ -408,7 +407,6 @@ class ConversationTextview:
 		if event.button != 3: # if not right click
 			return False
 
-		win = self.tv.get_window(gtk.TEXT_WINDOW_TEXT)
 		x, y = self.tv.window_to_buffer_coords(gtk.TEXT_WINDOW_TEXT,
 			int(event.x), int(event.y))
 		iter = self.tv.get_iter_at_location(x, y)
@@ -691,27 +689,7 @@ class ConversationTextview:
 			before_str = helpers.from_one_line(before_str)
 			after_str = gajim.config.get('after_time')
 			after_str = helpers.from_one_line(after_str)
-			# get difference in days since epoch (86400 = 24*3600)
-			# number of days since epoch for current time (in GMT) -
-			# number of days since epoch for message (in GMT)
-			diff_day = int(timegm(time.localtime())) / 86400 - int(timegm(tim)) / 86400
-			if diff_day == 0:
-				day_str = ''
-			elif diff_day == 1:
-				day_str = _('Yesterday')
-			else:
-				#the number is >= 2
-				# %i is day in year (1-365), %d (1-31) we want %i
-				day_str = _('%i days ago') % diff_day
-			format = before_str
-			if day_str:
-				format += day_str + ' '
-			format += '%X' + after_str
-			tim_format = time.strftime(format, tim)
-			if locale.getpreferredencoding() == 'UTF-8':
-				# if tim_format comes as unicode because of day_str.
-				# we convert it to the encoding that we want (and that is utf-8)
-				tim_format = helpers.ensure_utf8_string(tim_format)
+			tim_format = before_str + self.get_time_to_show(tim) + after_str
 			buffer.insert_with_tags_by_name(end_iter, tim_format + ' ',
 				*other_tags_for_time)
 		elif current_print_time == 'sometimes' and kind != 'info':
@@ -727,9 +705,7 @@ class ConversationTextview:
 					ft = fc.getFuzzyTime(gajim.config.get('print_time_fuzzy'))
 					tim_format = ft.decode(locale.getpreferredencoding())
 				else:
-					tim_format = time.strftime('%H:%M', tim).decode(
-						locale.getpreferredencoding())
-
+					tim_format = self.get_time_to_show(tim)
 				buffer.insert_with_tags_by_name(end_iter, tim_format + '\n',
 					'time_sometimes')
 		# kind = info, we print things as if it was a status: same color, ...
@@ -761,6 +737,33 @@ class ConversationTextview:
 
 		buffer.end_user_action()
 
+	def get_time_to_show(self, tim):
+		'''Get the time, with the day before if needed and return it.
+		It DOESN'T format a fuzzy time'''
+		format = ''
+		# get difference in days since epoch (86400 = 24*3600)
+		# number of days since epoch for current time (in GMT) -
+		# number of days since epoch for message (in GMT)
+		diff_day = int(timegm(time.localtime())) / 86400 -\
+			 int(timegm(tim)) / 86400
+		if diff_day == 0:
+			day_str = ''
+		elif diff_day == 1:
+			day_str = _('Yesterday')
+		else:
+			#the number is >= 2
+			# %i is day in year (1-365), %d (1-31) we want %i
+			day_str = _('%i days ago') % diff_day
+		if day_str:
+			format += day_str + ' '
+		format += '%X'
+		tim_format = time.strftime(format, tim)
+		if locale.getpreferredencoding() == 'UTF-8':
+			# if tim_format comes as unicode because of day_str.
+			# we convert it to the encoding that we want (and that is utf-8)
+			tim_format = helpers.ensure_utf8_string(tim_format)
+		return tim_format
+
 	def detect_other_text_tag(self, text, kind):
 		if kind == 'status':
 			return kind
diff --git a/src/gajim.py b/src/gajim.py
index fd06d53f0d7cb1613cf9af29b0f5fc8834662789..ea067cf34eb41fa1e229f8fd90de8ed265f4b8d0 100755
--- a/src/gajim.py
+++ b/src/gajim.py
@@ -131,6 +131,8 @@ for o, a in opts:
 		gajim.verbose = True
 	elif o in ('-p', '--profile'): # gajim --profile name
 		profile = a
+del opts
+del args
 
 import locale
 profile = unicode(profile, locale.getpreferredencoding())
@@ -152,8 +154,13 @@ if os.path.exists(pid_filename):
 	dialog = dialogs.YesNoDialog(pritext, sectext)
 	if dialog.get_response() != gtk.RESPONSE_YES:
 		sys.exit(3)
+	# run anyway, delete pid and useless global vars
 	if os.path.exists(pid_filename):
 		os.remove(pid_filename)
+	del path_to_file
+	del pix
+	del pritext
+	del sectext
 	dialog.destroy()
 
 # Create .gajim dir
@@ -163,6 +170,7 @@ if not os.path.exists(pid_dir):
 # Create pid file
 f = open(pid_filename, 'a')
 f.close()
+del pid_dir
 
 def on_exit():
 	# delete pid file on normal exit
@@ -1145,7 +1153,7 @@ class Interface:
 				path_to_bw_file = path_to_file + '_notif_size_bw.png'
 				bwbuf.save(path_to_bw_file, 'png')
 
-	def add_event(self, account, jid, type_, args):
+	def add_event(self, account, jid, type_, event_args):
 		'''add an event to the gajim.events var'''
 		# We add it to the gajim.events queue
 		# Do we have a queue?
@@ -1161,7 +1169,7 @@ class Interface:
 			event_type = event_types[type_]
 		show_in_roster = notify.get_show_in_roster(event_type, account, jid)
 		show_in_systray = notify.get_show_in_systray(event_type, account, jid)
-		event = gajim.events.create_event(type_, args,
+		event = gajim.events.create_event(type_, event_args,
 			show_in_roster = show_in_roster,
 			show_in_systray = show_in_systray)
 		gajim.events.add_event(account, jid, event)
diff --git a/src/groupchat_control.py b/src/groupchat_control.py
index a78830a84a46a2db6372a6c6f15c955894b4bd83..3d81a68f3a61d3c1490d11d26c88295d2b082ac3 100644
--- a/src/groupchat_control.py
+++ b/src/groupchat_control.py
@@ -878,7 +878,6 @@ class GroupchatControl(ChatControlBase):
 		if (time.time() - self.room_creation) > 30 and \
 				nick != self.nick and statusCode != '303':
 			st = ''
-			found = False
 			print_status = None
 			for bookmark in gajim.connections[self.account].bookmarks:
 				if bookmark['jid'] == self.room_jid:
@@ -1414,8 +1413,6 @@ class GroupchatControl(ChatControlBase):
 
 		message_buffer = widget.get_buffer()
 		start_iter, end_iter = message_buffer.get_bounds()
-		message = message_buffer.get_text(start_iter, end_iter, False).decode(
-			'utf-8')
 
 		if event.keyval == gtk.keysyms.Tab: # TAB
 			cursor_position = message_buffer.get_insert()
@@ -1765,7 +1762,6 @@ class GroupchatControl(ChatControlBase):
 						self.room_jid, nick))
 
 	def on_list_treeview_leave_notify_event(self, widget, event):
-		model = widget.get_model()
 		props = widget.get_path_at_pos(int(event.x), int(event.y))
 		if self.tooltip.timeout > 0:
 			if not props or self.tooltip.id == props[0]:
diff --git a/src/htmltextview.py b/src/htmltextview.py
index 378a4e2360ed97c33099d377d5fcfa19f69c7a0e..b360ae4e544ddffc6452988a351ea285a4aae1c8 100644
--- a/src/htmltextview.py
+++ b/src/htmltextview.py
@@ -792,7 +792,6 @@ class HtmlTextView(gtk.TextView):
 			if text:
 				pointer = self.get_pointer()
 				position = self.window.get_origin()
-				win = self.get_toplevel()
 				self.tooltip.show_tooltip(text, 8, position[1] + pointer[1])
 
 	def __motion_notify_event(self, widget, event):
diff --git a/src/message_window.py b/src/message_window.py
index 2ca82cef8fcc25027caa662d87e3ed5d1b17d4c0..7be8a93d7f9e793e10af3b577c88e50f7d093f05 100644
--- a/src/message_window.py
+++ b/src/message_window.py
@@ -491,8 +491,6 @@ class MessageWindow:
 	def _on_notebook_key_press(self, widget, event):
 		st = '1234567890' # alt+1 means the first tab (tab 0)
 		ctrl = self.get_active_control()
-		contact = ctrl.contact
-		jid = ctrl.contact.jid
 
 		# CTRL mask
 		if event.state & gtk.gdk.CONTROL_MASK:
@@ -557,7 +555,6 @@ class MessageWindow:
 		source_page_num = int(selection.data)
 		dest_page_num, to_right = self.get_tab_at_xy(x, y)
 		source_child = self.notebook.get_nth_page(source_page_num)
-		source_tab_label = self.notebook.get_tab_label(source_child)
 		if dest_page_num != source_page_num:
 			self.notebook.reorder_child(source_child, dest_page_num)
 		
diff --git a/src/notify.py b/src/notify.py
index c79463a7b2d651ba4737145372bf63227e73b7a1..fc1bd08aa92d352a372db7658d22ea592fc42405 100644
--- a/src/notify.py
+++ b/src/notify.py
@@ -329,11 +329,9 @@ def popup(event_type, jid, account, msg_type = '', path_to_image = None,
 			instance)
 
 def on_pynotify_notification_clicked(notification, action):
-	event_type = notification.get_data('event_type')
 	jid = notification.get_data('jid')
 	account = notification.get_data('account')
 	msg_type = notification.get_data('msg_type')
-	path_to_image = notification.get_data('path_to_image')
 
 	notification.close()
 	gajim.interface.handle_event(account, jid, msg_type)
diff --git a/src/profile_window.py b/src/profile_window.py
index b5bd628095cb23d4a65be1bc544c6264b5e8a6b6..f353d1afee1700b1b56e21ca972d6533ac799ba4 100644
--- a/src/profile_window.py
+++ b/src/profile_window.py
@@ -109,7 +109,6 @@ class ProfileWindow:
 		self.avatar_mime_type = None
 
 	def on_set_avatar_button_clicked(self, widget):
-		f = None
 		def on_ok(widget, path_to_file):
 			filesize = os.path.getsize(path_to_file) # in bytes
 			#FIXME: use messages for invalid file for 0.11
diff --git a/src/remote_control.py b/src/remote_control.py
index a87c892945bad6f624c8ca871148dc03f1f0b061..cf754810e6a485083e117a6c73b38f84832d65f7 100644
--- a/src/remote_control.py
+++ b/src/remote_control.py
@@ -120,7 +120,6 @@ class SignalObject(dbus.service.Object):
 		returns status (show to be exact) which is the global one
 		unless account is given'''
 		account = self._get_real_arguments(args, 1)[0]
-		accounts = gajim.contacts.get_accounts()
 		if not account:
 			# If user did not ask for account, returns the global status
 			return helpers.get_global_show()
@@ -134,7 +133,6 @@ class SignalObject(dbus.service.Object):
 		returns status which is the global one
 		unless account is given'''
 		account = self._get_real_arguments(args, 1)[0]
-		accounts = gajim.contacts.get_accounts()
 		if not account:
 			# If user did not ask for account, returns the global status
 			return str(helpers.get_global_status())
diff --git a/src/roster_window.py b/src/roster_window.py
index be4cfcb216b2a6f2431635c0da271982184d35cb..ed55f26f6ac3d771f231d23a548ba22e4a03bf63 100644
--- a/src/roster_window.py
+++ b/src/roster_window.py
@@ -805,8 +805,6 @@ class RosterWindow:
 		add_new_contact_menuitem = self.xml.get_widget('add_new_contact_menuitem')
 		service_disco_menuitem = self.xml.get_widget('service_disco_menuitem')
 		advanced_menuitem = self.xml.get_widget('advanced_menuitem')
-		show_offline_contacts_menuitem = self.xml.get_widget(
-			'show_offline_contacts_menuitem')
 		profile_avatar_menuitem = self.xml.get_widget('profile_avatar_menuitem')	
 
 		# destroy old advanced menus
@@ -1161,7 +1159,6 @@ class RosterWindow:
 
 	def chg_contact_status(self, contact, show, status, account):
 		'''When a contact changes his or her status'''
-		showOffline = gajim.config.get('showoffline')
 		contact_instances = gajim.contacts.get_contact(account, contact.jid)
 		contact.show = show
 		contact.status = status
@@ -1176,11 +1173,10 @@ class RosterWindow:
 		jid_list = [contact.jid]
 		if contact.get_full_jid() != contact.jid:
 			jid_list.append(contact.get_full_jid())
-		for j in jid_list:
-			if gajim.interface.msg_win_mgr.has_window(j, account):
-				jid = contact.jid
-				win = gajim.interface.msg_win_mgr.get_window(j, account)
-				ctrl = win.get_control(j, account)
+		for jid in jid_list:
+			if gajim.interface.msg_win_mgr.has_window(jid, account):
+				win = gajim.interface.msg_win_mgr.get_window(jid, account)
+				ctrl = win.get_control(jid, account)
 				ctrl.contact = contact
 				ctrl.update_ui()
 				win.redraw_tab(ctrl)
@@ -1248,7 +1244,6 @@ class RosterWindow:
 			self.tooltip.hide_tooltip()
 
 	def on_roster_treeview_leave_notify_event(self, widget, event):
-		model = widget.get_model()
 		props = widget.get_path_at_pos(int(event.x), int(event.y))
 		if self.tooltip.timeout > 0:
 			if not props or self.tooltip.id == props[0]:
@@ -3976,7 +3971,6 @@ class RosterWindow:
 			contact.groups)
 
 	def remove_contact_from_group(self, account, contact, group):
-		model = self.tree.get_model()
 		# Make sure contact was in the group
 		if group in contact.groups:
 			contact.groups.remove(group)
@@ -4049,7 +4043,6 @@ class RosterWindow:
 		it = iter_source
 		while model[it][C_TYPE] == 'contact':
 			it = model.iter_parent(it)
-		iter_group_source = it
 		grp_source = model[it][C_JID].decode('utf-8')
 		if grp_source in helpers.special_groups:
 			return
diff --git a/src/systray.py b/src/systray.py
index ec5fd14cc36698f4b6a54735f6e944b2e0ed9154..d8baf0019bbcf66799137265f7ffb3dcd83e5190 100644
--- a/src/systray.py
+++ b/src/systray.py
@@ -341,7 +341,6 @@ class Systray:
 			self.tooltip.show_tooltip('', size[1], position[1])
 
 	def on_tray_motion_notify_event(self, widget, event):
-		wireq=widget.size_request()
 		position = widget.window.get_origin()
 		if self.tooltip.timeout > 0:
 			if self.tooltip.id != position:
diff --git a/src/tooltips.py b/src/tooltips.py
index a6e40fe2f177e7ba30c5535109ea8ab69b849a5b..a96a1574df122c497d0886a25a24495be44b589f 100644
--- a/src/tooltips.py
+++ b/src/tooltips.py
@@ -306,7 +306,7 @@ class GCTooltip(BaseTooltip):
 			properties.append((show, None))
 
 		if contact.jid.strip() != '':
-			properties.append((_('JID: '), contact.jid))
+			properties.append((_('Jabber ID: '), contact.jid))
 
 		if hasattr(contact, 'resource') and contact.resource.strip() != '':
 			properties.append((_('Resource: '),