Index: quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py
===================================================================
--- quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py	(revision 3564)
+++ quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py	(revision 3598)
@@ -10,11 +10,11 @@
 # BBB: compatibility with older plone versions
 try:
-     # Plone < 4.3
-     from zope.app.container import interfaces
-     INameChooser = interfaces.INameChooser
+    # Plone < 4.3
+    from zope.app.container import interfaces
+    INameChooser = interfaces.INameChooser
 except ImportError:
-     # Plone >= 4.3 
-     from zope.container.interfaces import INameChooser
-     
+    # Plone >= 4.3
+    from zope.container.interfaces import INameChooser
+
 from zope.viewlet.interfaces import IViewletManager, IViewlet
 
@@ -77,15 +77,15 @@
         # action handler def handler(self, form)
         if submitted:
-            if form.has_key('add.add'):
+            if 'add.add' in form.keys():
                 postback = self.manage_addAction(form, errors)
-            elif form.has_key("edit.save"):
+            elif "edit.save" in form.keys():
                 postback = self.manage_editAction(form, errors)
-            elif form.has_key("edit.delete"):
+            elif "edit.delete" in form.keys():
                 postback = self.manage_deleteAction(form, errors)
-            elif form.has_key("edit.moveup"):
+            elif "edit.moveup" in form.keys():
                 postback = self.manage_moveUpAction(form, errors)
-            elif form.has_key("edit.movedown"):
+            elif "edit.movedown" in form.keys():
                 postback = self.manage_moveDownAction(form, errors)
-            elif form.has_key("autogenerated.save"):
+            elif "autogenerated.save" in form.keys():
                 postback = self.manage_setAutogeneration(form, errors)
             else:
@@ -176,6 +176,6 @@
 
         # validate posted data
-        errors = self.validateActionFields(cat_name, data,
-            allow_dup=(id == data['id']))
+        errors = self.validateActionFields(
+            cat_name, data, allow_dup=(id == data['id']))
 
         if not errors:
@@ -187,8 +187,8 @@
             return False
         else:
-            errs.update(self.processErrors(errors,
-                sufix='_%s' % id))  # add edit form sufix to error ids
-            IStatusMessage(self.request).addStatusMessage(
-                _(u"Please correct the indicated errors."), type="error")
+            errs.update(self.processErrors(
+                errors, sufix='_%s' % id))  # add edit form sufix to error ids
+            IStatusMessage(self.request).addStatusMessage(_(
+                u"Please correct the indicated errors."), type="error")
             return True
 
@@ -223,5 +223,5 @@
             self.moveAction(id, cat_name, steps=1)
             IStatusMessage(self.request).addStatusMessage(
-               _(u"'${id}' action moved up.", mapping={'id': id}), type="info")
+                _(u"'${id}' action moved up.", mapping={'id': id}), type="info")
             self.redirect(search="category=%s" % cat_name)
             return False
@@ -256,5 +256,6 @@
         """Redirect to @@plonetabs-controlpanel configlet"""
         if not url:
-            portal_url = getMultiAdapter((self.context, self.request),
+            portal_url = getMultiAdapter(
+                (self.context, self.request),
                 name=u"plone_portal_state").portal_url()
             url = '%s/%s' % (portal_url, "@@plonetabs-controlpanel")
@@ -404,5 +405,5 @@
         # now add the content to results
         for item in rawresult:
-            if not excludedIds.has_key(item.getId):
+            if item.getId not in excludedIds:
                 id, item_url = get_view_url(item)
                 data = {'name': utils.pretty_title_or_id(context, item),
@@ -437,5 +438,5 @@
         """See global-sections viewlet"""
         actions = getMultiAdapter((self.context, self.request),
-                                   name=u'plone_context_state').actions()
+                                  name=u'plone_context_state').actions()
         actions_tabs = []
         try:
@@ -449,5 +450,5 @@
 
         portal_tabs_view = getMultiAdapter((self.context, self.request),
-            name="portal_tabs_view")
+                                           name="portal_tabs_view")
         return portal_tabs_view.topLevelTabs(actions=actions_tabs)
 
@@ -455,5 +456,5 @@
         """See global-sections viewlet"""
         # BBB: compatibility with older plone versions.
-        # ``selectedTabs`` Python script was merged into the 
+        # ``selectedTabs`` Python script was merged into the
         # GlobalSectionsViewlet.
         section_viewlet = setupViewletByName(self,
@@ -464,5 +465,5 @@
             # Plone >= 4.3
             selected_tabs = section_viewlet.selectedTabs(
-                default_tab='index_html', 
+                default_tab='index_html',
                 portal_tabs=self.portal_tabs())
         else:
@@ -470,5 +471,5 @@
             selectedTabs = self.context.restrictedTraverse('selectedTabs')
             selected_tabs = selectedTabs('index_html', self.context,
-                self.portal_tabs())
+                                         self.portal_tabs())
 
         return selected_tabs['portal']
@@ -497,5 +498,5 @@
         actionslist = self.getActionsList(category=cat_name)
         ksscore.replaceInnerHTML(ksscore.getHtmlIdSelector('tabslist'),
-            actionslist)
+                                 actionslist)
 
         # update autogenerated sections
