summaryrefslogtreecommitdiffstats
path: root/lib/bb/COW.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-03-24 16:56:12 -0700
committerChris Larson <chris_larson@mentor.com>2010-04-09 19:38:37 -0700
commit2caf134b43a44dad30af4fbe33033b3c58deee57 (patch)
treef0f72340efc339293efe2629864dc215b8576ba9 /lib/bb/COW.py
parent297305b3742323d09d9ca58e958c4f18e945a148 (diff)
downloadopenembedded-core-contrib-2caf134b43a44dad30af4fbe33033b3c58deee57.tar.gz
Formatting cleanups
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/COW.py')
-rw-r--r--lib/bb/COW.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/bb/COW.py b/lib/bb/COW.py
index ca206cf4b4..224213db5c 100644
--- a/lib/bb/COW.py
+++ b/lib/bb/COW.py
@@ -3,7 +3,7 @@
#
# This is a copy on write dictionary and set which abuses classes to try and be nice and fast.
#
-# Copyright (C) 2006 Tim Amsell
+# Copyright (C) 2006 Tim Amsell
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -18,7 +18,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
-#Please Note:
+#Please Note:
# Be careful when using mutable types (ie Dict and Lists) - operations involving these are SLOW.
# Assign a file to __warn__ to get warnings about slow operations.
#
@@ -40,7 +40,7 @@ MUTABLE = "__mutable__"
class COWMeta(type):
pass
-
+
class COWDictMeta(COWMeta):
__warn__ = False
__hasmutable__ = False
@@ -64,7 +64,7 @@ class COWDictMeta(COWMeta):
cls.__hasmutable__ = True
key += MUTABLE
setattr(cls, key, value)
-
+
def __getmutable__(cls, key, readonly=False):
nkey = key + MUTABLE
try:
@@ -98,8 +98,8 @@ class COWDictMeta(COWMeta):
value = getattr(cls, key)
except AttributeError:
value = cls.__getmutable__(key, readonly)
-
- # This is for values which have been deleted
+
+ # This is for values which have been deleted
if value is cls.__marker__:
raise AttributeError("key %s does not exist." % key)
@@ -127,7 +127,7 @@ class COWDictMeta(COWMeta):
def iter(cls, type, readonly=False):
for key in dir(cls):
if key.startswith("__"):
- continue
+ continue
if key.endswith(MUTABLE):
key = key[:-len(MUTABLE)]
@@ -176,13 +176,13 @@ class COWSetMeta(COWDictMeta):
def remove(cls, value):
COWDictMeta.__delitem__(cls, repr(hash(value)))
-
+
def __in__(cls, value):
return COWDictMeta.has_key(repr(hash(value)))
def iterkeys(cls):
raise TypeError("sets don't have keys")
-
+
def iteritems(cls):
raise TypeError("sets don't have 'items'")
@@ -286,7 +286,7 @@ if __name__ == "__main__":
print "Boo!"
else:
print "Yay - has_key with delete works!"
-
+
print "a", a
for x in a.iteritems():
print x