Changeset 3556 in products


Ignore:
Timestamp:
Sep 14, 2012 10:16:29 AM (12 years ago)
Author:
vmaksymiv
Message:

PPP fixes

Location:
quintagroup.portlet.collection/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.portlet.collection/trunk/quintagroup/portlet/collection/browser/configlet.py

    r1572 r3556  
    2323    title = schema.TextLine(title=u"title", required=False) 
    2424 
     25 
    2526class ValueTitlePair(object): 
    2627    implements(IValueTitlePair) 
     28 
    2729    def __init__(self, value='', title=''): 
    2830        self.value = value 
    2931        self.title = title 
     32 
    3033 
    3134class IQCollectionPortletPanelSchema(Interface): 
     
    4043    ) 
    4144 
     45 
    4246class QCollectionPortletControlPanelAdapter(SchemaAdapterBase): 
    4347    adapts(IPloneSiteRoot) 
     
    5054 
    5155    def get_portlet_dropdown(self): 
    52         return  [ValueTitlePair(v,t) for (v,t) in getStylesVocabulary(self.context)] 
     56        return [ValueTitlePair(v, t) for (v, t) in getStylesVocabulary( 
     57            self.context)] 
    5358 
    5459    def set_portlet_dropdown(self, value): 
     
    7984                                         subwidget=valuetitle_widget) 
    8085 
     86 
    8187class QCollectionPortletControlPanel(ControlPanelForm): 
    8288 
     
    8692    label = _("QCollection portlet settings") 
    8793    description = _("This form is for managing QCollection portlet " 
    88                      "classes available on portlet add/edit form.") 
     94                    "classes available on portlet add/edit form.") 
    8995    form_name = _("QCollection portlet settings") 
  • quintagroup.portlet.collection/trunk/quintagroup/portlet/collection/tests/base.py

    r2755 r3556  
    66from Products.PloneTestCase import PloneTestCase as ptc 
    77from Products.PloneTestCase.layer import onsetup 
     8 
    89 
    910@onsetup 
     
    3435ptc.setupPloneSite(products=['quintagroup.portlet.collection']) 
    3536 
     37 
    3638class TestCase(ptc.PloneTestCase): 
    3739    """Base class used for test cases 
    3840    """ 
    3941 
     42 
    4043class FunctionalTestCase(ptc.FunctionalTestCase): 
    4144    """Test case class used for functional (doc-)tests 
  • quintagroup.portlet.collection/trunk/quintagroup/portlet/collection/tests/test_portlet.py

    r3555 r3556  
    195195 
    196196    def testRandomQuery(self): 
    197         # we're being perhaps a bit too clever in random mode with the internals of the 
    198         # LazyMap returned by the collection query, so let's try a bunch of scenarios 
    199         # to make sure they work 
     197        # we're being perhaps a bit too clever in random mode with the 
     198        # internals of the LazyMap returned by the collection query, so let's 
     199        # try a bunch of scenarios to make sure they work 
    200200 
    201201        def reset_memoize(inst): 
    202             # Decorator memoize adds attribute ('_memojito_') to class instance. 
     202            # Decorator memoize adds attribute('_memojito_') to class instance. 
    203203            # It has cached function and their values so it should be deleted 
    204204            # for testing. 
     
    222222            getattr(self.folder, 'folder_%s' % i).reindexObject() 
    223223 
    224         # collection with no criteria -- should return empty list, without error 
     224        # collection with no criteria -- should return empty list, without 
     225        # error 
    225226        self.assertEqual(len(collectionrenderer.results()), 0) 
    226227        reset_memoize(collectionrenderer) 
     
    253254        collectionrenderer.results() 
    254255 
    255         # collection with sorting -- should behave similarly (sort is ignored internally) 
     256        # collection with sorting -- should behave similarly (sort is 
     257        # ignored internally) 
    256258        self.folder.collection.setSortCriterion('modified', False) 
    257259        self.assertEqual(len(collectionrenderer.results()), 1) 
    258260        reset_memoize(collectionrenderer) 
    259261 
    260         # same criteria, now with limit set to 2 -- should return 2 (random) folders 
     262        # same criteria, now with limit set to 2 -- should return 2 (random) 
     263        # folders 
    261264        collectionrenderer.data.limit = 2 
    262265        self.assertEqual(len(collectionrenderer.results()), 2) 
    263266        reset_memoize(collectionrenderer) 
    264267 
    265         # make sure there's no error if the limit is greater than the # of results found 
     268        # make sure there's no error if the limit is greater than the # of 
     269        # results found 
    266270        collectionrenderer.data.limit = 10 
    267271        self.failUnless(len(collectionrenderer.results()) >= 6) 
  • quintagroup.portlet.collection/trunk/setup.py

    r3552 r3556  
    88      description="Extended collection portlet", 
    99      long_description=open("README.txt").read() + "\n" + 
    10                        open(os.path.join("docs", "HISTORY.txt")).read(), 
     10      open(os.path.join("docs", "HISTORY.txt")).read(), 
    1111      # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers 
    1212      classifiers=[ 
    13         "Programming Language :: Python", 
    14         "Topic :: Software Development :: Libraries :: Python Modules", 
    15         ], 
     13          "Programming Language :: Python", 
     14          "Topic :: Software Development :: Libraries :: Python Modules", 
     15      ], 
    1616      keywords='portlet collection quintagroup', 
    1717      author='Melnychuk Taras', 
Note: See TracChangeset for help on using the changeset viewer.