From b082194b1adf038a89993144777a66b12d077dd9 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Tue, 26 Dec 2017 11:52:01 +0100 Subject: Use relative imports --- patternutils/commands/pmatch.py | 4 ++-- patternutils/commands/targs.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/patternutils/commands/pmatch.py b/patternutils/commands/pmatch.py index 21f5557..da32f9c 100644 --- a/patternutils/commands/pmatch.py +++ b/patternutils/commands/pmatch.py @@ -9,7 +9,7 @@ from typing import Generator, List, Iterator, Pattern, Any, Tuple, Dict, Match import click -import patternutils +from .. import match as mat def walk(dir: str, recursive: bool=False, match_directories: bool=False) -> Generator[os.DirEntry, None, None]: @@ -33,7 +33,7 @@ def apply_regex( for f in walk_function: subject = f.path if match_full_path else f.name try: - match = patternutils.match.apply(subject, regex_pattern) + match = mat.apply(subject, regex_pattern) except ValueError: click.secho('{} did not match'.format(subject), fg='red', err=True) has_invalid_matches = True diff --git a/patternutils/commands/targs.py b/patternutils/commands/targs.py index ad7e047..14ecce7 100644 --- a/patternutils/commands/targs.py +++ b/patternutils/commands/targs.py @@ -14,7 +14,7 @@ from typing import ( import click -import patternutils +from .. import template def run_command( @@ -66,7 +66,7 @@ def targs( use_jinja = True if template_engine == 'jinja2' else False try: - render = patternutils.template.get_render_function(command, use_jinja=use_jinja) + render = template.get_render_function(command, use_jinja=use_jinja) except RuntimeError: click.secho('jinja2 not installed!', fg='red', err=True) raise SystemExit -- cgit v1.3.1