# Path: sshproxy/registry.py
# class Registry(object):
#     _registry = {}
#     _singletons = {}
#     _singleton = False
#     _class_base = object
# 
# 
#     @classmethod
#     def register(cls):
#         """
#         Register an object class.
#         """
# 
#         #print '%s.register(%s)' % (cls.__name__, cls._class_id)
#         Registry._registry[cls._class_id] = cls
# 
# 
#     def __new__(cls, *args, **kw):
#         """
#         Return an instance of the previously registered class.
# 
#         If the class is a singleton, and was already instanciated,
#         ignore arguments supplied and return singleton instance.
# 
#         """
# 
#         obj_class = Registry._registry[cls._class_id]
#         if cls._singleton:
#             theone = Registry._singletons.get(cls._class_id)
#             if theone is None:
#                 theone = cls._class_base.__new__(obj_class)
#                 Registry._singletons[cls._class_id] = theone
#                 theone.__reginit__(*args, **kw)
#             return theone
#             
#         else:
#             obj = cls._class_base.__new__(obj_class)
#             obj.__reginit__(*args, **kw)
#             return obj
# 
#     def __reginit__(self, *args, **kw):
#         raise NotImplementedError("__reginit__ has not been implemented in %s" % self.__class__.__name__)
#         pass
# 
# Path: sshproxy/util.py
# def utf8(s):
#     return convert(s, 'utf8')


import cmd, os, socket
        import getpass
            import sys, termios
            import log
from sshproxy.registry import Registry
from sshproxy.util import utf8
        from getpass import getpass
                finally:
                    termios.tcsetattr(ifd, termios.TCSADRAIN, old)
            except KeyboardInterrupt:
                raise
            except:
                log.exception("_raw_input")
                raise

        getpass._raw_input = _raw_input

        try:
            try:
                site, privkey = self._set_password(line, prompt1, prompt2)
            finally:
                getpass._raw_input = _ri
        except TypeError:
            return
        except KeyboardInterrupt:
            print "Aborted."
            return


        response = self.ipc.call("set_site_privkey", "%s privkey=%s" %
                                                (site, repr(privkey)))
        print response

    def emptyline(self):
        return

    def do_exit(self, arg):

# Path: sshproxy/registry.py
# class Registry(object):
#     _registry = {}
#     _singletons = {}
#     _singleton = False
#     _class_base = object
# 
# 
#     @classmethod
#     def register(cls):
#         """
#         Register an object class.
#         """
# 
#         #print '%s.register(%s)' % (cls.__name__, cls._class_id)
#         Registry._registry[cls._class_id] = cls
# 
# 
#     def __new__(cls, *args, **kw):
#         """
#         Return an instance of the previously registered class.
# 
#         If the class is a singleton, and was already instanciated,
#         ignore arguments supplied and return singleton instance.
# 
#         """
# 
#         obj_class = Registry._registry[cls._class_id]
#         if cls._singleton:
#             theone = Registry._singletons.get(cls._class_id)
#             if theone is None:
#                 theone = cls._class_base.__new__(obj_class)
#                 Registry._singletons[cls._class_id] = theone
#                 theone.__reginit__(*args, **kw)
#             return theone
#             
#         else:
#             obj = cls._class_base.__new__(obj_class)
#             obj.__reginit__(*args, **kw)
#             return obj
# 
#     def __reginit__(self, *args, **kw):
#         raise NotImplementedError("__reginit__ has not been implemented in %s" % self.__class__.__name__)
#         pass
# 
# Path: sshproxy/util.py
# def utf8(s):
#     return convert(s, 'utf8')


# Path: sshproxy/console.py
import cmd, os, socket
        import getpass
            import sys, termios
            import log
from sshproxy.registry import Registry
from sshproxy.util import utf8
        from getpass import getpass

                finally:
                    termios.tcsetattr(ifd, termios.TCSADRAIN, old)
            except KeyboardInterrupt:
                raise
            except:
                log.exception("_raw_input")
                raise

        getpass._raw_input = _raw_input

        try:
            try:
                site, privkey = self._set_password(line, prompt1, prompt2)
            finally:
                getpass._raw_input = _ri
        except TypeError:
            return
        except KeyboardInterrupt:
            print "Aborted."
            return


        response = self.ipc.call("set_site_privkey", "%s privkey=%s" %
                                                (site, repr(privkey)))
        print response

    def emptyline(self):
        return

    def do_exit(self, arg):

        return True