Ignore:
Timestamp:
Aug 15, 2012 10:23:48 AM (12 years ago)
Author:
potar
Message:

fixed pep8

Location:
quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/Extensions/Install.py

    r3152 r3506  
    2020        step = None 
    2121        profile_id = 'quintagroup.plonegooglesitemaps:default' 
    22         steps_to_run = [s['id'] for s in \ 
     22        steps_to_run = [s['id'] for s in 
    2323                        ps.listUpgrades(profile_id, show_old=False)] 
    2424        for step_id in steps_to_run: 
  • quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/browser/commonview.py

    r3163 r3506  
    110110            fname = fspec and fspec.pop() or "id" 
    111111            fengine = queryMultiAdapter((self.context, self.request), 
    112                           interface=IBlackoutFilter, name=fname) 
     112                                        interface=IBlackoutFilter, 
     113                                        name=fname) 
    113114            if fengine: 
    114115                objects = list(fengine.filterOut(objects, fargs)) 
  • quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/browser/configletview.py

    r3416 r3506  
    2525    """ 
    2626 
    27     sitemaps = Attribute("Returns mapping of sitemap's type to list of " \ 
     27    sitemaps = Attribute("Returns mapping of sitemap's type to list of " 
    2828                         "appropriate objects") 
    29     hasContentSM = Attribute("Returns boolean about existance of content " \ 
     29    hasContentSM = Attribute("Returns boolean about existance of content " 
    3030                             "sitemap") 
    31     hasMobileSM = Attribute("Returns boolean about existance of mobile " \ 
     31    hasMobileSM = Attribute("Returns boolean about existance of mobile " 
    3232                            "sitemap") 
    3333    hasNewsSM = Attribute("Returns boolean about existance of news sitemap") 
     
    7373        self.pps = queryMultiAdapter((self.context, self.request), 
    7474                                     name="plone_portal_state") 
    75         self.sitemaps = [i.getObject() for i in \ 
     75        self.sitemaps = [i.getObject() for i in 
    7676                         self.tools.catalog()(portal_type='Sitemap')] 
    7777 
     
    9797            smlist = sitemaps.setdefault(sm.getSitemapType(), []) 
    9898            smlist.append({'url': sm.absolute_url(), 'id': sm.id}) 
     99 
    99100        sitemaps['all'] = sitemaps.setdefault('content', []) + \ 
    100                           sitemaps.setdefault('mobile', []) + \ 
    101                           sitemaps.setdefault('news', []) 
     101            sitemaps.setdefault('mobile', []) + sitemaps.setdefault('news', []) 
    102102        return sitemaps 
    103103 
     
    128128                'sm_size': size and splitNum(size) or '', 
    129129                'sm_entries': entries and splitNum(entries) or '', 
    130                } 
     130                } 
    131131 
    132132    def getSitemapData(self, ob): 
     
    150150        portal.manage_delObjects([self.request.id, ]) 
    151151        self.request.RESPONSE.redirect( 
    152                                 urlparse.urljoin(self.context.absolute_url, 
    153                                 'prefs_gsm_verification')) 
     152            urlparse.urljoin(self.context.absolute_url, 
     153                             'prefs_gsm_verification')) 
    154154 
    155155    def getVerificationFiles(self): 
  • quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/browser/mobilesitemapview.py

    r3485 r3506  
    2424            object_provides=MOBILE_INTERFACES, 
    2525            is_default_page=False, 
    26             ) 
     26        ) 
  • quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/browser/newssitemapview.py

    r3487 r3506  
    2121 
    2222        return ( 
    23             ('publication_date', lambda x: x.Date and \ 
    24                                  formatDate(x.Date) or ""), 
     23            ('publication_date', 
     24             lambda x: x.Date and formatDate(x.Date) or ""), 
    2525            ('keywords', lambda x: x.Subject and ', '.join(x.Subject) or ""), 
    2626            ('title', lambda x: x.Title or x.getId or x.id), 
    27             ('name', lambda x: x.Title and \ 
    28                      reTrailingParenthtical.sub("", x.Title) or ""), 
     27            ('name', lambda x: x.Title and 
     28                reTrailingParenthtical.sub("", x.Title) or ""), 
    2929            ('language', lambda x: x.Language or self.default_language()), 
    3030            ('access', lambda x: x.gsm_access or ""), 
    31             ('genres', lambda x: x.gsm_genres and \ 
    32                        ", ".join(x.gsm_genres) or ""), 
     31            ('genres', lambda x: x.gsm_genres and 
     32                ", ".join(x.gsm_genres) or ""), 
    3333            ('stock', lambda x: x.gsm_stock or ""), 
    3434        ) 
     
    4949                       "range": "min"}, 
    5050            is_default_page=False 
    51             ) 
     51        ) 
  • quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/browser/sitemapview.py

    r3485 r3506  
    2121            review_state=self.context.getStates(), 
    2222            is_default_page=False 
    23             ) 
     23        ) 
  • quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/content/newsextender.py

    r3152 r3506  
    2222 
    2323access_lst = ["Subscription", "Registration"] 
    24 genres_lst = ["PressRelease", "Satire", "Blog", "OpEd", "Opinion", \ 
     24genres_lst = ["PressRelease", "Satire", "Blog", "OpEd", "Opinion", 
    2525              "UserGenerated"] 
    2626 
     
    3131 
    3232    fields = [ 
    33         ExtendableStringField("gsm_access", 
     33        ExtendableStringField( 
     34            "gsm_access", 
    3435            accessor="gsm_access", 
    35             vocabulary=DisplayList(zip(["", ] + access_lst, \ 
     36            vocabulary=DisplayList(zip(["", ] + access_lst, 
    3637                                   ["Open access", ] + access_lst)), 
    3738            default="", 
     
    3940            widget=SelectionWidget( 
    4041                label="Access", 
    41                 description="Specifies whether an article is available to " \ 
    42                     "all readers (in case of the emtpy field, or only to " \ 
     42                description="Specifies whether an article is available to " 
     43                    "all readers (in case of the emtpy field, or only to " 
    4344                    "those with a free or paid membership to your site.", 
    4445                format="radio"), 
    4546        ), 
    46         ExtendableLinesField("gsm_genres", 
     47        ExtendableLinesField( 
     48            "gsm_genres", 
    4749            accessor="gsm_genres", 
    4850            vocabulary=DisplayList(zip(genres_lst, genres_lst)), 
     
    5153            widget=MultiSelectionWidget( 
    5254                label="Genres", 
    53                 description="Select one or more properties for an article, " \ 
    54                     "namely, whether it is a press release, a blog post, an " \ 
    55                     "opinion, an op-ed piece, user-generated content, " \ 
    56                     "or satire.", 
     55                description="Select one or more properties for an article, " 
     56                            "namely, whether it is a press release, " 
     57                            "a blog post, an opinion, an op-ed piece, " 
     58                            "user-generated content, or satire.", 
    5759                format="checkbox"), 
    5860        ), 
    59         ExtendableStringField("gsm_stock", 
     61        ExtendableStringField( 
     62            "gsm_stock", 
    6063            accessor="gsm_stock", 
    6164            default="", 
     
    6366            widget=StringWidget( 
    6467                label="Stock Tickers", 
    65                 description="A comma-separated list of up to 5 stock tickers "\ 
    66                     "of the companies, mutual funds, or other financial " \ 
    67                     "entities that are the main subject of the article. " \ 
    68                     "Relevant primarily for business articles. Each ticker " \ 
    69                     "must be prefixed by the name of its stock exchange, " \ 
    70                     "and must match its entry in Google Finance. " \ 
    71                     "For example, \"NASDAQ:AMAT\" (but not \"NASD:AMAT\"), " \ 
     68                description="A comma-separated list of up to 5 stock tickers " 
     69                    "of the companies, mutual funds, or other financial " 
     70                    "entities that are the main subject of the article. " 
     71                    "Relevant primarily for business articles. Each ticker " 
     72                    "must be prefixed by the name of its stock exchange, " 
     73                    "and must match its entry in Google Finance. " 
     74                    "For example, \"NASDAQ:AMAT\" (but not \"NASD:AMAT\"), " 
    7275                    "or \"BOM:500325\" (but not \"BOM:RIL\").", 
    7376                size=70), 
  • quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/content/sitemap.py

    r3163 r3506  
    5252        widget=atapi.MultiSelectionWidget( 
    5353            label=_(u"Review status"), 
    54             description=_(u"You may include items in sitemap depend of " \ 
     54            description=_(u"You may include items in sitemap depend of " 
    5555                          u"their review state."), 
    5656        ), 
     
    6565            label=_(u"Blackout entries"), 
    6666            description=_( 
    67                 u"Objects which match filter condition will be excluded " \ 
    68                 u"from the sitemap.Every record should follow the spec: " \ 
    69                 u"[<filter name>:]<filter arguments>. By default there are " \ 
    70                 u"\"id\" and \"path\" filters (\"id\" used if filter name " \ 
    71                 u"not specified). There is possibility to add new filters. " \ 
    72                 u"Look into README.txt of the " \ 
     67                u"Objects which match filter condition will be excluded " 
     68                u"from the sitemap.Every record should follow the spec: " 
     69                u"[<filter name>:]<filter arguments>. By default there are " 
     70                u"\"id\" and \"path\" filters (\"id\" used if filter name " 
     71                u"not specified). There is possibility to add new filters. " 
     72                u"Look into README.txt of the " 
    7373                u"quintagroup.plonegooglesitemaps package."), 
    7474        ), 
     
    8282        widget=atapi.LinesWidget( 
    8383            label=_(u"URL processing Regular Expressions"), 
    84             description=_(u"Provide regular expressions (in Perl syntax), " \ 
    85                           u"one per line to be applied to URLs before " \ 
    86                           u"including them into Sitemap. Example 1: " \ 
    87                           u"\"s/\/index_html//\" will remove /index_html " \ 
    88                           u"from URLs representing default documents. " \ 
    89                           u"Example 2: " \ 
    90                           u"\"s/[you_site\/internal\/path]/[domain]/\" will " \ 
    91                           u"fix URLs in the sitemap in case they are " \ 
    92                           u"generated on the basis of your site internal" \ 
     84            description=_(u"Provide regular expressions (in Perl syntax), " 
     85                          u"one per line to be applied to URLs before " 
     86                          u"including them into Sitemap. Example 1: " 
     87                          u"\"s/\/index_html//\" will remove /index_html " 
     88                          u"from URLs representing default documents. " 
     89                          u"Example 2: " 
     90                          u"\"s/[you_site\/internal\/path]/[domain]/\" will " 
     91                          u"fix URLs in the sitemap in case they are " 
     92                          u"generated on the basis of your site internal" 
    9393                          u"path rather than your site domain URL. "), 
    9494        ), 
     
    103103        widget=atapi.LinesWidget( 
    104104            label=_(u"Additional URLs"), 
    105             description=_(u"Define additional URLs that are not objects and " \ 
     105            description=_(u"Define additional URLs that are not objects and " 
    106106                          u"that should be included in sitemap."), 
    107107        ), 
     
    115115        widget=atapi.MultiSelectionWidget( 
    116116            label=_(u"Pinging workflow transitions"), 
    117             description=_(u"Select workflow transitions for pinging " \ 
     117            description=_(u"Select workflow transitions for pinging " 
    118118                          u"google on."), 
    119119        ), 
     
    170170            for wf_tr in wf.transitions.values(): 
    171171                if wf_tr.after_script_name in AVAILABLE_WF_SCRIPTS: 
    172                     wf_trans.append(("%s#%s" % (wf_id, wf_tr.id), 
    173                         "%s : %s (%s)" % (wf_id, wf_tr.id, \ 
    174                                           wf_tr.title_or_id()))) 
     172                    wf_trans.append( 
     173                        ("%s#%s" % (wf_id, wf_tr.id), 
     174                         "%s : %s (%s)" % (wf_id, wf_tr.id, 
     175                                           wf_tr.title_or_id()))) 
    175176        return atapi.DisplayList(wf_trans) 
    176177 
  • quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/tests/testUpgrade.py

    r3163 r3506  
    4242        # Test registered upgrade profiles 
    4343        pids = [i['id'] for i in self.setup.listProfileInfo()] 
    44         self.assertEqual("quintagroup.plonegooglesitemaps:upgrade_1_0_to_1_1" \ 
     44        self.assertEqual("quintagroup.plonegooglesitemaps:upgrade_1_0_to_1_1" 
    4545                         in pids, True) 
    46         self.assertEqual("quintagroup.plonegooglesitemaps:upgrade_1_1_to_1_2" \ 
     46        self.assertEqual("quintagroup.plonegooglesitemaps:upgrade_1_1_to_1_2" 
    4747                         in pids, True) 
    4848 
  • quintagroup.plonegooglesitemaps/branches/sitemap_date/quintagroup/plonegooglesitemaps/tests/test_doctest.py

    r3163 r3506  
    2828            test_class=DocTestCase, globs=globals(), 
    2929            optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS), 
    30                        # | doctest.REPORT_ONLY_FIRST_FAILURE | 
    31         ]) 
     30        # | doctest.REPORT_ONLY_FIRST_FAILURE | 
     31    ]) 
    3232 
    3333if __name__ == '__main__': 
Note: See TracChangeset for help on using the changeset viewer.