Skip to content
This repository has been archived by the owner on May 31, 2019. It is now read-only.

Commit

Permalink
Fix flake8 and mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bata committed Sep 13, 2016
1 parent c9b1d2a commit e218627
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions kobin/environs.py
Expand Up @@ -4,7 +4,7 @@
from typing import Dict, List, Tuple, Any
import http.client as http_client
from urllib.parse import SplitResult
from http.cookies import SimpleCookie
from http.cookies import SimpleCookie # type: ignore
from wsgiref.headers import Headers # type: ignore


Expand Down Expand Up @@ -210,12 +210,12 @@ def set_cookie(self, key: str, value: Any, expires: str=None, path: str=None, **
for k, v in options.items():
if k == 'max_age':
if isinstance(v, timedelta):
v = v.seconds + v.days * 24 * 3600
v = v.seconds + v.days * 24 * 3600 # type: ignore
if k == 'expires':
if isinstance(v, (date, datetime)):
v = v.timetuple()
v = v.timetuple() # type: ignore
elif isinstance(v, (int, float)):
v = v.gmtime(value)
v = v.gmtime(value) # type: ignore
v = time.strftime("%a, %d %b %Y %H:%M:%S GMT", v) # type: ignore
self._cookies[key][k.replace('_', '-')] = v # type: ignore

Expand Down
4 changes: 2 additions & 2 deletions kobin/templates.py
Expand Up @@ -3,6 +3,6 @@

def render_template(template_name: str, **kwargs) -> str:
""" Get a rendered template as string iterator. """
from . import current_config
env = Environment(loader=FileSystemLoader(current_config()['TEMPLATE_DIRS']))
from . import current_config # type: ignore
env = Environment(loader=FileSystemLoader(current_config()['TEMPLATE_DIRS'])) # type: ignore
return env.get_template(template_name).render(**kwargs)
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -3,7 +3,7 @@ release = register sdist bdist_wheel upload

[flake8]
max-line-length = 120
exclude = venv/*.py,build/*.py,*/__init__.py
exclude = venv/*.py,build/*.py,*/__init__.py,doc/*.py
ignore = F401

[pytest]
Expand Down

0 comments on commit e218627

Please sign in to comment.