27.01.2015 Views

Best Practices of Plone Development

Best Practices of Plone Development

Best Practices of Plone Development

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1.9 Debugging 1 BEST PRACTICES FOR PLONE DEVELOPMENT<br />

1.9.17 Testing a Request Options<br />

• d=1: drop into pdb and debug request<br />

• pm=1: (postmortem) drop into pdb on failure<br />

• t=1: output timing<br />

• u=’username:pass’: authenticate request as user<br />

• extra={’key’:’value’...}: add to REQUEST object<br />

• p=’file.pr<strong>of</strong>’): creating Python pr<strong>of</strong>ile data<br />

1.9.18 Example <strong>of</strong> Testing Request<br />

• Debug Membership Tool’s listMembers method:<br />

pdb> from Products.CMF<strong>Plone</strong>.MembershipTool<br />

import MembershipTool<br />

pdb> b MembershipTool.listMembers<br />

Breakpoint ... /CMF<strong>Plone</strong>/MembershipTool.py:247<br />

pdb> c<br />

> .../MembershipTool.py(247)listMembers()<br />

46

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!