From 1314567012d7394e9b87b7689ccc5080cb0cb981 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 12 Feb 2012 01:10:57 +0100 Subject: [PATCH] also begin to prefix type with cdist Signed-off-by: Nico Schottelius --- lib/cdist/core/__init__.py | 16 ++++++++-------- lib/cdist/core/{object.py => cdist_object.py} | 0 lib/cdist/core/{type.py => cdist_type.py} | 6 +++--- lib/cdist/test/object/__init__.py | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) rename lib/cdist/core/{object.py => cdist_object.py} (100%) rename lib/cdist/core/{type.py => cdist_type.py} (97%) diff --git a/lib/cdist/core/__init__.py b/lib/cdist/core/__init__.py index c61c659b..66ee00a5 100644 --- a/lib/cdist/core/__init__.py +++ b/lib/cdist/core/__init__.py @@ -19,11 +19,11 @@ # # -from cdist.core.type import Type -from cdist.core.type import NoSuchTypeError -from cdist.core.object import Object -from cdist.core.object import IllegalObjectIdError -from cdist.core.object import OBJECT_MARKER -from cdist.core.explorer import Explorer -from cdist.core.manifest import Manifest -from cdist.core.code import Code +from cdist.core.cdist_type import CdistType +from cdist.core.cdist_type import NoSuchTypeError +from cdist.core.cdist_object import CdistObject +from cdist.core.cdist_object import IllegalObjectIdError +from cdist.core.cdist_object import OBJECT_MARKER +from cdist.core.explorer import Explorer +from cdist.core.manifest import Manifest +from cdist.core.code import Code diff --git a/lib/cdist/core/object.py b/lib/cdist/core/cdist_object.py similarity index 100% rename from lib/cdist/core/object.py rename to lib/cdist/core/cdist_object.py diff --git a/lib/cdist/core/type.py b/lib/cdist/core/cdist_type.py similarity index 97% rename from lib/cdist/core/type.py rename to lib/cdist/core/cdist_type.py index 20365b8d..55609e7e 100644 --- a/lib/cdist/core/type.py +++ b/lib/cdist/core/cdist_type.py @@ -34,7 +34,7 @@ class NoSuchTypeError(cdist.Error): return "Type '%s' does not exist at %s" % (self.type_path, self.type_absolute_path) -class Type(object): +class CdistType(object): """Represents a cdist type. All interaction with types in cdist should be done through this class. @@ -61,7 +61,7 @@ class Type(object): # name is second argument name = args[1] if not name in cls._instances: - instance = super(Type, cls).__new__(cls) + instance = super(CdistType, cls).__new__(cls) cls._instances[name] = instance # return instance so __init__ is called return cls._instances[name] @@ -84,7 +84,7 @@ class Type(object): self.__optional_parameters = None def __repr__(self): - return '' % self.name + return '' % self.name def __eq__(self, other): return isinstance(other, self.__class__) and self.name == other.name diff --git a/lib/cdist/test/object/__init__.py b/lib/cdist/test/object/__init__.py index 9e6f1221..a633955a 100644 --- a/lib/cdist/test/object/__init__.py +++ b/lib/cdist/test/object/__init__.py @@ -38,7 +38,7 @@ class ObjectClassTestCase(test.CdistTestCase): self.assertEqual(object_names, ['__first/man', '__second/on-the', '__third/moon']) def test_list_type_names(self): - type_names = list(core.CdistObject.list_type_names(object_base_path)) + type_names = list(cdist.core.CdistObject.list_type_names(object_base_path)) self.assertEqual(type_names, ['__first', '__second', '__third']) def test_list_objects(self):