renamed over.core.textui to over.core.text

This commit is contained in:
Overwatch 2014-12-10 18:18:48 +01:00
parent 2f778e7c79
commit 93e8c12547
6 changed files with 14 additions and 13 deletions

2
aux.py
View file

@ -5,4 +5,4 @@ import sys
from . import core from . import core
_print = core.textui.Output('over', stream=sys.stderr) _print = core.text.Output('over', stream=sys.stderr)

View file

@ -6,10 +6,11 @@ from . import aux
from . import cmd from . import cmd
from . import file from . import file
from . import misc from . import misc
from . import textui from . import text
textui = text
try: try:
from . import cython_types as types from . import cython_types as types
except: 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 from . import python_types as types

View file

@ -5,10 +5,10 @@ import sys
import re import re
from . import file from . import file
from . import textui from . import text
from ..version import _version from ..version import _version
prefix = textui.prefix prefix = text.prefix
# FIXME This very seriously needs to be heavily simplified and de-duplicated # FIXME This very seriously needs to be heavily simplified and de-duplicated
# TODO same parser for cmdline and Config # TODO same parser for cmdline and Config
@ -55,8 +55,8 @@ _over_help_texts = [
# -------------------------------------------------- # --------------------------------------------------
def _output(text, indent=0, newlines=1): def _output(raw, indent=0, newlines=1):
sys.stdout.write(textui.render(textui.paragraph(text, indent=indent), True)) sys.stdout.write(text.render(text.paragraph(raw, indent=indent), True))
sys.stdout.write(newlines * '\n') sys.stdout.write(newlines * '\n')
sys.stdout.flush() sys.stdout.flush()
@ -229,7 +229,7 @@ class Main:
self.cmdline = cmdline self.cmdline = cmdline
self.help_texts = [] # (chapter, [paragraphs]) self.help_texts = [] # (chapter, [paragraphs])
self.allow_exit = allow_exit self.allow_exit = allow_exit
self._print = textui.Output('over.core.app.Main') self._print = text.Output('over.core.app.Main')
if cfg_file: if cfg_file:
self.cfg_file = file.File(cfg_file, encoding='utf-8') self.cfg_file = file.File(cfg_file, encoding='utf-8')
@ -575,7 +575,7 @@ class Main:
else: else:
self._print('updating config file with option §B--§y%s§/' %(opt.name)) self._print('updating config file with option §B--§y%s§/' %(opt.name))
new_lines.append('') 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)) new_lines.append('# *** data type: %s' %(opt.dtype))
if opt.plural: if opt.plural:

View file

@ -3,6 +3,6 @@
import sys import sys
from . import textui from . import text
_print = textui.Output('over.core', stream=sys.stderr) _print = text.Output('over.core', stream=sys.stderr)

View file

@ -4,7 +4,7 @@
import os import os
from .aux import _print from .aux import _print
from .textui import prefix from .text import prefix
# -------------------------------------------------- # --------------------------------------------------

View file

@ -154,7 +154,7 @@ class Unit:
return output return output
def __repr__(self): def __repr__(self):
return 'over.core.textui.Unit(%s)' %(self) return 'over.core.text.Unit(%s)' %(self)
# -------------------------------------------------- # --------------------------------------------------