From 0825a8b64cf4c5fc82ada3268cbb121d0089e7a7 Mon Sep 17 00:00:00 2001 From: alex_nanou Date: Fri, 14 May 2004 15:43:47 +0000 Subject: [PATCH] *** empty log message *** --- PKG-INFO | 2 +- pli/pattern/proxy/aclproxy.py | 24 +++++++++++++----------- pli/pattern/proxy/objselfproxy.py | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/PKG-INFO b/PKG-INFO index d1a0ba9..804c003 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: pli -Version: 0.0.31 +Version: 0.0.32 Summary: PLI: a utility library for the Python language. Home-page: http://pli.sourceforge.net/ Author: Alex A. Naanou diff --git a/pli/pattern/proxy/aclproxy.py b/pli/pattern/proxy/aclproxy.py index 269d7e0..e68ff6e 100644 --- a/pli/pattern/proxy/aclproxy.py +++ b/pli/pattern/proxy/aclproxy.py @@ -1,7 +1,7 @@ #======================================================================= __version__ = '''0.0.03''' -__sub_version__ = '''20040216232534''' +__sub_version__ = '''20040514192432''' __copyright__ = '''(c) Alex A. Naanou 2003''' @@ -46,14 +46,13 @@ class AccessTranslationProxy(object): def __getattr__(self, name): ''' ''' + r_name = name if hasattr(self, '__attr_spec__') and self.__attr_spec__ != None: attr_spec = self.__attr_spec__ - r_name = name if name not in attr_spec: if hasattr(self, '__strict_spec__') and self.__strict_spec__: # attr not in spec... - ##!!! - raise NameError, '' + raise NameError, 'object %s has no attribute "%s"' % (self, name) else: # check self.__attr_spec__ .... spec = attr_spec[name] @@ -64,25 +63,26 @@ class AccessTranslationProxy(object): spec = spec['reader'] if spec == None: # attr is not readable... - ##!!! - raise NameError, '' + raise NameError, 'object %s has no attribute "%s"' % (self, name) elif type(spec) in (str, unicode): r_name = spec else: ##!!! should we pass an arg here??? return spec(r_name) + ##!!! is this affected by __strict_spec__?? + else: + raise NameError, 'object %s has no attribute "%s"' % (self, name) return self.__datareader__(r_name) def __setattr__(self, name, val): ''' ''' + r_name = name if hasattr(self, '__attr_spec__') and self.__attr_spec__ != None: attr_spec = self.__attr_spec__ - r_name = name if name not in attr_spec: if hasattr(self, '__strict_spec__') and self.__strict_spec__: # attr not in spec... - ##!!! - raise NameError, '' + raise NameError, 'attribute "%s" of object %s is not writable.' % (name, self) else: # check self.__attr_spec__ .... spec = attr_spec[name] @@ -93,13 +93,15 @@ class AccessTranslationProxy(object): spec = spec['writer'] if spec == None: # attr is not writable... - ##!!! - raise NameError, '' + raise NameError, 'attribute "%s" of object %s is not writable.' % (name, self) elif type(spec) in (str, unicode): r_name = spec else: ##!!! should we pass an arg here??? return spec(r_name, val) + ##!!! is this affected by __strict_spec__?? + else: + raise NameError, 'attribute "%s" of object %s is not writable.' % (name, self) return self.__datawriter__(r_name, val) # LL direct (dumb) data accessors.... # this is the place to put any far-side (post) acl checks... diff --git a/pli/pattern/proxy/objselfproxy.py b/pli/pattern/proxy/objselfproxy.py index ba68c68..ac51cc6 100644 --- a/pli/pattern/proxy/objselfproxy.py +++ b/pli/pattern/proxy/objselfproxy.py @@ -1,7 +1,7 @@ #======================================================================= __version__ = '''0.0.09''' -__sub_version__ = '''20040321190810''' +__sub_version__ = '''20040514193254''' __copyright__ = '''(c) Alex A. Naanou 2003''' @@ -17,7 +17,7 @@ import pli.pattern.proxy.utils as utils #----------------------------------------------------------------------- #-----------------------------------------------StaticObjectSelfProxy--- # -# the goal of this is to wrap the object shadow its namespace with +# the goal of this is to wrap the object and shadow its namespace with # another (this is somethong like inheriting from the object and # defining aditional data). # this is done by: -- 2.11.4.GIT