Ignore:
Timestamp:
25 Jun 2012, 11:22:19 (12 years ago)
Author:
Henrik Bettermann
Message:

Add UsersExporter?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/userscontainer.txt

    r8343 r8787  
    4848    '{SSHA}...'
    4949
     50We can export user accounts:
     51
     52    >>> from waeup.kofa.userscontainer import UsersExporter
     53    >>> import os
     54    >>> import tempfile
     55    >>> workdir = tempfile.mkdtemp()
     56    >>> outfile = os.path.join(workdir, 'myoutput.csv')
     57    >>> exporter = UsersExporter()
     58    >>> site = {'users':myusers}
     59    >>> exporter.export_all(site, outfile)
     60    >>> result = open(outfile, 'rb').read()
     61    >>> 'name,title,public_name,description,email,phone,roles,local_roles,password' in result
     62    True
     63    >>> '{SSHA}' in result
     64    True
     65
    5066We can delete users:
    5167
Note: See TracChangeset for help on using the changeset viewer.