diff src/browser/libervia_main.py @ 451:1a0cec9b0f1e

better PEP-8 compliance
author souliane <souliane@mailoo.org>
date Tue, 20 May 2014 10:54:03 +0200
parents 981ed669d3b3
children 7b6506372466
line wrap: on
line diff
--- a/src/browser/libervia_main.py	Tue May 20 07:22:10 2014 +0200
+++ b/src/browser/libervia_main.py	Tue May 20 10:54:03 2014 +0200
@@ -41,7 +41,8 @@
 from contact import ContactPanel
 from base_widget import WidgetsPanel
 from panels import MicroblogItem
-import panels, dialog
+import panels
+import dialog
 from jid import JID
 from xmlui import XMLUI
 from html_tools import html_sanitize
@@ -397,7 +398,7 @@
             # action was a one shot, nothing to do
             pass
         elif "xmlui" in data:
-            ui = XMLUI(self, xml_data = data['xmlui'])
+            ui = XMLUI(self, xml_data=data['xmlui'])
             options = ['NO_CLOSE'] if ui.type == 'form' else []
             _dialog = dialog.GenericDialog(ui.title, ui, options=options)
             ui.setCloseCb(_dialog.close)
@@ -498,10 +499,10 @@
         #put our own microblogs in cache, then fill all panels with them
         for publisher in mblogs:
             for mblog in mblogs[publisher]:
-                if not mblog.has_key('content'):
+                if 'content' not in mblog:
                     log.warning("No content found in microblog [%s]" % mblog)
                     continue
-                if mblog.has_key('groups'):
+                if 'groups' not in mblog:
                     _groups = set(mblog['groups'].split() if mblog['groups'] else [])
                 else:
                     _groups = None
@@ -513,8 +514,8 @@
         for lib_wid in self.libervia_widgets:
             if isinstance(lib_wid, panels.MicroblogPanel):
                 self.FillMicroblogPanel(lib_wid)
-        self.initialised = True # initialisation phase is finished here
-        for event_data in self.init_cache: # so we have to send all the cached events
+        self.initialised = True  # initialisation phase is finished here
+        for event_data in self.init_cache:  # so we have to send all the cached events
             self._personalEventCb(*event_data)
         del self.init_cache
 
@@ -697,7 +698,7 @@
             self.room_list.append(_target)
         chat_panel = panels.ChatPanel(self, _target, type_='group')
         chat_panel.setUserNick(user_nick)
-        if _target.node.startswith('sat_tarot_'): #XXX: it's not really beautiful, but it works :)
+        if _target.node.startswith('sat_tarot_'):  # XXX: it's not really beautiful, but it works :)
             self.addTab("Tarot", chat_panel)
         elif _target.node.startswith('sat_radiocol_'):
             self.addTab("Radio collective", chat_panel)
@@ -782,6 +783,7 @@
 
             def ok_cb(ignore):
                 self.bridge.call('subscription', None, "subscribed", entity, '', _dialog.getSelectedGroups())
+
             def cancel_cb(ignore):
                 self.bridge.call('subscription', None, "unsubscribed", entity, '', '')