AuHau / toggl-cli

A simple command-line interface for toggl.com

Home Page:https://toggl.uhlir.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Table row names barely legible with light terminal themes

IgorKrupenja opened this issue · comments

Steps:

  1. Have a light/white terminal theme.
  2. Run toggl now.

Result:
Table row names (Billable, Duration, etc) barely legible.

image

Hmm this is definitely unfortunate. It will require to create some sort of theming support I guess. I am currently focused on different projects, but I will try to get back to it at some point, but can't promise anything. If anybody would like to make PR for this, it would be appreciated!

Thank you for implementing this! I was wondering what is the proper procedure to change the theme? If I add theme = 'light' to .togglrc under [options], I get ERROR: 'NoneType' object has no attribute 'header' every time I run a toggl-cli command, e.g. toggl now. Am I missing something?

Hmm can you please re-run the command with env. variable TOGGL_EXCEPTIONS=1 and past the traceback?

Sure, this is the traceback I got:

Traceback (most recent call last):
  File "/usr/local/bin/toggl", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/toggl/toggl.py", line 12, in main
    cli.entrypoint(args or sys.argv[1:])
  File "/usr/local/lib/python3.7/site-packages/toggl/cli/commands.py", line 35, in entrypoint
    cli(args, obj=obj or {})
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/toggl/cli/commands.py", line 485, in entry_now
    helpers.entity_detail(api.TimeEntry, current, primary_field='description', obj=ctx.obj)
  File "/usr/local/lib/python3.7/site-packages/toggl/cli/helpers.py", line 97, in entity_detail
    click.style(key.replace('_', ' ').capitalize(), **theme.header),
AttributeError: 'NoneType' object has no attribute 'header'

My complete .togglrc:

[version]
version = 2.2.0

[auth]
api_token = (removed)

[options]
tz = local
theme = 'light'

Oh, I see the problem now. Don't use ' in the config 😉 Or I think that should be the problem.

But at least you pointed out that I did not really implemented any checks for when you load non-existing theme 😅 Will fix that...

Yes, just a moment ago discovered that this indeed works without quotes in config 😅 Thank you again for implementing this!

Sweet! Glad it works :-)