Skip to content

Rich Command line output colour customization #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fa179ae
Found a way for output changing
naveen521kk Jun 10, 2020
64b27ab
Completed CLI for input colours 😊
naveen521kk Jun 10, 2020
e5ab144
Remove unecessary files
naveen521kk Jun 11, 2020
51b4079
Some updates on making it comaptible with manim.cfg ✌️
naveen521kk Jun 11, 2020
8502b01
Some updates on error handling ⚠️
naveen521kk Jun 14, 2020
9be7456
Merge branch 'master' of https://github.com/ManimCommunity/manim into…
naveen521kk Jul 6, 2020
1369b59
Add support for manim-logsetup config
naveen521kk Jul 7, 2020
e69a433
Move from submodule to logger.py
naveen521kk Jul 8, 2020
bbf9383
Split config.py into config_utils.py
naveen521kk Jul 8, 2020
dd890aa
Some slight formatting changes
naveen521kk Jul 8, 2020
83e6ff4
Moved utilities to utils, made cfgwriter read a proper file, formatte…
Aathish04 Jul 9, 2020
804a98f
Add some exception handling on wrong colours and fix some errors
naveen521kk Jul 10, 2020
fbcf463
Fix changes
naveen521kk Jul 10, 2020
8583846
Merge branch 'master' of https://github.com/ManimCommunity/manim into…
naveen521kk Jul 12, 2020
4afd1f5
Fix some changes as asked 👌
naveen521kk Jul 12, 2020
d5162f5
Imporve cfgwriter.py and changed . to _ as asked 👌
naveen521kk Jul 13, 2020
1bd10b6
Update manim/logger.py
Aathish04 Jul 13, 2020
cf94603
Fix a link that wouldn't display properly.
Aathish04 Jul 13, 2020
b60178b
Update manim/utils/cfgwriter.py
Aathish04 Jul 13, 2020
6f94fc5
String Clarity and Using f-strings.
Aathish04 Jul 14, 2020
fab3705
Simplify an "if" statement.
Aathish04 Jul 14, 2020
561f9bd
Merge branch 'master' into rich-colour-cli
Aathish04 Jul 14, 2020
b3b428f
Some general Fixes
naveen521kk Jul 15, 2020
3f7842b
Fix the file to read and fix read config file location
naveen521kk Jul 15, 2020
6d6fe1b
Fix required changes make all the constants define at top, remove unw…
naveen521kk Jul 20, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions example_scenes/manim.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

#This is some custom configuration just as an example
[logger]
logging_keyword = magenta
logging_level_notset = dim
logging_level_debug = yellow
logging_level_info = dim purple
logging_level_warning = dim red
logging_level_error = red
logging_level_critical = red
log_level =
log_time = dim yellow
log_message = green
log_path = dim blue

6 changes: 3 additions & 3 deletions manim/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .utils.sounds import play_error_sound
from .utils.sounds import play_finish_sound
from . import constants
from .logger import logger
from .logger import logger,console


def open_file_if_needed(file_writer):
Expand Down Expand Up @@ -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__
print("%d: %s" % (count, name))
console.print(f"{count}: {name}", style="logging.level.info")
num_to_class[count] = scene_class
try:
user_input = input(constants.CHOOSE_NUMBER_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:
Expand Down
Loading