mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Some create_benchmark.py script enhancements (v3).
This patch is held at linterpoint. Here's the ransom.
This commit is contained in:
@@ -47,19 +47,18 @@ def create_benchmark_file(name):
|
|||||||
and places it in the `single-source` directory.
|
and places it in the `single-source` directory.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
template_path = create_relative_path("Template.swift")
|
|
||||||
file_text = ""
|
file_text = ""
|
||||||
|
template_path = create_relative_path("Template.swift")
|
||||||
with open(template_path, "r") as f:
|
with open(template_path, "r") as f:
|
||||||
file_text = "".join(f.readlines())
|
file_text = "".join(f.readlines())
|
||||||
|
|
||||||
# fill in missing template details
|
# fill in missing template details
|
||||||
file_text = file_text.format(
|
file_text = file_text.format(
|
||||||
name = name,
|
name=name,
|
||||||
padding = "-" * (56 - len(name)),
|
padding="-" * (56 - len(name)),
|
||||||
year = datetime.date.today().year
|
year=datetime.date.today().year
|
||||||
)
|
)
|
||||||
|
|
||||||
file_path_prefix = create_relative_path("../single-source/")
|
file_path_prefix = create_relative_path("../single-source/")
|
||||||
file_path = os.path.join(file_path_prefix, name + ".swift")
|
file_path = os.path.join(file_path_prefix, name + ".swift")
|
||||||
with open(file_path, "w") as f:
|
with open(file_path, "w") as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user