Skip to content
This repository has been archived by the owner on Dec 18, 2020. It is now read-only.

Commit

Permalink
Provide hook to get PAU in a different way
Browse files Browse the repository at this point in the history
  • Loading branch information
jukart committed Sep 15, 2006
1 parent c3a140a commit 8592d61
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/z3c/sampledata/generator/principals.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ def generate(self, context, param={}, dataSource=[], seed=None):
originalSite = hooks.getSite()
hooks.setSite(context)
sm = zope.component.getSiteManager(context)
self.pau = sm
for loc in param['pauLocation'].split('/'):
self.pau = self.pau[loc]
self.pau = self._getPAU(sm, param)
self.passwordManagerName = param['passwordManager']

numCreated = 0
Expand All @@ -140,6 +138,13 @@ def generate(self, context, param={}, dataSource=[], seed=None):

return self.pau

def _getPAU(self, sm, param):
pau = sm
for loc in param['pauLocation'].split('/'):
pau = pau[loc]
return pau


def _createPrincipal(self, info):
login = unicode(info[0])
self.logins.append(login)
Expand Down

0 comments on commit 8592d61

Please sign in to comment.