Repository : http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
commit 5b07ad7e0de8ba2213189b810867326ea2571fbc Author: Peter Hatina phatina@redhat.com Date: Mon Oct 29 17:07:56 2012 +0100
introduce BaseObject
cli-tools/lmi/lmi_client_shell.py | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/cli-tools/lmi/lmi_client_shell.py b/cli-tools/lmi/lmi_client_shell.py index 590a175..356f984 100644 --- a/cli-tools/lmi/lmi_client_shell.py +++ b/cli-tools/lmi/lmi_client_shell.py @@ -40,7 +40,18 @@ class _LmiErrorHandler(object): def __str__(self): return ""
-class _LmiNamespace(object): +# Base class for classes, that are used for tab-completion. +# Used due to deprecated methods since python 2.2. +class BaseObject(object): + # deprecated + def __methods__(self): + return [] + + # deprecated + def __members__(self): + return [] + +class _LmiNamespace(BaseObject): def __init__(self, client, name): super(self.__class__, self).__init__() self.m_client = client @@ -71,7 +82,7 @@ class _LmiNamespace(object): for c in class_name_list: sys.stdout.write("%s\n" % c)
-class _LmiClass(object): +class _LmiClass(BaseObject): def __init__(self, client, namespace, klass): super(self.__class__, self).__init__() self.m_client = client @@ -138,8 +149,8 @@ class _LmiClass(object): def namespace(self): return self.m_namespace.name
-class _LmiInstance(object): - class _LmiInstanceMethod(object): +class _LmiInstance(BaseObject): + class _LmiInstanceMethod(BaseObject): def __init__(self, client, instance, method): super(self.__class__, self).__init__() self.m_client = client
cura-tools-devel@lists.fedorahosted.org