Skip to content

Commit c7193a8

Browse files
committed
💄 update coding style
1 parent 6308107 commit c7193a8

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@
5959
# Add any paths that contain custom static files (such as style sheets) here,
6060
# relative to this directory. They are copied after the builtin static files,
6161
# so a file named "default.css" will overwrite the builtin "default.css".
62-
html_static_path = ['static']
62+
html_static_path = ['static']

moban_handlebars/engine.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Dict
2+
13
from pybars import Compiler
24
from moban.externals import file_system
35

@@ -6,28 +8,28 @@ class EngineHandlebars(object):
68
ACTION_IN_PRESENT_CONTINUOUS_TENSE = "Handlebars-ing"
79
ACTION_IN_PAST_TENSE = "Handlebarsed"
810

9-
def __init__(self, template_fs, options=None):
11+
def __init__(self, template_fs, options: Dict = None):
1012
"""
1113
template_fs is a multfs instance and gives you the power to load
1214
a template from equiped template directories.
1315
14-
:param fs.multifs.MultiFS template_fs: a MultiFS instance or a FS instance
16+
:param fs.multifs.MultiFS template_fs: a MultiFS/FS instance
1517
:param options: a dictionary of potential parameters.
1618
not used yet.
1719
"""
1820
self.template_fs = template_fs
1921

20-
def get_template(self, template_file):
22+
def get_template(self, template_file: str):
2123
template_file = file_system.to_unicode(template_file)
2224
content = self.template_fs.readtext(template_file)
2325
hbr_template = Compiler().compile(content)
2426
return hbr_template
2527

26-
def get_template_from_string(self, string):
28+
def get_template_from_string(self, string: str):
2729
string = file_system.to_unicode(string)
2830
return Compiler().compile(string)
2931

30-
def apply_template(self, template, data, _):
32+
def apply_template(self, template, data: Dict, _):
3133
rendered_content = "".join(template(data))
3234
rendered_content = rendered_content
3335
return rendered_content

0 commit comments

Comments
 (0)