Page MenuHome

Further work on D791 - report duplicates, parsing errors in the UI
AbandonedPublic

Authored by Vuk Gardašević (lijenstina) on Mar 16 2017, 5:44 AM.

Details

Summary

Following the great idea by Greg Zaal in D791 this differential adds additional functionality.

Now there is grouping of the files based upon the Add-on name.
Added almost all errors parsing, UTF-8 etc. from the add-on register function grouping them under the file path.
Moved the missing files to the same block.
The errors are now closed by default and can be expanded with a button the right corner.

Uses a BoolVectorProperty for the Expanding/Collapsing of the UI elements
The data is stored in two defaultdict(set) - error_duplicates and error_encoding
Added a tag_redraw call in the Refresh operator in the Header.
Grouped all the console/terminal prints in a similar fashion were possible
Adressed the case when a Script path is defined in the System preferences would show up twice in the output
Added two new helper functions

Some examples:

Encoding/parsing errors:
Console output:
Duplicate Files:
Errors UI Collapsed:

Open Questions:

  • What errors should be exposed in the UI: error_encoding dictionary allows to add all of information related to a specific file - however what is useful to have? What format?
  • Separate helper functions are introduced: Are they useful enough for code deduplication or they need more changes or even removed/replaced?
  • Data storage of errors: Is defaultdict the best solution? Does it add some overhead?
  • Additional information: strings needed explaining what is expected from the user?

In general, I think this is relatively good way of organizing and exposing add-ons' non runtime errors to the user, but it does need some scope, size and format evaluation. :)

Diff Detail

Event Timeline

Campbell Barton (campbellbarton) abandoned this revision.EditedAug 25 2017, 6:17 PM
Campbell Barton (campbellbarton) edited edge metadata.

Afraid this patch is too intrusive, making the addon UI into some more comprehensive reporting UI, at the expense of simple & readable code.

Note that users should not be running into encoding errors since all scripts should be utf-8, this is an exceptional case that developers may experience,
and for developers I think its reasonable to ask them to look at the stdout.

Am not against some minor improvements to output, but these changes are too heavy.


Edit: perhaps we could change behavior and log errors to a file, this way we can add a lot of useful details there without trying to mix this into the current UI.

Though I'd like to know if users are running into these problems often and need more details to resolve problems.

I agree that this is maybe too intrusive for now. Also with the possible inclusion of the Add-on / Package manager sometimes in the future it could be a task / part of that project. Logging to a file could be a solution.