Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

String Clarity and Using f-strings.

Aathish6f94fc526e2e
diff --git a/manim/__main__.py b/manim/__main__.py
index bfd93bfd3..de2df2fcc 100644
--- a/manim/__main__.py
+++ b/manim/__main__.py
@@ -72,10 +72,10 @@ def prompt_user_for_choice(scene_classes):
for count, scene_class in enumerate(scene_classes):
count += 1 # start with 1 instead of 0
name = scene_class.__name__
- console.print("%d: %s" % (count, name),style="logging.level.info")
+ console.print(f"{count}: {name}" ,style="logging.level.info")
num_to_class[count] = scene_class
try:
- user_input = console.input("[log.message]"+constants.CHOOSE_NUMBER_MESSAGE+"[/log.message]")
+ user_input = console.input(f"[log.message] {constants.CHOOSE_NUMBER_MESSAGE} [/log.message]")
return [num_to_class[int(num_str)]
for num_str in re.split(r"\s*,\s*", user_input.strip())]
except KeyError:
diff --git a/manim/logger.py b/manim/logger.py
index 0191e99e2..4ac8b8d8a 100644
--- a/manim/logger.py
+++ b/manim/logger.py
@@ -31,7 +31,7 @@ def parse_theme(fp):
except (color.ColorParseError, errors.StyleSyntaxError):
customTheme = None
printf(
- "[logging.level.error]Looks like your colour configuration has an error. So loading default color configuration[/logging.level.error]"
+ "[logging.level.error]It seems your colour configuration couldn't be parsed. Loading the default color configuration...[/logging.level.error]"
)
return customTheme
diff --git a/manim/utils/cfgwriter.py b/manim/utils/cfgwriter.py
index 98bc2b87c..92e63f89d 100644
--- a/manim/utils/cfgwriter.py
+++ b/manim/utils/cfgwriter.py
@@ -44,7 +44,7 @@ def main():
"[yellow bold]Manim Configuration File Writer[/yellow bold]", justify="center"
)
console.print(
- "[red]The default colour is shown as input Statement.\nIf left empty default value will be assigned.[/red]"
+ "[red]The default colour is used by the input statement.\nIf left empty, the default colour will be used.[/red]"
)
console.print(
"[magenta] For a full list of styles, visit[/magenta] https://rich.readthedocs.io/en/latest/style.html"
@@ -73,7 +73,7 @@ def main():
default[key] = temp
config["logger"] = default
console.print(
- "Do you want it as a default for the User?(y/n)[[n]]",
+ "Do you want to save this as the default for this User?(y/n)[[n]]",
style="dim purple",
end="",
)
@@ -85,22 +85,15 @@ def main():
with open(config_paths[1], "w") as fp:
config.write(fp)
console.print(
- """A configuration file called [yellow]{}[/yellow] has been created with your required changes.
-which would be used while running manim command. If you want to overide that
-you would have to create a manim.cfg in local directory.""".format(
- config_paths[1]
- )
+ f"""A configuration file called [yellow]{config_paths[1]}[/yellow] has been created with your required changes.
+This will be used when running the manim command. If you want to override this config,
+you will have to create a manim.cfg in the local directory, where you want those changes to be overridden."""
)
else:
with open(config_paths[2], "w") as fp:
config.write(fp)
- console.print(
- """A configuration file called [yellow]{}[/yellow] has been created.
-To save your theme please save that file and each time place it in your current working directory,
-(the directory where you executed the command manim)""".format(
- config_paths[2]
- )
- )
+ console.print(f"""A configuration file called [yellow]{config_paths[2]}[/yellow] has been created.
+To save your theme please save that file and place it in your current working directory, from where you run the manim command.""")
if __name__ == "__main__":