From 81b144a2a330d44c03b8e22f25049b9396fdd9ad Mon Sep 17 00:00:00 2001 From: Metallicow Date: Wed, 12 Oct 2016 22:29:53 -0500 Subject: [PATCH] Trim Whitespace analogclock directory --- wx/lib/analogclock/__init__.py | 6 +++--- wx/lib/analogclock/analogclock.py | 14 ++++++------- wx/lib/analogclock/helpers.py | 24 +++++++++++----------- wx/lib/analogclock/lib_setup/fontselect.py | 4 ++-- wx/lib/analogclock/setup.py | 6 +++--- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/wx/lib/analogclock/__init__.py b/wx/lib/analogclock/__init__.py index 4ba4480f..49e88fae 100644 --- a/wx/lib/analogclock/__init__.py +++ b/wx/lib/analogclock/__init__.py @@ -7,7 +7,7 @@ AnalogClock - an analog clock. This control creates an analog clock window. Its features include shadowing, the ability to render numbers as well as any arbitrary polygon as tick marks, resize marks and hands proportionally as the widget itself is resized, rotate -marks in a way the get aligned to the watch. It also has a dialog, accessed +marks in a way the get aligned to the watch. It also has a dialog, accessed via a context menu item, allowing one to change on the fly all of its settings. @@ -113,7 +113,7 @@ the wxPython-users list. AnalogClock is distributed under the wxWidgets license. -This code should meet the wxPython Coding Guidelines +This code should meet the wxPython Coding Guidelines and the wxPython Style Guide . @@ -127,7 +127,7 @@ For updates please visit . # # Version 0.02: # - Module/namespace rearranges; -# - All '-1' occurrences meaning "use any id" were eliminated or replaced +# - All '-1' occurrences meaning "use any id" were eliminated or replaced # to 'wx.ID_ANY'. # - Better names to the methods triggered by the context menu events. # - Included small demo class code in analogclock.py. diff --git a/wx/lib/analogclock/analogclock.py b/wx/lib/analogclock/analogclock.py index 65a8816a..fd38f0a6 100644 --- a/wx/lib/analogclock/analogclock.py +++ b/wx/lib/analogclock/analogclock.py @@ -98,7 +98,7 @@ class AnalogClock(wx.Window): # Do initial drawing (in case there is not an initial size event) self.RecalcCoords(self.GetSize()) self.DrawBox() - + # Initialize the timer that drives the update of the clock face. # Update every half second to ensure that there is at least one true # update during each realtime second. @@ -112,7 +112,7 @@ class AnalogClock(wx.Window): size = wx.Size(50,50) self.CacheBestSize(size) return size - + def _OnSize(self, evt): size = self.GetClientSize() @@ -131,7 +131,7 @@ class AnalogClock(wx.Window): def _OnTimer(self, evt): self.Refresh(False) self.Update() - + def _OnDestroyWindow(self, evt): self.timer.Stop() @@ -336,7 +336,7 @@ class AnalogClock(wx.Window): self.RecalcCoords(size) self.DrawBox() self.Refresh(False) - + def SetHandSize(self, size, target=ALL): """Sets thickness of hands.""" @@ -590,10 +590,10 @@ class AnalogClockWindow(AnalogClock): def SetMinutesOffset(self, o): pass - + def SetShadowColour(self, s): pass - + def SetWatchPenBrush(self, p=None, b=None): if p: self.SetFaceBorderColour(p.GetColour()) @@ -611,7 +611,7 @@ class AnalogClockWindow(AnalogClock): if m: self.SetTickStyle(h, MINUTE) - + # Test stuff ---------------------------------------------------------- if __name__ == "__main__": diff --git a/wx/lib/analogclock/helpers.py b/wx/lib/analogclock/helpers.py index 951094ec..88d198be 100644 --- a/wx/lib/analogclock/helpers.py +++ b/wx/lib/analogclock/helpers.py @@ -61,8 +61,8 @@ class Element: def RecalcCoords(self, clocksize, centre, scale): pass - - + + def GetSize(self): return self.size @@ -77,8 +77,8 @@ class Element: def GetMaxSize(self, scale=1): return self.size * scale - - + + def GetScale(self): return self.scale @@ -147,7 +147,7 @@ class ElementWithDyer(Element): def GetShadowColour(self): return self.dyer.GetShadowColour() - + def SetFillColour(self, colour): self.dyer.SetFillColour(colour) @@ -158,8 +158,8 @@ class ElementWithDyer(Element): def SetBorderWidth(self, width): self.dyer.SetBorderWidth(width) - - + + def SetShadowColour(self, colour): self.dyer.SetShadowColour(colour) @@ -263,7 +263,7 @@ class TickPoly(Element): width = max([x for x, y in polygon]) height = max([y for x, y in polygon]) - + return polygon, width, height @@ -381,7 +381,7 @@ class TickNone(Element): def Draw(self, dc, offset=0): pass - + #---------------------------------------------------------------------- class Dyer: @@ -484,7 +484,7 @@ class HandSet: # else prevent exceptions on leap seconds elif idx <= 0 or idx > 60: idx = 59 - # and adjust idx offset for minutes and non-leap seconds + # and adjust idx offset for minutes and non-leap seconds else: idx = idx - 1 angle = math.radians(180 - 6 * (idx + 1)) @@ -594,7 +594,7 @@ class TickSet: def _draw(self, dc, shadow=False): dc.SetFont(self.font) - + a_tick = self.ticks[0] if shadow: @@ -670,7 +670,7 @@ class TickSet: a_tick.GetOffset() * scale - \ self.parent.shadowOffset * scale - # If we are a set of hours, the number of elements of this tickset is + # If we are a set of hours, the number of elements of this tickset is # 12 and ticks are separated by a distance of 30 degrees; # if we are a set of minutes, the number of elements of this tickset is # 60 and ticks are separated by a distance of 6 degrees. diff --git a/wx/lib/analogclock/lib_setup/fontselect.py b/wx/lib/analogclock/lib_setup/fontselect.py index 1d36ef1a..8d7e873a 100644 --- a/wx/lib/analogclock/lib_setup/fontselect.py +++ b/wx/lib/analogclock/lib_setup/fontselect.py @@ -17,13 +17,13 @@ from wx.lib.buttons import GenButton class FontSelect(GenButton): def __init__(self, parent, size=(75, 21), value=None): - GenButton.__init__(self, parent, wx.ID_ANY, label="Select...", + GenButton.__init__(self, parent, wx.ID_ANY, label="Select...", size=size) self.SetBezelWidth(1) self.parent = parent self.SetValue(value) - + self.parent.Bind(wx.EVT_BUTTON, self.OnClick, self) diff --git a/wx/lib/analogclock/setup.py b/wx/lib/analogclock/setup.py index da3775ab..a83c8639 100644 --- a/wx/lib/analogclock/setup.py +++ b/wx/lib/analogclock/setup.py @@ -109,7 +109,7 @@ class _GroupBase(wx.Panel): def OnChoice(self, evt): self.clock.SetWindowStyle(eval(evt.GetString())) - + def UpdateControls(self): if hasattr(self, "ft"): self.ft.SetValue(self.clock.GetTickFont(self.target)[0]) @@ -236,7 +236,7 @@ class _Group_3(_Group_1): sizer.Detach(widget) widget.Destroy() sizer.Layout() - + p = wx.StaticText(self, label="Shadow:") sizer.Add(p, pos=(2, 0), flag=wx.ALIGN_CENTRE_VERTICAL) @@ -428,7 +428,7 @@ class Setup(wx.Dialog): self.SetSizerAndFit(sizer) wx.CallAfter(self.UpdateControls) - + def OnClose(self, evt): self.Hide()