Changeset 3171 in products


Ignore:
Timestamp:
Apr 22, 2011 9:08:32 AM (10 years ago)
Author:
vmaksymiv
Message:

pylint fixes

Location:
quintagroup.analytics/trunk/quintagroup/analytics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.analytics/trunk/quintagroup/analytics/browser/views.py

    r3170 r3171  
    1414    IPortletAssignmentSettings 
    1515except ImportError: 
    16     "Before plon4 we don't have an annotation storage for settings." 
     16    # Before plon4 we don't have an annotation storage for settings. 
    1717    IPortletAssignmentSettings = lambda assignment: {} 
    1818 
     
    144144                if haslen: 
    145145                    data[k] = len(index._index[k]) 
     146 
    146147                else: 
    147148                    data[k] = 1 
     149 
    148150            data = data.items() 
    149151            data.sort(lambda a, b: a[1] - b[1]) 
  • quintagroup.analytics/trunk/quintagroup/analytics/tests.py

    r3170 r3171  
    4040    @classmethod 
    4141    def tearDown(cls): 
    42             pass 
     42        pass 
    4343 
    4444 
     
    6565        uf = portal.acl_users 
    6666        pm = portal.portal_membership 
    67         portal.portal_catalog 
     67        #portal.portal_catalog 
    6868        users = [u[0] for u in cls.users] 
    6969        for u in users: 
     
    186186                continue 
    187187            haslen = hasattr(index._index[k], '__len__') 
     188 
    188189            if haslen: 
    189190                data[k] = len(index._index[k]) 
    190191            else: 
    191192                data[k] = 1 
     193 
    192194        data = data.items() 
    193195        data.sort(lambda a, b: a[1] - b[1]) 
     
    216218        """ This test verifies creation of chart image tag.""" 
    217219        plone33chart_tag = \ 
    218           """<imgsrc="http://chart.apis.google.com/chart?chxt=y&amp;chds=0, 
    219              57&amp;chd=t:19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,11.0, 
    220              10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,11.0,10.0| 
    221              19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,11.0,10.0|0.0, 
    222              0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0|0.0,0.0,0.0,0.0, 
    223              0.0,0.0,0.0,0.0,0.0,0.0&amp;chxr=0,0,57&amp; 
    224              chco=669933,cc9966,993300,ff6633,e8e4e3,a9a486, 
    225              dcb57e,ffcc99,996633,333300,00ff00&amp; 
    226              chl=user9|user8|user7|user6|user5|user4|user3|user2|user1| 
    227              user0&amp;chbh=a,10,0&amp;chs=800x375&amp;cht=bvs&amp; 
    228              chtt=Content+ownership+by+type&amp;chdl=Folder|Document|Event 
    229              |Large+Plone+Folder|Topic&amp;chdlp=b"/>""" 
     220            '<imgsrc="http://chart.apis.google.com/chart?chxt=y&amp;chds=0,'\ 
     221            '57&amp;chd=t:19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,11.0,'\ 
     222            '10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,11.0,10.0|'\ 
     223            '19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,11.0,10.0|0.0,'\ 
     224            '0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0|0.0,0.0,0.0,0.0,'\ 
     225            '0.0,0.0,0.0,0.0,0.0,0.0&amp;chxr=0,0,57&amp;'\ 
     226            'chco=669933,cc9966,993300,ff6633,e8e4e3,a9a486,'\ 
     227            'dcb57e,ffcc99,996633,333300,00ff00&amp;'\ 
     228            'chl=user9|user8|user7|user6|user5|user4|user3|user2|user1|'\ 
     229            'user0&amp;chbh=a,10,0&amp;chs=800x375&amp;cht=bvs&amp;'\ 
     230            'chtt=Content+ownership+by+type&amp;chdl=Folder|Document|Event'\ 
     231            '|Large+Plone+Folder|Topic&amp;chdlp=b"/>' 
    230232        plone4chart_tag = \ 
    231           """<img src="http://chart.apis.google.com/chart?chxt=y&amp; 
    232              chds=0,57&amp;chd=t:19.0,18.0,17.0,16.0,15.0,14.0, 
    233              13.0,12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0, 
    234              12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0, 
    235              11.0,10.0|0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0&amp; 
    236              chxr=0,0,57&amp;chco=669933,cc9966,993300,ff6633,e8e4e3, 
    237              a9a486,dcb57e,ffcc99,996633,333300,00ff00&amp;chl=user9| 
    238              user8|user7|user6|user5|user4|user3|user2|user1|user0&amp; 
    239              chbh=a,10,0&amp;chs=800x375&amp;cht=bvs&amp; 
    240              chtt=Content+ownership+by+type&amp;chdl=Folder|Document| 
    241              Event|Topic&amp;chdlp=b" />""" 
     233            '<img src="http://chart.apis.google.com/chart?chxt=y&amp;'\ 
     234            'chds=0,57&amp;chd=t:19.0,18.0,17.0,16.0,15.0,14.0,'\ 
     235            '13.0,12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,'\ 
     236            '12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,'\ 
     237            '11.0,10.0|0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0&amp;'\ 
     238            'chxr=0,0,57&amp;chco=669933,cc9966,993300,ff6633,e8e4e3,'\ 
     239            'a9a486,dcb57e,ffcc99,996633,333300,00ff00&amp;chl=user9|'\ 
     240            'user8|user7|user6|user5|user4|user3|user2|user1|user0&amp;'\ 
     241            'chbh=a,10,0&amp;chs=800x375&amp;cht=bvs&amp;'\ 
     242            'chtt=Content+ownership+by+type&amp;chdl=Folder|Document|'\ 
     243            'Event|Topic&amp;chdlp=b" />' 
    242244        chart_tag = plone4chart_tag 
    243245        if not PLONE40: 
     
    320322        index = self.pc._catalog.getIndex('portal_type') 
    321323        data = {} 
     324 
    322325        for k in index._index.keys(): 
    323326            if not k: 
    324327                continue 
    325328            haslen = hasattr(index._index[k], '__len__') 
     329 
    326330            if haslen: 
    327331                data[k] = len(index._index[k]) 
     332 
    328333            else: 
    329334                data[k] = 1 
     
    331336        data.sort(lambda a, b: a[1] - b[1]) 
    332337        data.reverse() 
     338 
    333339        types = [i[0] for i in data] 
    334340        self.assert_(False not in map(lambda t1, t2: t1 == t2, types, 
     
    359365        """ This test verifies creation of chart image tag.""" 
    360366        plone33chart_tag = \ 
    361           """<imgsrc="http://chart.apis.google.com/chart?chxt=y&amp;chds=0, 
    362              156&amp;chd=t:156.0,145.0,145.0,0.0,0.0|0.0,1.0,0.0,3.0,3.0| 
    363              0.0,0.0,0.0,0.0,0.0&amp;chxr=0,0,156&amp;chco=669933,cc9966, 
    364              993300,ff6633,e8e4e3,a9a486,dcb57e,ffcc99,996633,333300, 
    365              00ff00&amp;chl=Folder|Document|Event|Large+Plone+Folder| 
    366              Topic&amp;chbh=a,10,0&amp;chs=800x375&amp;cht=bvs&amp; 
    367              chtt=Content+type+by+state&amp;chdl=private|published| 
    368              No+workflow&amp;chdlp=b"/>""" 
     367            '<imgsrc="http://chart.apis.google.com/chart?chxt=y&amp;chds=0,'\ 
     368            '156&amp;chd=t:156.0,145.0,145.0,0.0,0.0|0.0,1.0,0.0,3.0,3.0|'\ 
     369            '0.0,0.0,0.0,0.0,0.0&amp;chxr=0,0,156&amp;chco=669933,cc9966,'\ 
     370            '993300,ff6633,e8e4e3,a9a486,dcb57e,ffcc99,996633,333300,'\ 
     371            '00ff00&amp;chl=Folder|Document|Event|Large+Plone+Folder|'\ 
     372            'Topic&amp;chbh=a,10,0&amp;chs=800x375&amp;cht=bvs&amp;'\ 
     373            'chtt=Content+type+by+state&amp;chdl=private|published|'\ 
     374            'No+workflow&amp;chdlp=b"/>' 
    369375        plone4chart_tag = \ 
    370           """<imgsrc="http://chart.apis.google.com/chart?chxt=y&amp; 
    371              chds=0,159&amp;chd=t:156.0,145.0,145.0,0.0|3.0,1.0,0.0, 
    372              3.0|0.0,0.0,0.0,0.0&amp;chxr=0,0,159&amp;chco=669933, 
    373              cc9966,993300,ff6633,e8e4e3,a9a486,dcb57e,ffcc99,996633, 
    374              333300,00ff00&amp;chl=Folder|Document|Event|Topic&amp; 
    375              chbh=a,10,0&amp;chs=800x375&amp;cht=bvs&amp; 
    376              chtt=Content+type+by+state&amp;chdl=private|published| 
    377              No+workflow&amp;chdlp=b"/>""" 
     376            '<imgsrc="http://chart.apis.google.com/chart?chxt=y&amp;'\ 
     377            'chds=0,159&amp;chd=t:156.0,145.0,145.0,0.0|3.0,1.0,0.0,'\ 
     378            '3.0|0.0,0.0,0.0,0.0&amp;chxr=0,0,159&amp;chco=669933,'\ 
     379            'cc9966,993300,ff6633,e8e4e3,a9a486,dcb57e,ffcc99,996633,'\ 
     380            '333300,00ff00&amp;chl=Folder|Document|Event|Topic&amp;'\ 
     381            'chbh=a,10,0&amp;chs=800x375&amp;cht=bvs&amp;'\ 
     382            'chtt=Content+type+by+state&amp;chdl=private|published|'\ 
     383            'No+workflow&amp;chdlp=b"/>' 
    378384 
    379385        chart_tag = plone4chart_tag 
     
    442448                                     self.view.getPropsList()) 
    443449        lslots = plone_portlets_info[0]['left_slots'] 
    444         self.assert_(filter(lambda info: info['title'] == 'Calendar', lslots)) 
     450        self.assert_(info for info in lslots if info['title'] == 'Calendar') 
    445451 
    446452 
Note: See TracChangeset for help on using the changeset viewer.