mirror of
https://github.com/cheat/cheat.git
synced 2024-10-31 21:21:02 +01:00
Refactored (6)
Standardized (mostly) how the various classes are initialized.
This commit is contained in:
parent
145a81dcd6
commit
d61e4e7c34
@ -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()))
|
||||
|
@ -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 """
|
||||
|
@ -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 """
|
||||
|
Loading…
Reference in New Issue
Block a user