8000 TypeError: object of type 'int' has no len() on vit start if user has redefined uda.priority · Issue #268 · vit-project/vit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

TypeError: object of type 'int' has no len() on vit start if user has redefined uda.priority #268

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
ifohancroft opened this issue Sep 3, 2020 · 2 comments

Comments

@ifohancroft
Copy link
ifohancroft commented Sep 3, 2020

Describe the bug
I have redefined the Priority UDA in my config.
More precisely, I have the following two lines in my config:

uda.priority.type=numeric
uda.priority.label=Priority

and I have some tasks to which I have added an integer as a value for Priority (I am not sure if the problem exists if no tasks have any priority).

When you run vit, it gives the following error:

Traceback (most recent call last):
  File "/usr/bin/vit", line 33, in <module>
    sys.exit(load_entry_point('vit==2.0.0', 'console_scripts', 'vit')())
  File "/usr/lib/python3.8/site-packages/vit-2.0.0-py3.8.egg/vit/command_line.py", line 5, in main
    Application(options, filters)
  File "/usr/lib/python3.8/site-packages/vit-2.0.0-py3.8.egg/vit/application.py", line 74, in __init__
    self.refresh(False)
  File "/usr/lib/python3.8/site-packages/vit-2.0.0-py3.8.egg/vit/application.py", line 896, in refresh
    self.build_main_widget()
  File "/usr/lib/python3.8/site-packages/vit-2.0.0-py3.8.egg/vit/application.py", line 944, in build_main_widget
    self.update_report(self.report)
  File "/usr/lib/python3.8/site-packages/vit-2.0.0-py3.8.egg/vit/application.py", line 919, in update_report
    self.update_task_table()
  File "/usr/lib/python3.8/site-packages/vit-2.0.0-py3.8.egg/vit/application.py", line 555, in update_task_table
    self.table.update_data(self.reports[self.report], self.model.tasks)
  File "/usr/lib/python3.8/site-packages/vit-2.0.0-py3.8.egg/vit/task_list.py", line 93, in update_data
    self.build_rows()
  File "/usr/lib/python3.8/site-packages/vit-2.0.0-py3.8.egg/vit/task_list.py", line 237, in build_rows
    formatted_value = column['formatter'].format(task[column['name']], task)
  File "/usr/lib/python3.8/site-packages/vit-2.0.0-py3.8.egg/vit/formatter/uda_string.py", line 7, in format
    return (len(string), self.markup_element(string))
TypeError: object of type 'int' has no len()

The fault is pretty much the line that defines priority's type as numeric. If you comment it out or you rename the field, the problem is fixed.

@thehunmonkgroup
Copy link
Member

Turns out since priority is just another UDA, it can use the standard UDA formatting logic instead of its own formattter.

79bc2e9 should fix your issue, please confirm.

@ifohancroft
Copy link
Author
ifohancroft commented Sep 20, 2020

This indeed fixes it. Thank you!

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

2 participants
0