summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-04-06 19:52:59 +0200
committermathieui <mathieui@mathieui.net>2014-04-06 19:58:57 +0200
commite216fd2112c796bd625730f711861b7361f6fe9f (patch)
tree942239b0bf00dec0f9afd9e036a1bcedf449e6d3 /src/core
parent218c71dfbfb9f564eb1ec2a966df24eef2efbdec (diff)
downloadpoezio-e216fd2112c796bd625730f711861b7361f6fe9f.tar.gz
poezio-e216fd2112c796bd625730f711861b7361f6fe9f.tar.bz2
poezio-e216fd2112c796bd625730f711861b7361f6fe9f.tar.xz
poezio-e216fd2112c796bd625730f711861b7361f6fe9f.zip
Code cleanup
fixes whitespace issues, some builtin overrides, and some enormous lines might make poezio run nanoseconds faster!
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core.py10
-rw-r--r--src/core/handlers.py10
2 files changed, 10 insertions, 10 deletions
diff --git a/src/core/core.py b/src/core/core.py
index 1a496466..079a8515 100644
--- a/src/core/core.py
+++ b/src/core/core.py
@@ -175,7 +175,7 @@ class Core(object):
'_dnd': lambda: self.command_status('dnd'),
'_xa': lambda: self.command_status('xa'),
##### Custom actions ########
- '_exc_': lambda arg: self.try_execute(arg),
+ '_exc_': self.try_execute,
}
self.key_func.update(key_func)
@@ -193,8 +193,8 @@ class Core(object):
self.xmpp.add_event_handler("groupchat_config_status", self.on_status_codes)
self.xmpp.add_event_handler("groupchat_subject", self.on_groupchat_subject)
self.xmpp.add_event_handler("message", self.on_message)
- self.xmpp.add_event_handler("got_online" , self.on_got_online)
- self.xmpp.add_event_handler("got_offline" , self.on_got_offline)
+ self.xmpp.add_event_handler("got_online", self.on_got_online)
+ self.xmpp.add_event_handler("got_offline", self.on_got_offline)
self.xmpp.add_event_handler("roster_update", self.on_roster_update)
self.xmpp.add_event_handler("changed_status", self.on_presence)
self.xmpp.add_event_handler("presence_error", self.on_presence_error)
@@ -429,7 +429,7 @@ class Core(object):
res = []
current = []
for char in char_list:
- assert(len(char) > 0)
+ assert len(char) > 0
# Transform that stupid char into what we actually meant
if char == '\x1f':
char = '^/'
@@ -859,7 +859,7 @@ class Core(object):
return False
elif new_pos <= 0:
return False
- elif new_pos ==old_pos:
+ elif new_pos == old_pos:
return False
elif not self.tabs[old_pos]:
return False
diff --git a/src/core/handlers.py b/src/core/handlers.py
index 5b5cc6af..076bd986 100644
--- a/src/core/handlers.py
+++ b/src/core/handlers.py
@@ -222,7 +222,7 @@ def on_nick_received(self, message):
if item.xml.find('{http://jabber.org/protocol/nick}nick'):
contact.name = item['nick']['nick']
else:
- contact.name= ''
+ contact.name = ''
def on_gaming_event(self, message):
"""
@@ -343,7 +343,7 @@ def on_tune_event(self, message):
old_tune = contact.tune
if item.xml.find('{http://jabber.org/protocol/tune}tune'):
item = item['tune']
- contact.tune = {
+ contact.tune = {
'artist': item['artist'],
'length': item['length'],
'rating': item['rating'],
@@ -812,9 +812,9 @@ def on_session_start(self, event):
self.initial_joins.append(bm.jid)
histo_length = config.get('muc_history_length', 20)
if histo_length == -1:
- histo_length= None
+ histo_length = None
if histo_length is not None:
- histo_length= str(histo_length)
+ histo_length = str(histo_length)
# do not join rooms that do not have autojoin
# but display them anyway
if bm.autojoin:
@@ -845,7 +845,7 @@ def on_status_codes(self, message):
hide_unavailable = '103' in status_codes
non_priv = '104' in status_codes
logging_on = '170' in status_codes
- logging_off= '171' in status_codes
+ logging_off = '171' in status_codes
non_anon = '172' in status_codes
semi_anon = '173' in status_codes
full_anon = '174' in status_codes