Reformat offlineimap/utils/const.py
Add some spaces, remove lines,... now format is better (lintian).
This commit is contained in:
parent
ee236ec987
commit
5d482a67ff
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
|
|
||||||
class ConstProxy(object):
|
class ConstProxy(object):
|
||||||
"""Implements read-only access to a given object
|
"""Implements read-only access to a given object
|
||||||
that can be attached to each instance only once."""
|
that can be attached to each instance only once."""
|
||||||
@ -12,23 +13,19 @@ class ConstProxy(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.__dict__['__source'] = None
|
self.__dict__['__source'] = None
|
||||||
|
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
src = self.__dict__['__source']
|
src = self.__dict__['__source']
|
||||||
if src == None:
|
if src == None:
|
||||||
raise ValueError("using non-initialized ConstProxy() object")
|
raise ValueError("using non-initialized ConstProxy() object")
|
||||||
return copy.deepcopy(getattr(src, name))
|
return copy.deepcopy(getattr(src, name))
|
||||||
|
|
||||||
|
|
||||||
def __setattr__(self, name, value):
|
def __setattr__(self, name, value):
|
||||||
raise AttributeError("tried to set '%s' to '%s' for constant object"% \
|
raise AttributeError("tried to set '%s' to '%s' for constant object" % \
|
||||||
(name, value))
|
(name, value))
|
||||||
|
|
||||||
|
|
||||||
def __delattr__(self, name):
|
def __delattr__(self, name):
|
||||||
raise RuntimeError("tried to delete field '%s' from constant object"% \
|
raise RuntimeError("tried to delete field '%s' from constant object" % \
|
||||||
(name))
|
(name))
|
||||||
|
|
||||||
|
|
||||||
def set_source(self, source):
|
def set_source(self, source):
|
||||||
""" Sets source object for this instance. """
|
""" Sets source object for this instance. """
|
||||||
|
Loading…
Reference in New Issue
Block a user