UserKit.UserManagerToFile | index /usr/local/share/webware/UserKit/UserManagerToFile.py

`The UserManagerToFile class.`

Modules

``

os |  |  |

Classes

``

UserKit.UserManager.UserManager(__builtin__.object)
  UserManagerToFile
__builtin__.object
  UserMixIn

class UserManagerToFile(UserKit.UserManager.UserManager)

``

`User manager storing user data in the file system.
When using this user manager, make sure you invoke setUserDir()
and that this directory is writeable by your application.
It will contain one file per user with the user's serial number
as the main filename and an extension of '.user'.
The default user directory is the current working directory,
but relying on the current directory is often a bad practice.
`

Method resolution order:
  UserManagerToFile
  UserKit.UserManager.UserManager
  __builtin__.object

Methods defined here:

__init__(self, userClass=None)

activeUsers(self)

addUser(self, user)

decoder(self)

encoder(self)

inactiveUsers(self)

initNextSerialNum(self)

loadUser(self, serialNum, default=<class 'MiscUtils.NoDefault'>)
  `Load the user with the given serial number from disk.
  If there is no such user, a KeyError will be raised unless
  a default value was passed, in which case that value is returned.`

nextSerialNum(self)

scanSerialNums(self)
  `Return a list of all the serial numbers of users found on disk.
  Serial numbers are always integers.`

setEncoderDecoder(self, encoder, decoder)

setUserClass(self, userClass)
  `Overridden to mix in UserMixIn to the class that is passed in.`

setUserDir(self, userDir)
  `Set the directory where user information is stored.
  You should strongly consider invoking initNextSerialNum() afterwards.`

userDir(self)

userForExternalId(self, externalId, default=<class 'MiscUtils.NoDefault'>)

userForName(self, name, default=<class 'MiscUtils.NoDefault'>)

userForSerialNum(self, serialNum, default=<class 'MiscUtils.NoDefault'>)

users(self)

Methods inherited from UserKit.UserManager.UserManager:

activeUserTimeout(self)

cachedUserTimeout(self)

clearCache(self)
  `Clear the cache of the manager.
  Use with extreme caution. If your program maintains a reference
  to a user object, but the manager loads in a new copy later on,
  then consistency problems could occur.
  The most popular use of this method is in the regression test suite.`

createUser(self, name, password, userClass=None)
  `Return a newly created user that is added to the manager.
  If userClass is not specified, the manager's default user class
  is instantiated. This not imply that the user is logged in.
  This method invokes addUser().
  See also: userClass(), setUserClass()`

login(self, user, password)
  `Return the user if the login is successful, otherwise return None.`

loginExternalId(self, externalId, password)

loginName(self, userName, password)

loginSerialNum(self, serialNum, password)

logout(self, user)

modifiedUserTimeout(self)

numActiveUsers(self)
  `Return the number of active users, e.g., users that are logged in.`

setActiveUserTimeout(self, value)

setCachedUserTimeout(self, value)

setModifiedUserTimeout(self, value)

shutDown(self)
  `Perform any tasks necessary to shut down the user manager.
  Subclasses may override and must invoke super as their *last* step.`

userClass(self)
  `Return the userClass, which is used by createUser.
  The default value is UserKit.User.User.`

Data descriptors inherited from UserKit.UserManager.UserManager:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class UserMixIn(__builtin__.object)

``

Methods defined here:

filename(self)

save(self)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Functions

``

dump(...)
  `dump(obj, file, protocol=0) -- Write an object in pickle format to the given file.
  See the Pickler docstring for the meaning of optional argument proto.`

load(...)
  `load(file) -- Load a pickle from the given file`