diff --git a/bin/cheat b/bin/cheat index a41647b..80cd5f3 100755 --- a/bin/cheat +++ b/bin/cheat @@ -38,7 +38,6 @@ Examples: from __future__ import print_function from cheat.colorize import Colorize from cheat.configuration import Configuration -from cheat.editor import Editor from cheat.sheet import Sheet from cheat.sheets import Sheets from docopt import docopt @@ -53,12 +52,10 @@ if __name__ == '__main__': config.validate() # bootsrap - editor = Editor(config) + sheets = Sheets(config) + sheet = Sheet(config, sheets) colorize = Colorize(config) - sheets = Sheets(config, colorize) - sheet = Sheet(sheets, editor) - # list directories if options['--directories']: print("\n".join(sheets.paths())) diff --git a/cheat/sheet.py b/cheat/sheet.py index 94c7630..e06ace0 100644 --- a/cheat/sheet.py +++ b/cheat/sheet.py @@ -1,3 +1,4 @@ +from cheat.editor import Editor from cheat.utils import Utils import io import os @@ -6,9 +7,9 @@ import shutil class Sheet: - def __init__(self, sheets, editor): + def __init__(self, config, sheets): self._sheets = sheets - self._editor = editor + self._editor = Editor(config) def copy(self, current_sheet_path, new_sheet_path): """ Copies a sheet to a new path """ diff --git a/cheat/sheets.py b/cheat/sheets.py index 2141c1a..2816d4b 100644 --- a/cheat/sheets.py +++ b/cheat/sheets.py @@ -1,14 +1,14 @@ +from cheat.colorize import Colorize +from cheat.utils import Utils import io import os -from cheat.utils import Utils - class Sheets: - def __init__(self, config, colorize): + def __init__(self, config): self._config = config - self._colorize = colorize; + self._colorize = Colorize(config); def default_path(self): """ Returns the default cheatsheet path """