Skip to content

Commit

Permalink
Refactored the refactoring.
Browse files Browse the repository at this point in the history
Meta-refactoring!
  • Loading branch information
shlomif committed Nov 16, 2016
1 parent 0bbf791 commit 1085096
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 29 deletions.
16 changes: 3 additions & 13 deletions pysollib/tile/colorsdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,12 @@

__all__ = ['ColorsDialog']

# imports
import ttk

from pysollib.ui.tktile.colorsdialog import BaseColorsDialog
from pysollib.tile.basetilemfxdialog import BaseTileMfxDialog

# ************************************************************************
# *
# ************************************************************************

class ColorsDialog(BaseColorsDialog):
def _calcFrame(self):
return ttk.Frame

def _calcLabel(self):
return ttk.Label

def _calcButton(self):
return ttk.Button

class ColorsDialog(BaseColorsDialog, BaseTileMfxDialog):
pass
16 changes: 3 additions & 13 deletions pysollib/tk/colorsdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,12 @@

__all__ = ['ColorsDialog']

# imports
import Tkinter

from pysollib.ui.tktile.colorsdialog import BaseColorsDialog
from pysollib.tk.basetkmfxdialog import BaseTkMfxDialog

# ************************************************************************
# *
# ************************************************************************

class ColorsDialog(BaseColorsDialog):
def _calcFrame(self):
return Tkinter.Frame

def _calcLabel(self):
return Tkinter.Label

def _calcButton(self):
return Tkinter.Button

class ColorsDialog(BaseColorsDialog, BaseTkMfxDialog):
pass
15 changes: 12 additions & 3 deletions pysollib/ui/tktile/colorsdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,19 @@
# *
# ************************************************************************

class BaseColorsDialog(MfxDialog):
class BaseColorsDialog:
def _calcFrame(self):
return self._calcToolkit().Frame

def _calcLabel(self):
return self._calcToolkit().Label

def _calcButton(self):
return self._calcToolkit().Button

def __init__(self, parent, title, app, **kw):
kw = self.initKw(kw)
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
self._calc_MfxDialog().__init__(self, parent, title, kw.resizable, kw.default)
top_frame, bottom_frame = self.createFrames(kw)
self.createBitmaps(top_frame, kw)

Expand Down Expand Up @@ -116,7 +125,7 @@ def initKw(self, kw):
strings=(_("&OK"), _("&Cancel")),
default=0,
)
return MfxDialog.initKw(self, kw)
return self._calc_MfxDialog().initKw(self, kw)



Expand Down

0 comments on commit 1085096

Please sign in to comment.