Skip to content

Commit

Permalink
optimized imports
Browse files Browse the repository at this point in the history
  • Loading branch information
knowsuchagency committed Jun 28, 2017
1 parent 83ae713 commit aa1d64e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ninjadog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
__email__ = 'knowsuchagency@gmail.com'
__version__ = '0.3.7'

from ninjadog.ninjadog import render
from ninjadog.ext.pyramid import includeme
from ninjadog.ninjadog import render
6 changes: 4 additions & 2 deletions ninjadog/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@
<h1>hello Sam</h1>
"""
from docopt import docopt
import sys
import typing as T

from docopt import docopt

from ninjadog import render


def main(argv=None):
def main(argv: T.Optional[T.Iterable] = None):
"""Render pug template to stdout."""
args = docopt(__doc__, argv=argv, version='0.3.7')

Expand Down
1 change: 0 additions & 1 deletion ninjadog/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import re
import subprocess as sp
import typing as T
from pathlib import Path


Expand Down
2 changes: 1 addition & 1 deletion ninjadog/ext/pyramid.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ENV_CONFIG_PHASE,
)

from ninjadog import render
from ninjadog.ninjadog import render


class PugTemplateRenderer(Jinja2TemplateRenderer):
Expand Down
6 changes: 3 additions & 3 deletions ninjadog/ninjadog.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# -*- coding: utf-8 -*-

"""Main module."""
import shlex
import json
import shlex
import subprocess as sp
import typing as T
from pathlib import Path

from jinja2 import Template

from ninjadog.constants import PUG_CLI_PATH
from ninjadog.utils import jsonify

from jinja2 import Template


def render(string: str = '',
file: T.Union[Path, str] = None,
Expand Down
3 changes: 0 additions & 3 deletions ninjadog/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import typing as T
from functools import partial
from json import dumps
from pathlib import Path

from .constants import EXTENSION_PATT

jsonify = partial(dumps, skipkeys=True, default=lambda _: '', ensure_ascii=False)

0 comments on commit aa1d64e

Please sign in to comment.