Permalink
Browse files

Fixed: Incorrect call arguments

Inspector assumed TagProperty was instance method
Classmethod should have cls as first argument, not self.
  • Loading branch information...
1 parent bca5e18 commit 55c23697df6f08d25b576709e7532b72e7407a24 @codewarrior0 codewarrior0 committed Oct 27, 2012
Showing with 11 additions and 11 deletions.
  1. +9 −9 infiniteworld.py
  2. +1 −1 run_regression_test.py
  3. +1 −1 schematic.py
View
@@ -1027,7 +1027,16 @@ def clipLight(light):
for ch in startingDirtyChunks:
ch.needsLighting = False
+def TagProperty(tagName, tagType, defaultValueFunc=lambda self: None):
+ def getter(self):
+ if tagName not in self.root_tag["Data"]:
+ self.root_tag["Data"][tagName] = tagType(defaultValueFunc(self))
+ return self.root_tag["Data"][tagName].value
+ def setter(self, val):
+ self.root_tag["Data"][tagName] = tagType(value=val)
+
+ return property(getter, setter)
class MCInfdevOldLevel(ChunkedLevelMixin, EntityLevel):
materials = alphaMaterials
@@ -1082,16 +1091,7 @@ def getWorldBounds(self):
def __str__(self):
return "MCInfdevOldLevel(\"" + os.path.split(self.worldDir)[1] + "\")"
- def TagProperty(tagName, tagType, defaultValueFunc=lambda self: None):
- def getter(self):
- if tagName not in self.root_tag["Data"]:
- self.root_tag["Data"][tagName] = tagType(defaultValueFunc(self))
- return self.root_tag["Data"][tagName].value
-
- def setter(self, val):
- self.root_tag["Data"][tagName] = tagType(value=val)
- return property(getter, setter)
SizeOnDisk = TagProperty('SizeOnDisk', nbt.TAG_Long)
RandomSeed = TagProperty('RandomSeed', nbt.TAG_Long)
View
@@ -65,7 +65,7 @@ def directory_clone(src):
@contextlib.contextmanager
def unzipped_content(src):
with temporary_directory() as dest:
- f = zipfile.ZipFile.open(src)
+ f = zipfile.ZipFile(src)
f.extractall(dest)
yield dest
View
@@ -299,7 +299,7 @@ def blockDataAt(self, x, y, z):
return self.Data[x, z, y]
@classmethod
- def chestWithItemID(self, itemID, count=64, damage=0):
+ def chestWithItemID(cls, itemID, count=64, damage=0):
""" Creates a chest with a stack of 'itemID' in each slot.
Optionally specify the count of items in each stack. Pass a negative
value for damage to create unnaturally sturdy tools. """

0 comments on commit 55c2369

Please sign in to comment.