Skip to content

Commit

Permalink
🔨 f-strings conversion. #303
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed Jan 17, 2020
1 parent 293b340 commit 3670695
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions moban/core/moban_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def render_string_to_file(
self, template_in_string, data_file, output_file
):
template = self.engine.get_template_from_string(template_in_string)
template_abs_path = template_in_string[:10] + "..."
template_abs_path = f"{template_in_string[:10]}..."
data = self.context.get_data(data_file)
flag = self.apply_template(
template_abs_path, template, data, output_file
Expand Down Expand Up @@ -230,7 +230,7 @@ def _render_with_finding_data_first(self, data_file_index):


def expand_template_directories(dirs):
LOG.debug("Expanding %s..." % dirs)
LOG.debug(f"Expanding {dirs}...")
if not isinstance(dirs, list):
dirs = [dirs]

Expand Down
4 changes: 2 additions & 2 deletions moban/core/mobanfile/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def extract_target(options):
if template:
if output is None:
raise Exception(
"Please specify a output file name for %s." % template
f"Please specify a output file name for {template}"
)
if config:
result = {
Expand All @@ -43,7 +43,7 @@ def extract_group_targets(group, targets):
if isinstance(group_targets, str) is False and group_name == group:
# grouping by template type feature
return [{group_name: group_targets}]
raise exceptions.GroupTargetNotFound("%s is not found" % group)
raise exceptions.GroupTargetNotFound(f"{group} is not found")


def parse_targets(options, targets):
Expand Down

0 comments on commit 3670695

Please sign in to comment.