pep8 compliance: E302 expected 2 blank lines

This commit is contained in:
David Sowder 2012-02-21 19:29:21 -06:00
parent cab5c2a1e0
commit 44277200a0
7 changed files with 35 additions and 0 deletions

View File

@ -25,6 +25,7 @@ BrushSettings.updateBrushOffset = BrushSettings("Update Brush Offset", False)
BrushSettings.chooseBlockImmediately = BrushSettings("Choose Block Immediately", False)
BrushSettings.alpha = BrushSettings("Alpha", 0.66)
class BrushMode(object):
options = []
@ -41,6 +42,7 @@ class BrushMode(object):
def createOptions(self, panel, tool):
pass
class Modes:
class Fill(BrushMode):
name = "Fill"
@ -344,6 +346,7 @@ class Modes:
return op.level.copyBlocksFromIter(level, level.bounds, point, create=True)
class BrushOperation(Operation):
def __init__(self, editor, points, options):
@ -515,6 +518,7 @@ class BrushOperation(Operation):
dirtyBox = self.brushMode.dirtyBoxForPointAndOptions(point, self.options)
return self.brushMode.performAtPoint(self, point, dirtyBox)
class BrushPanel(Panel):
def __init__(self, tool):
@ -607,6 +611,7 @@ class BrushPanel(Panel):
self.blockButton.blockInfo = self.replaceBlockButton.blockInfo
self.replaceBlockButton.blockInfo = b
class BrushToolOptions(ToolOptions):
def __init__(self, tool):
Panel.__init__(self)
@ -628,6 +633,7 @@ class BrushToolOptions(ToolOptions):
from clone import CloneTool
class BrushTool(CloneTool):
tooltipText = "Brush\nRight-click for options"
toolIconName = "brush"

View File

@ -16,6 +16,7 @@ from toolbasics import *
from pymclevel.infiniteworld import MCServerChunkGenerator
from albow.dialogs import Dialog
class ChunkToolPanel(Panel):
def __init__(self, tool, *a, **kw):
@ -320,6 +321,7 @@ class ChunkTool(EditorTool):
def mouseUp(self, evt, *args):
self.editor.selectionTool.mouseUp(evt, *args)
def GeneratorPanel():
panel = Widget()
panel.chunkHeight = 64

View File

@ -21,6 +21,7 @@ CloneSettings.copyAir = CloneSettings("Copy Air", True)
CloneSettings.copyWater = CloneSettings("Copy Water", True)
CloneSettings.placeImmediately = CloneSettings("Place Immediately", True)
class CoordsInput(Widget):
is_gl_container = True
@ -70,6 +71,7 @@ class CoordsInput(Widget):
#nudge is a 3-tuple where one of the elements is -1 or 1, and the others are 0.
pass
class BlockCopyOperation(Operation):
def __init__(self, editor, sourceLevel, sourceBox, destLevel, destPoint, copyAir, copyWater):
self.editor = editor
@ -193,6 +195,7 @@ class CloneOperation (Operation):
[i.undo() for i in self.selectionOps]
class CloneToolPanel(Panel):
useOffsetInput = True

View File

