estollnitz / pyspector Goto Github PK
View Code? Open in Web Editor NEWA simple user interface for inspecting Python modules
License: MIT License
A simple user interface for inspecting Python modules
License: MIT License
Whenever the user types search text (in the main window or in the module selection dialog), we should automatically select the best matching item in the tree, expanding ancestor items and scrolling the selection into view as needed.
Currently, pyspector can locate source code for modules, classes, and functions (at least those that are not built-in), but it can't locate source code for objects. We could attempt to locate objects declared within modules or classes by searching within the source file of the containing module or class.
For example, see the versionchanged directive in numpy.linalg.lstsq. The content is used directly in the output without applying further formatting.
The HeaderedDirective
class within rstToHtml.py should call self.state.nested_parse
, as shown in the BaseAdmonition
example here: http://docutils.sourceforge.net/docs/howto/rst-directives.html.
Docstrings written using reStructuredText often contain interpreted text (in backquotes) that refers to related modules, classes, and functions. We currently use the code
role for interpreted text that has no specified role, because otherwise we'd display lots of hyperlinks that don't resolve to actual items.
Examples of interpreted text with no specified role that should be hyperlinked:
`docutils.frontend.OptionParser`
`.Text`
`~matplotlib.axes.Axes`
`numpy.linalg`
See numpy.amin for several more examples, some of which should be hyperlinked, and others which should not.
All functions declared within a class currently look the same. It would be nice to distinguish between instance methods, class methods, and static methods โ either by giving them completely different icons ("m", "c", "s"?) or by slightly modifying the current function icon.
Colors used for code syntax highlighting and hyperlinks have poor contrast in MacOS dark mode.
When the user clicks on a link in documentation or in the class inheritance hierarchy, the corresponding item may be a member of a module that isn't currently being inspected. If that's the case, the current implementation does nothing and the link appears broken. Instead, we should ask the user whether they want to load and inspect that module, or perhaps just go ahead and do it without asking.
The current implementation of PythonSyntaxHighlighter treats everything after a #
character as a comment, even if that character is part of a string. Instead, it should only consider the #
character as the start of a comment if it appears outside a string. I'm not sure if this is achievable using a syntax highlighter based entirely on regular expressions.
Open PythonSyntaxHighlighter in pyspector to see an example near the top of the file.
Include the signature of a function whenever possible when displaying it in the tree view.
Module inspection may be slow because it re-analyzes classes that are included in multiple other classes. PyQt5.QtWidgets is one example that seems to have a lot of redundancy.
Remember the sequence of items that the user selects in the tree view. Provide buttons and keyboard shortcuts to navigate forward and backward through this history.
Ctrl/Cmd+F should move focus to the search box in the main window and the module selection dialog.
Allow the user to remove a module from the tree view by selecting it and pressing the Delete or Backspace key, or through a context menu command.
The current implementation of PythonSyntaxHighlighter applies a distinct color to escape sequences like \n
, regardless of where they appear in the file. Escape sequences that appear within comments should not be colored this way. I'm not sure if this is possible within a syntax highlighter based solely on regular expressions.
Open PythonSyntaxHighlighter in pyspector to see an example near the top of the file.
Populating the list of all available modules (for the module selection dialog) takes a while. The UI is blocked during this operation. We should at least show progress during this operation, and perhaps allow the user to cancel.
The current reStructuredText-to-HTML conversion doesn't switch to code mode for examples surrounded by triple-backquotes. For example, see tensorflow.Tensor, where the documentation view displays ```python
at the start of an example and ```
at the end, with incorrect formatting in between.
Inspecting modules at startup (or when new modules are added) takes a while. The UI is blocked during these operations. We should at least show progress, and perhaps allow the user to cancel.
Follow Google's guide: https://google.github.io/styleguide/pyguide.html.
We should store the position and size of the main window and the module selection dialog in the user's config file, so that they get restored the next time the application is run.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.