diff --git a/aux.py b/aux.py index dc9ed87..3edd3e8 100644 --- a/aux.py +++ b/aux.py @@ -5,4 +5,4 @@ import sys from . import core -_print = core.textui.Output('over', stream=sys.stderr) +_print = core.text.Output('over', stream=sys.stderr) diff --git a/core/__init__.py b/core/__init__.py index 1b97b3f..13db0b4 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -6,10 +6,11 @@ from . import aux from . import cmd from . import file from . import misc -from . import textui +from . import text +textui = text try: from . import cython_types as types except: - aux._print('unable to load C implementation, using python instead', textui.prefix.warn) + aux._print('unable to load C implementation, using python instead', text.prefix.warn) from . import python_types as types diff --git a/core/app.py b/core/app.py index 0ac8f2f..051961f 100644 --- a/core/app.py +++ b/core/app.py @@ -5,10 +5,10 @@ import sys import re from . import file -from . import textui +from . import text from ..version import _version -prefix = textui.prefix +prefix = text.prefix # FIXME This very seriously needs to be heavily simplified and de-duplicated # TODO same parser for cmdline and Config @@ -55,8 +55,8 @@ _over_help_texts = [ # -------------------------------------------------- -def _output(text, indent=0, newlines=1): - sys.stdout.write(textui.render(textui.paragraph(text, indent=indent), True)) +def _output(raw, indent=0, newlines=1): + sys.stdout.write(text.render(text.paragraph(raw, indent=indent), True)) sys.stdout.write(newlines * '\n') sys.stdout.flush() @@ -229,7 +229,7 @@ class Main: self.cmdline = cmdline self.help_texts = [] # (chapter, [paragraphs]) self.allow_exit = allow_exit - self._print = textui.Output('over.core.app.Main') + self._print = text.Output('over.core.app.Main') if cfg_file: self.cfg_file = file.File(cfg_file, encoding='utf-8') @@ -575,7 +575,7 @@ class Main: else: self._print('updating config file with option §B--§y%s§/' %(opt.name)) new_lines.append('') - new_lines.append(textui.paragraph(textui.render(opt.description, colors=False), prefix='#', width=80)) + new_lines.append(text.paragraph(text.render(opt.description, colors=False), prefix='#', width=80)) new_lines.append('# *** data type: %s' %(opt.dtype)) if opt.plural: diff --git a/core/aux.py b/core/aux.py index c52cf02..53d020a 100644 --- a/core/aux.py +++ b/core/aux.py @@ -3,6 +3,6 @@ import sys -from . import textui +from . import text -_print = textui.Output('over.core', stream=sys.stderr) +_print = text.Output('over.core', stream=sys.stderr) diff --git a/core/file.py b/core/file.py index e2ed1f5..0709140 100644 --- a/core/file.py +++ b/core/file.py @@ -4,7 +4,7 @@ import os from .aux import _print -from .textui import prefix +from .text import prefix # -------------------------------------------------- diff --git a/core/textui.py b/core/text.py similarity index 99% rename from core/textui.py rename to core/text.py index 8b19ec3..c543010 100644 --- a/core/textui.py +++ b/core/text.py @@ -154,7 +154,7 @@ class Unit: return output def __repr__(self): - return 'over.core.textui.Unit(%s)' %(self) + return 'over.core.text.Unit(%s)' %(self) # --------------------------------------------------