-__all__ = ('ProxyHandler', 'get_service')
-
-
-def get_service(config):
- return ProxyHandler(config.proxy.pickle_dir, config.proxy.config_dir)
-
-
-class Host(Sequence):
- def __init__(self,ip):
- self.ip = ip
- def as_tuple(self):
- return (self.ip,)
-
-# TODO convert to a SetSubHandler
-
-class HostHandler(DictSubHandler):
-
- handler_help = u"Manage proxy hosts"
-
- _cont_subhandler_attr = 'hosts'
- _cont_subhandler_class = Host
-
-class User(Sequence):
- def __init__(self, name, password):
- self.name = name
- self.password = crypt.crypt(password,'BA')
- def as_tuple(self):
- return (self.name, self.password)
- def update(self, password=None):
- if password is not None:
- self.password = crypt.crypt(password,'BA')
-
-class UserHandler(DictSubHandler):
-
- handler_help = u"Manage proxy users"
-
- _cont_subhandler_attr = 'users'
- _cont_subhandler_class = User