txtv

Swiss text tv in the terminal
git clone https://git.in0rdr.ch/txtv.git
Log | Files | Refs | Pull requests |Archive | README | LICENSE

commit 71534d21695c161e560c1c51660530186c2293ac
parent 30a0c1197594c05629d9c629620b04611f74665b
Author: Isak Lindhé <isak.e.lindhe@gmail.com>
Date:   Wed, 20 Mar 2019 11:49:20 +0100

fixed imports

Diffstat:
Mtxtv/listing.py | 2+-
Mtxtv/test.py | 4++--
Mtxtv/txtv.py | 10+++++-----
3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/txtv/listing.py b/txtv/listing.py @@ -1,6 +1,6 @@ import bs4 import re -from txtv import Page +from txtv.txtv import Page from pprint import pprint diff --git a/txtv/test.py b/txtv/test.py @@ -2,7 +2,7 @@ from pytest import fixture def test_help(capsys): - from txtv import cmd_help, commands + from txtv.txtv import cmd_help, commands cmd_help() cap = capsys.readouterr() assert len(cap.out.splitlines()) == 1 + len([c for c in commands if 'help' in c]) # header + commands @@ -11,7 +11,7 @@ def test_help(capsys): def test_list(capsys): import re - from txtv import cmd_list, Page + from txtv.txtv import cmd_list, Page from colorama import Fore cmd_list() cap = capsys.readouterr() diff --git a/txtv/txtv.py b/txtv/txtv.py @@ -7,9 +7,9 @@ import re import colorama import readline from colorama import Fore, Back, Style -from util import err from pathlib import Path -from config import get_or_gen_config, apply_aliases +from txtv.util import err +from txtv.config import get_or_gen_config, apply_aliases class Page: @@ -105,7 +105,7 @@ def cmd_help(**kwargs): name = cmd['helpname'] else: name = cmd['pattern'] - name = re.sub('\|', ' | ', name) + name = re.sub(r'\|', r' | ', name) print('{} -- {}'.format(name, cmd['help'])) @@ -120,7 +120,7 @@ def cmd_prev(state, **kwargs): def cmd_list(**kwargs): - from listing import list_all_articles + from txtv.listing import list_all_articles articles = list_all_articles() for art in articles: if art: @@ -144,7 +144,7 @@ def cmd_page(match, state=None, **kwargs): commands = [ { 'helpname': 'help | h | ?', - 'pattern': 'h|\?|help', + 'pattern': r'h|\?|help', 'func': cmd_help, 'help': 'show this help text.', },