/[gnue]/gnue-appserver/src/classrep/Base.py
ViewVC logotype

Diff of /gnue-appserver/src/classrep/Base.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by jvetter, Tue May 27 14:30:57 2003 UTC revision 1.2 by reinhard, Sun Oct 19 22:08:04 2003 UTC
# Line 21  Line 21 
21  #  #
22  # $Id$  # $Id$
23    
24    import types
25    
26  # =============================================================================  # =============================================================================
27  # Class-wrapper for dictionaries  # Class-wrapper for dictionaries
# Line 86  class BaseObject: Line 87  class BaseObject:
87    # ---------------------------------------------------------------------------    # ---------------------------------------------------------------------------
88    def __getattr__ (self, attr):    def __getattr__ (self, attr):
89      try:      try:
90        return self._data [attr]        value = self._data [attr]
91          if isinstance (value, types.UnicodeType):
92            return value.encode ('utf-8')
93          else:
94            return value
95    
96      except KeyError:      except KeyError:
97        raise AttributeError, attr        raise AttributeError, attr

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26