Changeset 3119 in products


Ignore:
Timestamp:
Apr 14, 2011 6:09:56 PM (11 years ago)
Author:
kroman0
Message:

Pyflakes and pep8 fixes #6

Location:
quintagroup.plonecomments/trunk/quintagroup/plonecomments
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonecomments/trunk/quintagroup/plonecomments/Extensions/Install.py

    r968 r3119  
    55    out = StringIO() 
    66    setup_tool = getToolByName(self, 'portal_setup') 
    7     setup_tool.runAllImportStepsFromProfile('profile-quintagroup.plonecomments:default') 
     7    profile = 'profile-quintagroup.plonecomments:default' 
     8    setup_tool.runAllImportStepsFromProfile(profile) 
    89    print >> out, "Imported install profile." 
    910    return out.getvalue() 
     
    1213    out = StringIO() 
    1314    setup_tool = getToolByName(self, 'portal_setup') 
    14     setup_tool.runAllImportStepsFromProfile('profile-quintagroup.plonecomments:uninstall') 
     15    profile = 'profile-quintagroup.plonecomments:uninstall' 
     16    setup_tool.runAllImportStepsFromProfile(profile) 
    1517    print >> out, "Imported uninstall profile." 
    1618    return out.getvalue() 
  • quintagroup.plonecomments/trunk/quintagroup/plonecomments/tests/config.py

    r3115 r3119  
    1717PERM_NAME = 'Moderate Discussion' 
    1818USERS = {  # Common Members 
    19          'admin':{'passw': 'secret_admin', 'roles': ['Manager']}, 
    20          'owner':{'passw': 'secret_owner', 'roles': ['Owner']}, 
    21          'member':{'passw': 'secret_member', 'roles': ['Member']}, 
    22          'reviewer':{'passw': 'secret_reviewer', 'roles': ['Reviewer']}, 
     19         'admin': {'passw': 'secret_admin', 'roles': ['Manager']}, 
     20         'owner': {'passw': 'secret_owner', 'roles': ['Owner']}, 
     21         'member': {'passw': 'secret_member', 'roles': ['Member']}, 
     22         'reviewer': {'passw': 'secret_reviewer', 'roles': ['Reviewer']}, 
    2323           # Members for discussion manager group 
    24          'dm_admin':{'passw': 'secret_dm_admin', 'roles': ['Manager']}, 
    25          'dm_owner':{'passw': 'secret_dm_owner', 'roles': ['Owner']}, 
    26          'dm_member':{'passw': 'secret_dm_member', 'roles': ['Member']}, 
    27          'dm_reviewer':{'passw': 'secret_dm_reviewer', 'roles': ['Reviewer']}, 
     24         'dm_admin': {'passw': 'secret_dm_admin', 'roles': ['Manager']}, 
     25         'dm_owner': {'passw': 'secret_dm_owner', 'roles': ['Owner']}, 
     26         'dm_member': {'passw': 'secret_dm_member', 'roles': ['Member']}, 
     27         'dm_reviewer': {'passw': 'secret_dm_reviewer', 'roles': ['Reviewer']}, 
    2828        } 
    2929COMMON_USERS_IDS = [u for u in USERS.keys() if not u.startswith('dm_')] 
  • quintagroup.plonecomments/trunk/quintagroup/plonecomments/tests/helperNotify.py

    r1633 r3119  
    1414def testMailExistance(sel): 
    1515    mailhost = sel.portal.MailHost 
    16     if mailhost.messages:  
     16    if mailhost.messages: 
    1717        return True 
    1818    return False 
  • quintagroup.plonecomments/trunk/quintagroup/plonecomments/tests/testQPloneCommentsCommenting.py

    r3116 r3119  
    7070        self.login('dm_admin') 
    7171        replies_after = len(self.discussion.getDiscussionFor(doc_obj).getReplies()) 
    72         self.failUnless(replies_after-replies_before, 
     72        self.failUnless(replies_after - replies_before, 
    7373            "Anonymous user CAN'T really add comment in terned ON *Anonymous commenting mode*.") 
    7474 
  • quintagroup.plonecomments/trunk/quintagroup/plonecomments/tests/testQPloneCommentsNotification.py

    r3114 r3119  
    4949 
    5050        # Add Manager user - 'dm' and add him to Discussion Manager group 
    51         self.portal.portal_membership.addMember('dm', 'secret' , ['Manager'], []) 
     51        self.portal.portal_membership.addMember('dm', 'secret', ['Manager'], []) 
    5252        portal_groups = getToolByName(self.portal, 'portal_groups') 
    5353        dm_group = portal_groups.getGroupById('DiscussionManager') 
  • quintagroup.plonecomments/trunk/quintagroup/plonecomments/tests/testQPloneCommentsPermission.py

    r3112 r3119  
    1313 
    1414    def test_install_moderate_discussion_permission(self): 
    15         roles = [item['name'] for item in self.portal.rolesOfPermission(PERM_NAME) if item['selected'] == 'SELECTED'] 
    16         self.failUnless( roles != [], '%s not installed'%PERM_NAME) 
     15        roles = [item['name'] 
     16                 for item in self.portal.rolesOfPermission(PERM_NAME) 
     17                 if item['selected'] == 'SELECTED'] 
     18        self.failUnless(roles != [], '%s not installed' % PERM_NAME) 
    1719 
    1820    def test_deleteReply_permission(self): 
  • quintagroup.plonecomments/trunk/quintagroup/plonecomments/utils.py

    r3118 r3119  
    44from Products.CMFCore.utils import getToolByName 
    55from Products.CMFPlone.utils import safe_unicode 
     6 
    67 
    78# Get apropriate property from (propery_sheeet) configlet 
     
    1415    return result 
    1516 
     17 
    1618def publishDiscussion(self): 
    1719    roles = ['Anonymous'] 
     
    2022    self._p_changed = 1 
    2123    self.reindexObject() 
     24 
    2225 
    2326def setAnonymCommenting(context, allow=False): 
     
    3538            portal.manage_permission('Reply to item', roles, 1) 
    3639 
     40 
    3741def manage_mails(reply, context, action): 
    3842    def sendMails(props, actions, key): 
     
    7175            sendMails(props, actions, 'onAuthenticatedReportAbuse') 
    7276 
     77 
    7378def getMsg(context, template, args): 
    7479    return getattr(context, template)(**args) 
     80 
    7581 
    7682def allowEmail(context, reply, state, creator): 
     
    7985        condition = condition(reply=reply, state=state, creator=creator) 
    8086    return condition 
     87 
    8188 
    8289def send_email(reply, context, state): 
     
    251258                  'Have you configured an email server for Plone?')) 
    252259 
     260 
    253261def setStatusMsg(state, context, msg): 
    254262    context.plone_utils.addPortalMessage(msg) 
Note: See TracChangeset for help on using the changeset viewer.