# 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
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA




def rwinput(prompt):
    while 1:
        try:
            return utf8(raw_input(prompt))
        except KeyboardInterrupt:
            print
            continue
        break

# patch cmd.raw_input to be able to do CTRL-C without exiting
# and convert everything to utf8
cmd.raw_input = rwinput



# 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

# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA




def rwinput(prompt):
    while 1:
        try:
            return utf8(raw_input(prompt))
        except KeyboardInterrupt:
            print
            continue
        break

# patch cmd.raw_input to be able to do CTRL-C without exiting
# and convert everything to utf8
cmd.raw_input = rwinput



class Console(Registry, cmd.Cmd):