Index: quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/configletview.py
===================================================================
--- quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/configletview.py	(revision 3006)
+++ quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/configletview.py	(revision 3152)
@@ -8,5 +8,7 @@
 
 from quintagroup.plonegooglesitemaps.interfaces import ISitemap
-from quintagroup.plonegooglesitemaps import qPloneGoogleSitemapsMessageFactory as _
+from quintagroup.plonegooglesitemaps \
+    import qPloneGoogleSitemapsMessageFactory as _
+
 
 def splitNum(num):
@@ -14,9 +16,10 @@
     prefn = 3
     for c in str(num)[::-1]:
-        res.insert(0,c)
-        if not len(res)%prefn:
-            res.insert(0,',')
+        res.insert(0, c)
+        if not len(res) % prefn:
+            res.insert(0, ',')
             prefn += 4
-    return "".join(res[0]==',' and res[1:] or res)
+    return "".join(res[0] == ',' and res[1:] or res)
+
 
 class IConfigletSettingsView(Interface):
@@ -25,7 +28,10 @@
     """
 
-    sitemaps = Attribute("Returns mapping of sitemap's type to list of appropriate objects")
-    hasContentSM = Attribute("Returns boolean about existance of content sitemap")
-    hasMobileSM = Attribute("Returns boolean about existance of mobile sitemap")
+    sitemaps = Attribute("Returns mapping of sitemap's type to list of " \
+                         "appropriate objects")
+    hasContentSM = Attribute("Returns boolean about existance of content " \
+                             "sitemap")
+    hasMobileSM = Attribute("Returns boolean about existance of mobile " \
+                            "sitemap")
     hasNewsSM = Attribute("Returns boolean about existance of news sitemap")
     sm_types = Attribute("List of sitemap types")
@@ -46,5 +52,5 @@
     def uploadVerificationFile(vfile):
         """ Upload passed site verification file to the site.
-            On success - update googlesitemaps verification files list. 
+            On success - update googlesitemaps verification files list.
             Return tuple where :
               1. boolean value - is verification file successfully created.
@@ -53,4 +59,5 @@
                 2.2. if failure - error descirption
         """
+
 
 class ConfigletSettingsView(BrowserView):
@@ -65,7 +72,10 @@
         self.request = request
 
-        self.tools = queryMultiAdapter((self.context, self.request), name="plone_tools")
-        self.pps = queryMultiAdapter((self.context, self.request), name="plone_portal_state")
-        self.sitemaps = [i.getObject() for i in self.tools.catalog()(portal_type='Sitemap')]
+        self.tools = queryMultiAdapter((self.context, self.request),
+                                       name="plone_tools")
+        self.pps = queryMultiAdapter((self.context, self.request),
+                                     name="plone_portal_state")
+        self.sitemaps = [i.getObject() for i in \
+                         self.tools.catalog()(portal_type='Sitemap')]
 
     @property
@@ -88,9 +98,9 @@
         sitemaps = {}
         for sm in self.sitemaps:
-            smlist = sitemaps.setdefault(sm.getSitemapType(),[])
-            smlist.append({'url':sm.absolute_url(),'id':sm.id})
-        sitemaps['all'] = sitemaps.setdefault('content',[]) + \
-                          sitemaps.setdefault('mobile',[]) + \
-                          sitemaps.setdefault('news',[])
+            smlist = sitemaps.setdefault(sm.getSitemapType(), [])
+            smlist.append({'url': sm.absolute_url(), 'id': sm.id})
+        sitemaps['all'] = sitemaps.setdefault('content', []) + \
+                          sitemaps.setdefault('mobile', []) + \
+                          sitemaps.setdefault('news', [])
         return sitemaps
 
@@ -98,10 +108,10 @@
         sitemaps = {}
         for sm in self.sitemaps:
-            smlist = sitemaps.setdefault(sm.getSitemapType(),[])
+            smlist = sitemaps.setdefault(sm.getSitemapType(), [])
             smlist.append(sm.absolute_url())
         return sitemaps
 
     def sitemapsDict(self):
-        content, mobile, news = [],[],[]
+        content, mobile, news = [], [], []
         for sm in self.sitemaps:
             data = self.getSMData(sm)
@@ -116,9 +126,9 @@
     def getSMData(self, ob):
         size, entries = self.getSitemapData(ob)
-        return {'sm_type'    : ob.getSitemapType().capitalize(),
-                'sm_id'      : ob.id,
-                'sm_url'     : ob.absolute_url(),
-                'sm_size'    : size and splitNum(size) or '',
-                'sm_entries' : entries and splitNum(entries) or '',
+        return {'sm_type': ob.getSitemapType().capitalize(),
+                'sm_id': ob.id,
+                'sm_url': ob.absolute_url(),
+                'sm_size': size and splitNum(size) or '',
+                'sm_entries': entries and splitNum(entries) or '',
                }
 
@@ -128,10 +138,11 @@
         if view:
             resp = self.request.RESPONSE
-            bview = queryMultiAdapter((ob,self.request), name=view)
+            bview = queryMultiAdapter((ob, self.request), name=view)
             if bview:
                 try:
                     size = len(bview())
                     entries = bview.numEntries
-                    self.request.RESPONSE.setHeader('Content-Type', 'text/html')
+                    self.request.RESPONSE.setHeader('Content-Type',
+                                                    'text/html')
                 except:
                     pass
@@ -140,10 +151,10 @@
     def getVerificationFiles(self):
         vfs = []
-        props = getattr(self.tools.properties(),'googlesitemap_properties')
+        props = getattr(self.tools.properties(), 'googlesitemap_properties')
         if props:
             portal_ids = self.pps.portal().objectIds()
-            props_vfs = list(props.getProperty('verification_filenames',[]))
+            props_vfs = list(props.getProperty('verification_filenames', []))
             vfs = [vf for vf in props_vfs if vf in portal_ids]
-            if not props_vfs==vfs:
+            if not props_vfs == vfs:
                 props._updateProperty('verification_filenames', vfs)
         return vfs
@@ -157,11 +168,11 @@
             portal.manage_addFile(id="", file=vfile)
             portal[vfilename].manage_addProperty(
-                'CreatedBy', 'quintagroupt.plonegooglesitemaps','string')
+                'CreatedBy', 'quintagroupt.plonegooglesitemaps', 'string')
         except BadRequestException, e:
             return False, str(e)
         else:
             props = self.tools.properties().googlesitemap_properties
-            vfilenames = list(props.getProperty('verification_filenames',[]))
+            vfilenames = list(props.getProperty('verification_filenames', []))
             vfilenames.append(vfilename)
-            props.manage_changeProperties(verification_filenames = vfilenames)
+            props.manage_changeProperties(verification_filenames=vfilenames)
         return True, vfilename
