From 5d482a67ff94ba27d3e2abcea4c7bdfb93c15536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Sat, 29 Aug 2020 20:00:02 +0200 Subject: [PATCH] Reformat offlineimap/utils/const.py Add some spaces, remove lines,... now format is better (lintian). --- offlineimap/utils/const.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/offlineimap/utils/const.py b/offlineimap/utils/const.py index f4584bc..7dab07a 100644 --- a/offlineimap/utils/const.py +++ b/offlineimap/utils/const.py @@ -5,6 +5,7 @@ import copy + class ConstProxy(object): """Implements read-only access to a given object that can be attached to each instance only once.""" @@ -12,23 +13,19 @@ class ConstProxy(object): def __init__(self): self.__dict__['__source'] = None - def __getattr__(self, name): src = self.__dict__['__source'] if src == None: raise ValueError("using non-initialized ConstProxy() object") return copy.deepcopy(getattr(src, name)) - def __setattr__(self, name, value): - raise AttributeError("tried to set '%s' to '%s' for constant object"% \ - (name, value)) - + raise AttributeError("tried to set '%s' to '%s' for constant object" % \ + (name, value)) def __delattr__(self, name): - raise RuntimeError("tried to delete field '%s' from constant object"% \ - (name)) - + raise RuntimeError("tried to delete field '%s' from constant object" % \ + (name)) def set_source(self, source): """ Sets source object for this instance. """