Deleted Added
sdiff udiff text old ( 3105:993f1abefd67 ) new ( 3109:c3956807347f )
full compact
1# Copyright (c) 2004-2006 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 25 unchanged lines hidden (view full) ---

34#####################################################################
35
36class BaseProxy(object):
37 def __init__(self, search_self, search_up):
38 self._search_self = search_self
39 self._search_up = search_up
40 self._multiplier = None
41
42 def __setattr__(self, attr, value):
43 if not attr.startswith('_'):
44 raise AttributeError, \
45 "cannot set attribute '%s' on proxy object" % attr
46 super(BaseProxy, self).__setattr__(attr, value)
47
48 # support multiplying proxies by constants
49 def __mul__(self, other):

--- 47 unchanged lines hidden (view full) ---

97 except TypeError:
98 if index != 0:
99 raise
100 # if index is 0 and item is not subscriptable, just
101 # use item itself (so cpu[0] works on uniprocessors)
102 return obj
103 getindex = staticmethod(getindex)
104
105 def set_param_desc(self, pdesc):
106 self._pdesc = pdesc
107
108class AttrProxy(BaseProxy):
109 def __init__(self, search_self, search_up, attr):
110 super(AttrProxy, self).__init__(search_self, search_up)
111 self._attr = attr
112 self._modifiers = []

--- 82 unchanged lines hidden ---