@ -14,6 +14,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE."""
from toolbasics import *
from albow.dialogs import wrapped_label
def alertFilterException(func):
def _func(*args, **kw):
try:
@ -24,6 +25,7 @@ def alertFilterException(func):
return _func
class FilterModuleOptions(Widget):
is_gl_container = True
def __init__(self, tool, module, *args, **kw):
@ -126,6 +128,7 @@ class FilterModuleOptions(Widget):
if k in self.optionDict:
self.optionDict[k].set(val[k])
class FilterToolPanel(Panel):
def __init__(self, tool):
Panel.__init__(self)
@ -194,6 +197,7 @@ class FilterToolPanel(Panel):
if self.filterOptionsPanel:
self.savedOptions[self.selectedFilterName] = self.filterOptionsPanel.options
class FilterOperation(Operation):
def __init__(self, level, box, filter, options):
self.box = box
@ -220,6 +224,7 @@ class FilterOperation(Operation):
def dirtyBox(self): return self.box
class FilterTool(EditorTool):
tooltipText = "Filter"
toolIconName = "filter"

View File

@ -16,6 +16,7 @@ from toolbasics import *
import urllib
from pymclevel.box import FloatBox
class PlayerMoveOperation(Operation):
undoPos = None
def __init__(self, tool, pos, player="Player", yp = (None, None)):
@ -58,17 +59,21 @@ class PlayerMoveOperation(Operation):
class SpawnPositionInvalid(Exception):
pass
def okayAt63(level, pos):
"""blocks 63 or 64 must be occupied"""
return level.blockAt(pos[0], 63, pos[2]) != 0 or level.blockAt(pos[0], 64, pos[2]) != 0
def okayAboveSpawn(level, pos):
"""3 blocks above spawn must be open"""
return not any( [level.blockAt(pos[0], pos[1]+i, pos[2]) for i in range(1, 4)] )
def positionValid(level, pos):
return okayAt63(level, pos) and okayAboveSpawn(level, pos)
class PlayerSpawnMoveOperation(PlayerMoveOperation):
def perform(self, recordUndo=True):
level = self.tool.editor.level
@ -123,6 +128,7 @@ class PlayerPositionPanel(Panel):
def selectedPlayer(self):
return self.players[self.table.index]
class PlayerPositionTool(EditorTool):
surfaceBuild = True
toolIconName = "player"
@ -373,6 +379,7 @@ class PlayerSpawnPositionOptions(ToolOptions):
SpawnSettings = config.Settings("Spawn")
SpawnSettings.spawnProtection = SpawnSettings("Spawn Protection", True)
class PlayerSpawnPositionTool(PlayerPositionTool):
surfaceBuild = True
toolIconName = "playerspawn"

View File

@ -21,6 +21,8 @@ SelectSettings.color = SelectSettings("Color", "teal")
ColorSettings = config.Settings("Selection Colors")
ColorSettings.defaultColors = {}
class ColorSetting(config.Setting):
def __init__(self, section, name, dtype, default):
super(ColorSetting, self).__init__(section, name, dtype, default)
@ -35,6 +37,7 @@ class ColorSetting(config.Setting):
return parseValues(colorValues)
ColorSettings.Setting = ColorSetting
def parseValues(colorValues):
if colorValues is None:
return 1., 1., 1.
@ -60,6 +63,7 @@ ColorSettings("yellow" ,(1.0, 1.0, 0.75))
ColorSettings("grey", (0.6, 0.6, 0.6))
ColorSettings("black", (0.0, 0.0, 0.0))
def GetSelectionColor(colorWord = None):
if colorWord is None:
colorWord = SelectSettings.color.get()
@ -67,6 +71,7 @@ def GetSelectionColor(colorWord = None):
colorValues = config.config.get("Selection Colors", colorWord)
return parseValues(colorValues)
class SelectionToolOptions(ToolOptions):
def updateColors(self):
@ -220,6 +225,7 @@ class NudgeBlocksOperation (Operation) :
self.editor.invalidateBox(self.dirtyBox())
self.nudgeSelection.undo()
class SelectionTool(EditorTool):
#selectionColor = (1.0, .9, .9);
color = (0.7, 0., 0.7)
@ -1057,6 +1063,7 @@ class SelectionTool(EditorTool):
if schematic:
self.editor.exportSchematic(schematic)
class SelectionOperation(Operation):
changedLevel = False
def __init__(self, selectionTool, points):

View File

@ -39,6 +39,7 @@ from albow.dialogs import Dialog
from pymclevel.mclevelbase import exhaust
from albow.root import Cancel
class NudgeButton(GLBackground):
""" A button that captures movement keys while pressed and sends them to a listener as nudge events.
Poorly planned. """
@ -124,6 +125,7 @@ class Operation(object):
"""
return None
class ToolOptions(Panel):
@property
def editor(self):
@ -194,6 +196,7 @@ class ThumbView(GLPerspective):
self.renderer.draw()
GL.glPopAttrib()
class BlockThumbView(Widget):
is_gl_container = True
@ -226,6 +229,7 @@ class BlockThumbView(Widget):
for i in self.thumb.renderer.chunkWorker:
pass
class BlockView(GLOrtho):
def __init__(self, materials, blockInfo=None):
GLOrtho.__init__(self)
@ -377,6 +381,7 @@ class BlockButton(ButtonBase, Panel):
if blockPicker.present():
self.blockInfo = blockPicker.blockInfo
def anySubtype(self):
bl = materials.Block(self.materials, self.ID, self.blockData)
bl.wildcard = True