Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pyflakes result fix: local variable is assigned to but never used

  • Loading branch information...
commit a2364dc3c09ce09794bb4fc15003f3db99b66310 1 parent 150e6f9
@zothar zothar authored
View
4 gprof2dot.py
@@ -1188,7 +1188,6 @@ def parse_association_spec(self):
_, values = line.split('=', 1)
values = values.strip().split()
calls = int(values[0])
- call_position = values[1:]
self.consume()
self.parse_cost_line(calls)
@@ -1352,8 +1351,6 @@ def parse(self):
profile = Profile()
- reverse_call_samples = {}
-
# populate the profile
profile[SAMPLES] = 0
for _callers, _function, _callees in self.entries.itervalues():
@@ -1945,7 +1942,6 @@ def parse_results(self):
return table
def parse_data(self):
- rows = []
attrs = self.element_start('DATA')
table_id = int(attrs['TABLE_ID'])
table_name, field_types, field_names = self.tables[table_id]
View
4 indev.py
@@ -299,7 +299,7 @@ def numbersToFloats(ent):
# output_file = gzip.open(self.filename, "wb", compresslevel=1)
try:
os.rename(filename, filename + ".old")
- except Exception, e:
+ except Exception:
pass
try:
@@ -309,7 +309,7 @@ def numbersToFloats(ent):
try:
os.remove(filename + ".old")
- except Exception, e:
+ except Exception:
pass
self.BlockLight = self.Data & 0xf
View
2  infiniteworld.py
@@ -2892,7 +2892,7 @@ def addEntity(self, entityTag):
try:
chunk = self.getChunk(x >> 4, z >> 4)
- except (ChunkNotPresent, ChunkMalformed), e:
+ except (ChunkNotPresent, ChunkMalformed):
return None
# raise Error, can't find a chunk?
chunk.addEntity(entityTag)
View
3  level.py
@@ -91,7 +91,6 @@ def getSlices(box, height):
if cx == box.maxcx - 1:
localMaxX = maxxoff
newMinX = localMinX + (cx << 4) - box.minx
- newMaxX = localMaxX + (cx << 4) - box.minx
for cz in range(box.mincz, box.maxcz):
localMinZ = 0
@@ -101,7 +100,6 @@ def getSlices(box, height):
if cz == box.maxcz - 1:
localMaxZ = maxzoff
newMinZ = localMinZ + (cz << 4) - box.minz
- newMaxZ = localMaxZ + (cz << 4) - box.minz
slices, point = (
(slice(localMinX, localMaxX), slice(localMinZ, localMaxZ), slice(miny, maxy)),
(newMinX, newMinY, newMinZ)
@@ -662,7 +660,6 @@ def copyEntitiesFromIter(self, sourceLevel, sourceBox, destinationPoint, entitie
# if not self.hasEntities or not sourceLevel.hasEntities:
# return
sourcePoint0 = sourceBox.origin
- sourcePoint1 = sourceBox.maximum
if sourceLevel.isInfinite:
for i in self.copyEntitiesFromInfiniteIter(sourceLevel, sourceBox, destinationPoint, entities):
View
28 materials.py
@@ -179,19 +179,21 @@ def addYamlBlocks(self, blockyaml):
def addYamlBlock(self, kw):
blockID = kw['id']
- unused_yaml_properties = \
- ['explored',
- # 'id',
- # 'idStr',
- # 'mapcolor',
- # 'name',
- # 'tex',
- ### 'tex_data',
- # 'tex_direction',
- ### 'tex_direction_data',
- 'tex_extra',
- # 'type'
- ]
+ # xxx unused_yaml_properties variable unused; needed for
+ # documentation purpose of some sort? -zothar
+ #unused_yaml_properties = \
+ #['explored',
+ # # 'id',
+ # # 'idStr',
+ # # 'mapcolor',
+ # # 'name',
+ # # 'tex',
+ # ### 'tex_data',
+ # # 'tex_direction',
+ # ### 'tex_direction_data',
+ # 'tex_extra',
+ # # 'type'
+ # ]
for val, data in kw.get('data', {0: {}}).items():
datakw = dict(kw)
View
11 mce.py
@@ -527,8 +527,6 @@ def _import(self, command):
importLevel = mclevel.fromFile(filename)
- destBox = BoundingBox(destPoint, importLevel.size)
-
self.level.copyBlocksFrom(importLevel, importLevel.bounds, destPoint, blocksToCopy, create=True)
self.needsSave = True
@@ -681,9 +679,7 @@ def printFreeSectors(runs):
print "Region {rx},{rz} not found.".format(**locals())
return
- used = rf.usedSectors
- sectors = rf.sectorCount
- print "Region {rx:6}, {rz:6}: {used}/{sectors} sectors".format(**locals())
+ print "Region {rx:6}, {rz:6}: {used}/{sectors} sectors".format(used=rf.usedSectors, sectors=rf.sectorCount)
print "Offset Table:"
for cx in range(32):
for cz in range(32):
@@ -715,8 +711,7 @@ def printFreeSectors(runs):
level.allChunks
coords = (r for r in level.regionFiles)
for i, (rx, rz) in enumerate(coords):
- count = level.regionFiles[rx, rz].chunkCount
- print "({rx:6}, {rz:6}): {count}, ".format(**locals()),
+ print "({rx:6}, {rz:6}): {count}, ".format(count=level.regionFiles[rx, rz].chunkCount),
if i % 5 == 4:
print ""
@@ -1376,7 +1371,7 @@ def run(self):
logging.basicConfig(format=u'%(levelname)s:%(message)s')
logging.getLogger().level = logging.INFO
- appPath = sys.argv.pop(0)
+ sys.argv.pop(0)
if len(sys.argv):
world = sys.argv.pop(0)
View
3  schematic.py
@@ -541,12 +541,9 @@ def extractZipSchematicFromIter(sourceLevel, box, zipfilename=None, entities=Tru
tempfolder = tempfile.mktemp("schematic")
try:
- done = False
tempSchematic = MCInfdevOldLevel(tempfolder, create=True)
tempSchematic.materials = sourceLevel.materials
- destBox = BoundingBox(destPoint, sourceBox.size)
-
for i in tempSchematic.copyBlocksFromIter(sourceLevel, sourceBox, destPoint, entities=entities, create=True):
yield i
tempSchematic.saveInPlace() # lights not needed for this format - crashes minecraft though
Please sign in to comment.
Something went wrong with that request. Please try again.