Changeset 5763


Ignore:
Timestamp:
13 Feb 2011, 14:40:04 (14 years ago)
Author:
uli
Message:

Clean up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicants.py

    r5753 r5763  
    108108
    109109class ApplicantTraverser(grok.Traverser):
     110    """Get image of the context applicant.
     111
     112    Each applicant can provide a passport photograph which will be
     113    returned by this traverser if:
     114
     115    - we request the exact filename of the picture or
     116
     117    - ask for a picture named 'passport.jpg'.
     118
     119    If no picture was stored yet, we get a placeholder image when
     120    asking for `passport.jpg`.
     121
     122    If none of the above applies, we return ``None``, most probably
     123    resulting a :exc:`NotFound` exception.
     124   
     125    """
    110126    grok.context(IApplicant)
    111127    def traverse(self, name):
    112         #passport_filename = self.context.passport.filename
    113128        passport_filename = getattr(self.context.passport, 'filename', None)
    114         print "FILENAME: ", passport_filename
    115129        if name == passport_filename:
    116             print "USE FILE", self.context.passport
    117130            return self.context.passport
    118131        if name == 'passport.jpg':
    119             if self.context.passport is not None:
    120                 print "PP: ", self.context.passport
     132            if self.context.passport is not False:
    121133                return self.context.passport
    122134            return PassportImage(None)
     135        return
    123136
    124137class ApplicantFactory(grok.GlobalUtility):
Note: See TracChangeset for help on using the changeset viewer.