@@ -556,5 +557,5 @@
         """Toggle visibility for portal root objects (exclude_from_nav)"""
         portal = getMultiAdapter((aq_inner(self.context), self.request),
-            name='plone_portal_state').portal()
+                                 name='plone_portal_state').portal()
 
         # remove prefix, added for making ids on configlet unique ("roottabs_")
@@ -562,5 +563,5 @@
 
         if obj_id not in portal.objectIds():
-            raise KSSExplicitError("Object with %s id doesn't" +\
+            raise KSSExplicitError("Object with %s id doesn't"
                                    " exist in portal root." % obj_id)
 
@@ -576,5 +577,5 @@
         if checked:
             ksscore.removeClass(ksscore.getHtmlIdSelector(id),
-                value="invisible")
+                                value="invisible")
             message = _(u"'${id}' object was included into navigation.",
                         mapping={'id': obj_id})
@@ -596,5 +597,5 @@
         act_id, category, action = self.kss_validateAction(id, cat_name)
         self.updateAction(act_id, cat_name,
-            {'id': act_id, 'visible': (checked == '1') or False})
+                          {'id': act_id, 'visible': (checked == '1') or False})
 
         # update client
@@ -602,5 +603,5 @@
         if checked == '1':
             ksscore.removeClass(ksscore.getHtmlIdSelector(id),
-                value="invisible")
+                                value="invisible")
             message = _(u"'${id}' action is now visible.",
                         mapping={'id': act_id})
@@ -652,6 +653,6 @@
             content = self.getActionsList(category=cat_name, tabs=[action, ])
             ksscore.insertHTMLAsLastChild(
-                                         ksscore.getHtmlIdSelector('tabslist'),
-                                         content)
+                ksscore.getHtmlIdSelector('tabslist'),
+                content)
 
             # update reorder controls
@@ -660,5 +661,5 @@
             # hide adding form
             ksscore.removeClass(ksscore.getHtmlIdSelector('addaction'),
-                'adding')
+                                'adding')
             self.kss_toggleCollapsible(
                 ksscore.getCssSelector('form[name=addaction_form] '
@@ -683,8 +684,8 @@
         else:
             # expand advanced section if there are errors in id or condition
-            if errors.has_key('id') or errors.has_key('available_expr'):
+            if 'id' in errors or 'available_expr' in errors:
                 self.kss_toggleCollapsible(
-                   ksscore.getCssSelector('form[name=addaction_form] '
-                                          '.headerAdvanced'), collapse='false')
+                    ksscore.getCssSelector('form[name=addaction_form] '
+                                           '.headerAdvanced'), collapse='false')
 
             message = _(u"Please correct the indicated errors.")
@@ -708,6 +709,7 @@
         # collapse advanced section
         self.kss_toggleCollapsible(
-           ksscore.getCssSelector('form[name=addaction_form] .headerAdvanced'),
-                                  collapse='true')
+            ksscore.getCssSelector(
+                'form[name=addaction_form] .headerAdvanced'),
+            collapse='true')
 
         # reset form inputs
@@ -769,5 +771,5 @@
         # validate posted data
         errors = self.validateActionFields(cat_name, data,
-            allow_dup=(id == data['id']))
+                                           allow_dup=(id == data['id']))
 
         html_id = '%s%s%s' % (self.prefix, id, self.sufix)
@@ -793,6 +795,6 @@
             # expand advanced section if there are errors in id,
             # action url or condition
-            if errors.has_key('id') or errors.has_key('available_expr') or \
-                errors.has_key('url_expr'):
+            if 'id' in errors or 'available_expr' in errors or \
+                    'url_expr' in errors:
                 self.kss_toggleCollapsible(
                     ksscore.getCssSelector('#%s .headerAdvanced' % html_id),
@@ -818,5 +820,5 @@
         else:
             ids = [component[len(self.prefix):-len(self.sufix)]
-                for component in components]
+                   for component in components]
 
         # do actual sorting
@@ -936,5 +938,5 @@
 
         # preprocess 'visible' field (checkbox needs special checking)
-        if form.has_key('visible_%s' % id):
+        if 'visible_%s' % id in form:
             form['visible_%s' % id] = True
         else:
@@ -954,5 +956,5 @@
 
         # preprocess 'visible' field (checkbox needs special checking)
-        if form.has_key('visible') and form['visible']:
+        if 'visible' in form and form['visible']:
             form['visible'] = True
         else:
@@ -984,5 +986,5 @@
         """Change site_properties"""
         site_properties = getToolByName(self.context,
-            "portal_properties").site_properties
+                                        "portal_properties").site_properties
         site_properties.manage_changeProperties(**kw)
         return True
@@ -997,15 +999,15 @@
             category = self.getActionCategory(cat_name)
         except Exception:
