8000 ValueError: The following TaskWarrior color definitions are unsupported in VIT: inverse · Issue #361 · vit-project/vit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ValueError: The following TaskWarrior color definitions are unsupported in VIT: inverse #361

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

Closed
gour opened this issue Oct 13, 2024 · 7 comments

Comments

@gour
Copy link
gour commented Oct 13, 2024

I use bubblegum-256 theme in TW which has the following definition:

color.overdue=bold inverse

that is problematic for Vit.

To Reproduce

  1. starting vit
$  vit
Traceback (most recent call last):
  File "/usr/bin/vit", line 33, in <module>
    sys.exit(load_entry_point('vit==2.3.2', 'console_scripts', 'vit')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/vit/command_line.py", line 5, in main
    Application(options, filters)
  File "/usr/lib/python3.11/site-packages/vit/application.py", line 81, in __init__
    self.refresh(False)
  File "/usr/lib/python3.11/site-packages/vit/application.py", line 963, in refresh
    self.bootstrap(load_early_config)
  File "/usr/lib/python3.11/site-packages/vit/application.py", line 161, in bootstrap
    self.task_color_config = TaskColorConfig(self.config, self.task_config, self.theme, self.theme_alt_backgrounds)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/vit/color.py", line 31, in __init__
    self.display_attrs_available, self.display_attrs = self.convert_color_config(self.task_config.filter_to_dict(r'^color\.'))
                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/vit/color.py", line 73, in convert_color_config
    foreground, background = self.convert_colors(value)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/vit/color.py", line 95, in convert_colors
    foreground_parts, background_parts = self.make_color_parts(foreground, background)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/vit/color.py", line 115, in make_color_parts
    self.check_invalid_color_parts(foreground_parts)
  File "/usr/lib/python3.11/site-packages/vit/color.py", line 106, in check_invalid_color_parts
    raise ValueError("The following TaskWarrior color definitions are unsupported in VIT: %s -- read the documentation for possible workarounds" % ", ".join(invalid_color_parts))
ValueError: The following TaskWarrior color definitions are unsupported in VIT: inverse -- read the documentation for possible workarounds

Any hint?

Edit: I read COLOR.md file, but wonder how to deal with:

# Due
color.due=
color.due.today=rgb125
color.overdue=bold inverse
@gour
Copy link
Author
gour commented Oct 13, 2024

It is a known issue, so closing it.

@ferdinandyb
Copy link

@gour Is it possible to provide vit a different colorscheme than the taskwarrior CLI without having to pass a completely different config file? Since the config format can import it's not a huge pain to solve to still share everything else, but it would look a bit awkward.

@gour
Copy link
Author
gour commented Feb 8, 2025

I'm just aware that, as documented, vit does not recognize all the color declaration as TW.

Moreover, I'm not using vith any longer...actually, currently does not even have TW installed.

@thehunmonkgroup
Copy link
Member

I've chosen to change the behavior when an invalid color setting is found -- now VIT removes the setting, prints a warning, and does NOT throw a ValueError.

I think this is a better outcome for users, since VIT will start, even if it's not the perfect coloring they expect.

@ferdinandyb
Copy link
ferdinandyb commented Feb 8, 2025 via email

@ferdinandyb
8000 Copy link

Any chance of this making it into a release soon?

@thehunmonkgroup
Copy link
Member

https://github.com/vit-project/vit/releases/tag/v2.3.3
https://pypi.org/project/vit/2.3.3/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0