Skip to content

Commit 3670695

Browse files
committed
🔨 f-strings conversion. #303
1 parent 293b340 commit 3670695

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

moban/core/moban_factory.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def render_string_to_file(
142142
self, template_in_string, data_file, output_file
143143
):
144144
template = self.engine.get_template_from_string(template_in_string)
145-
template_abs_path = template_in_string[:10] + "..."
145+
template_abs_path = f"{template_in_string[:10]}..."
146146
data = self.context.get_data(data_file)
147147
flag = self.apply_template(
148148
template_abs_path, template, data, output_file
@@ -230,7 +230,7 @@ def _render_with_finding_data_first(self, data_file_index):
230230

231231

232232
def expand_template_directories(dirs):
233-
LOG.debug("Expanding %s..." % dirs)
233+
LOG.debug(f"Expanding {dirs}...")
234234
if not isinstance(dirs, list):
235235
dirs = [dirs]
236236

moban/core/mobanfile/targets.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def extract_target(options):
2020
if template:
2121
if output is None:
2222
raise Exception(
23-
"Please specify a output file name for %s." % template
23+
f"Please specify a output file name for {template}"
2424
)
2525
if config:
2626
result = {
@@ -43,7 +43,7 @@ def extract_group_targets(group, targets):
4343
if isinstance(group_targets, str) is False and group_name == group:
4444
# grouping by template type feature
4545
return [{group_name: group_targets}]
46-
raise exceptions.GroupTargetNotFound("%s is not found" % group)
46+
raise exceptions.GroupTargetNotFound(f"{group} is not found")
4747

4848

4949
def parse_targets(options, targets):

0 commit comments

Comments
 (0)