-            raise KSSExplicitError(u"%s action category does not exist." %\
+            raise KSSExplicitError(u"%s action category does not exist." %
                                    cat_name)
 
         # extract action id from given list item id on client
         action_id = self.sufix and id[len(self.prefix):-len(self.sufix)] or \
-                    id[len(self.prefix):]
+            id[len(self.prefix):]
         try:
             action = category[action_id]
         except Exception:
-            raise KSSExplicitError("No %s action in %s category." %\
-                                              (action_id, cat_name))
+            raise KSSExplicitError("No %s action in %s category." %
+                                   (action_id, cat_name))
 
         return (action_id, category, action)
@@ -1023,14 +1025,16 @@
         if editform:
             id = '%s%s%s' % (self.prefix, editform, self.sufix)
-            field_selector = ksscore.getCssSelector('#%s .edit-field-%s' % (id,
-                UI_ATTRS.get(name, name)))
-            field_error_selector = ksscore.getCssSelector('#%s .edit-field-%s '
-                '.error-container' % (id, UI_ATTRS.get(name, name)))
-        else:
-            field_selector = ksscore.getCssSelector('form' +\
-                '[name=addaction_form] '
-                '.field-%s' % UI_ATTRS.get(name, name))
-            field_error_selector = ksscore.getCssSelector('form[name='
-                'addaction_form] .field-%s '
+            field_selector = ksscore.getCssSelector(
+                '#%s .edit-field-%s' % (id, UI_ATTRS.get(name, name)))
+            field_error_selector = ksscore.getCssSelector(
+                '#%s .edit-field-%s .error-container' % (id,
+                                                         UI_ATTRS.get(name,
+                                                                      name)))
+        else:
+            field_selector = ksscore.getCssSelector(
+                'form[name=addaction_form] .field-%s' % UI_ATTRS.get(name,
+                                                                     name))
+            field_error_selector = ksscore.getCssSelector(
+                'form[name=addaction_form] .field-%s '
                 '.error-container' % UI_ATTRS.get(name, name))
 
@@ -1070,5 +1074,5 @@
         """KSS Server command to execute replaceOrInsert client action"""
         command = self.commands.addCommand('plonetabs-replaceOrInsert',
-            selector)
+                                           selector)
         command.addParam('selector', parentSelector)
         command.addHtmlParam('html', html)
@@ -1084,5 +1088,5 @@
         if positionSelectorType:
             command.addParam('positionSelectorType',
-                              positionSelectorType)
+                             positionSelectorType)
 
     def kss_issueMessage(self, message, msgtype="info"):
@@ -1137,5 +1141,5 @@
         # update action properties
         for attr in data.keys():
-            if data.has_key(attr):
+            if attr in data:
                 action._setPropValue(attr, data[attr])
 
Index: quintagroup.plonetabs/trunk/quintagroup/plonetabs/configure.zcml
===================================================================
--- quintagroup.plonetabs/trunk/quintagroup/plonetabs/configure.zcml	(revision 3564)
+++ quintagroup.plonetabs/trunk/quintagroup/plonetabs/configure.zcml	(revision 3598)
@@ -5,8 +5,8 @@
     xmlns:i18n="http://namespaces.zope.org/i18n"
     i18n_domain="quintagroup.plonetabs">
-    
+
     <include package="Products.CMFCore" file="permissions.zcml"
              zcml:condition="have plone-41" />
-    
+
     <include package="plone.browserlayer" />
 
@@ -15,9 +15,9 @@
     <!-- Set up as a Zope2 product -->
     <five:registerPackage package="." initialize=".initialize" />
-    
+
     <include file="profiles.zcml" />
-    
+
     <include package=".browser" />
-    
+
     <include package=".plugins" />
 
Index: quintagroup.plonetabs/trunk/quintagroup/plonetabs/profiles.zcml
===================================================================
--- quintagroup.plonetabs/trunk/quintagroup/plonetabs/profiles.zcml	(revision 3564)
+++ quintagroup.plonetabs/trunk/quintagroup/plonetabs/profiles.zcml	(revision 3598)
@@ -3,5 +3,5 @@
     xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
     i18n_domain="quintagroup.plonetabs">
-    
+
     <genericsetup:registerProfile
        name="default"
@@ -19,4 +19,4 @@
        provides="Products.GenericSetup.interfaces.EXTENSION"
        />
-    
+
 </configure>
Index: quintagroup.plonetabs/trunk/quintagroup/plonetabs/utils.py
===================================================================
--- quintagroup.plonetabs/trunk/quintagroup/plonetabs/utils.py	(revision 3564)
+++ quintagroup.plonetabs/trunk/quintagroup/plonetabs/utils.py	(revision 3598)
@@ -8,8 +8,8 @@
 
 
-# TODO: Methods 'getViewletByName' and 'setupViewletByName' were copied 
+# TODO: Methods 'getViewletByName' and 'setupViewletByName' were copied
 # from https://github.com/collective/collective.developermanual/blob/master/source/views/viewlets.rst#what-viewlets-do
-# Better solution would be to use collective.fastview 
-# (http://svn.plone.org/svn/collective/collective.fastview/trunk/) 
+# Better solution would be to use collective.fastview
+# (http://svn.plone.org/svn/collective/collective.fastview/trunk/)
 # which has not yet included in plone.
 
@@ -47,5 +47,5 @@
     # from adapters registry
     reg = getViewletByName(name)
-    if reg == None:
+    if reg is None:
         return None
 
