Add a descriptor plugin that emulates MXR's descriptor column.#561
Add a descriptor plugin that emulates MXR's descriptor column.#561pelmers merged 13 commits intomozilla:masterfrom
Conversation
dxr/plugins/descriptor/__init__.py
Outdated
| return match.group('description') | ||
|
|
||
| def generic_describe(self): | ||
| """Look at the first 60 lines for a match for |
|
I'm very excited about this. I'll give it a proper review later. |
| def concat_plugin_headers(plugin_list): | ||
| """Return a list of the concatenation of all browse_headers in the | ||
| FolderToIndexes of given plugin list. | ||
| """ |
There was a problem hiding this comment.
For consistency with the rest of the code, there should be a skipped blank line before the closing """. That would be a great thing for the linter to enforce. :-)
|
That's all I've got! |
|
Thanks for the reviewing! |
dxr/plugins/descriptor/__init__.py
Outdated
| @@ -119,9 +119,9 @@ def generic_describe(self): | |||
| try: | |||
| description_re = re.compile(r'(?:{}|{}|description)\ | |||
There was a problem hiding this comment.
I don't think you can just throw line breaks and other whitespace into the middle of regexes and have it ignored, unless you set the re.X flag. You can either do that here or else lay a bunch of complete string literals end to end.
Also add some framework for plugins to supply needles on folders and adding headers to the browsing view. Fixes bug 1157968.
The descriptor attempted to return the first line of 'threadmessage.o' in my previous attempt.
dxr/plugins/descriptor/__init__.py
Outdated
| desc_lower = desc.lower() | ||
| # Skip any comment that contains the license or a tab-width | ||
| # emacs/vim setting. | ||
| if not any((pattern in desc_lower for pattern in {'tab-width', 'license', 'vim:'})): |
There was a problem hiding this comment.
There's an extra set of parens here. (A genexpr doesn't need its own set if it's the only arg to a func.) And there's no sense using a set (and the extra hashing and RAM) because we're just iterating over it.
|
I just want to see the revised regex before merging. |
|
revised regex: 35fbef5#diff-1983f06f8b72881fa49fad67de088e8bR61 |
|
r+! Hooray for user-visible changes! |
Also add some framework for plugins to supply needles on folders and
adding headers to the browsing view.
Fixes bug 1157968.

Example