Error when adding theme to `~/.config/babi/theme.json`
See original GitHub issueHi Anthony,
I was testing babi on my Ubuntu 18.04 server via SSH and it worked perfectly fine until I tried to add themes to ~/.config/babi/theme.json
I tried to add this theme. I simply copy/pasted it into a file named theme.json
.
I am using Python 3.6.9 and when executingbabi theme.json
the following error comes up:
Traceback (most recent call last):
File "/home/kittnjdr/.local/bin/babi", line 11, in <module>
load_entry_point('babi==0.0.1', 'console_scripts', 'babi')()
File "/home/kittnjdr/.local/lib/python3.6/site-packages/babi/main.py", line 63, in main
return c_main(stdscr, args)
File "/home/kittnjdr/.local/lib/python3.6/site-packages/babi/main.py", line 37, in c_main
screen = Screen(stdscr, args.filenames or [None], perf)
File "/home/kittnjdr/.local/lib/python3.6/site-packages/babi/screen.py", line 78, in __init__
Syntax.from_screen(stdscr, color_manager),
File "/home/kittnjdr/.local/lib/python3.6/site-packages/babi/hl/syntax.py", line 143, in from_screen
theme = Theme.from_filename(xdg_config('theme.json'))
File "/home/kittnjdr/.local/lib/python3.6/site-packages/babi/theme.py", line 152, in from_filename
return cls.from_dct(json.loads(contents))
File "/home/kittnjdr/.local/lib/python3.6/site-packages/babi/theme.py", line 139, in from_dct
return cls(Style(**default), TrieNode.from_dct(root))
File "/home/kittnjdr/.local/lib/python3.6/site-packages/babi/theme.py", line 74, in from_dct
k: TrieNode.from_dct(v) for k, v in dct['children'].items()
File "/home/kittnjdr/.local/lib/python3.6/site-packages/babi/theme.py", line 74, in <dictcomp>
k: TrieNode.from_dct(v) for k, v in dct['children'].items()
File "/home/kittnjdr/.local/lib/python3.6/site-packages/babi/theme.py", line 74, in from_dct
k: TrieNode.from_dct(v) for k, v in dct['children'].items()
File "/home/kittnjdr/.local/lib/python3.6/site-packages/babi/theme.py", line 74, in <dictcomp>
k: TrieNode.from_dct(v) for k, v in dct['children'].items()
File "/home/kittnjdr/.local/lib/python3.6/site-packages/babi/theme.py", line 76, in from_dct
return cls(PartialStyle.from_dct(dct), children)
File "/home/kittnjdr/.local/lib/python3.6/site-packages/babi/theme.py", line 48, in from_dct
kv['fg'] = Color.parse(dct['foreground'])
File "/home/kittnjdr/.local/lib/python3.6/site-packages/babi/color.py", line 11, in parse
return cls(r=int(s[1:3], 16), g=int(s[3:5], 16), b=int(s[5:7], 16))
ValueError: invalid literal for int() with base 16: 'hi'
Maybe this theme is not suitable?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
babi/README.md at main · asottile/babi - GitHub
pip install babi ... it to json (if it is not already json) and put it at ~/.config/babi/theme.json . a helper script is...
Read more >babi - Python Package Health Analysis - Snyk
Based on project statistics from the GitHub repository for the PyPI package babi, we found that it has been starred 282 times, and...
Read more >babi [python]: Datasheet - Package Galaxy
Installation: pip install babi ... convert it to json (if it is not already json) and put it at ~/.config/babi/theme.json . a helper...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
whoa, weird! it looks like ~some coloring is taking but it’s greyscaled everything?
here’s what it looks like for me once I fixed
white
– I also didblack
at the same time, I don’t suspect other named colors will come up but I’ll try a bunch of themes later to verify 👍thanks again for the report!