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