summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Fink2017-12-26 11:52:01 +0100
committerDennis Fink2017-12-26 11:52:01 +0100
commitb082194b1adf038a89993144777a66b12d077dd9 (patch)
tree14151bb52c9f7e9d95f32c64b8d6bb51047265bf
parent326b0811612945ddea758d217db6de94c60b62a1 (diff)
downloadpatternutils-b082194b1adf038a89993144777a66b12d077dd9.tar.gz
patternutils-b082194b1adf038a89993144777a66b12d077dd9.zip
Use relative imports
-rw-r--r--patternutils/commands/pmatch.py4
-rw-r--r--patternutils/commands/targs.py4
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