Opening quote highlighting doesn't work
- Dominant language
- Python
- Stars
- 93.9k
- Forks
- 7.7k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 4
Description
I'm running through some of the older examples and playing with opening quotes. It seems like opening quote highlighting isn't working.
Consider the toy example (although any opening quote from the eoc/eola projects does this):
```
class FunnyOpeningQuote(OpeningQuote):
CONFIG = {
"quote" : [
"I am ",
"error",
".",
],
"highlighted_quote_terms" : {
"error" : RED,
},
"author" : "A wise man"
}
```
When generating a video from this with `python extract_scene.py my_scenes.py FunnyOpeningQuote -pl` the following error occurs
```
Traceback (most recent call last):
File "extract_scene.py", line 273, in main
handle_scene(SceneClass(**scene_kwargs), **config)
File "/home/graham/Programming/Python/manim/scene/scene.py", line 71, in __init__
self.construct(*self.construct_args)
File "/home/graham/Programming/Python/manim/for_3b1b_videos/common_scenes.py", line 48, in construct
self.quote = self.get_quote()
File "/home/graham/Programming/Python/manim/for_3b1b_videos/common_scenes.py", line 78, in get_quote
for term, color in self.highlighted_quote_terms:
ValueError: too many values to unpack
```
This seems like a string parsing error on the part of library, so I looked a little further into it and if I were to provide the following example:
```
class FunnyOpeningQuote(OpeningQuote):
CONFIG = {
"quote" : [
"I am ",
"error",
".A",
],
"highlighted_quote_terms" : {
".A" : RED,
},
"author" : "A wise man"
}
```
Then the error provides more useful information:
```
...
File "/home/graham/.local/lib/python2.7/site-packages/colour.py", line 990, in __setattr__
fc(value)
File "/home/graham/.local/lib/python2.7/site-packages/colour.py", line 1071, in set_web
self.hex = web2hex(value)
File "/home/graham/.local/lib/python2.7/site-packages/colour.py", line 667, in web2hex
raise ValueError("%r is not a recognized color." % web)
ValueError: 'a' is not a recognized color.
```
To me, this is telling me that instead of reading it as a string followed by a color value, this is reading the entire thing as a sequence of characters followed by a color at the end. I'm not strong on python language, but I'm assuming that this means the following line from `common_scenes.py` needs to be modified in some way
``
for term, color in self.highlighted_quote_terms:
quote.set_color_by_tex(term, color)
``
Let me know if this is a real issue or if I've gone completely bananas here.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.