与mro相关的各种cli工具。用于调试复杂的类限制。

mro-tools的Python项目详细描述


https://badge.fury.io/py/mro-tools.png

与mro相关的各种cli工具。用于调试复杂的类限制。

安装

您可以使用pip:

安装mro-tools
$ pip install mro-tools

为什么?

遗产是美好的。除非不是。 您需要多少次调试mro为>;30个类的复杂类? 你就会知道这不愉快。 编辑器没有多大帮助,因为一旦你跳转到基类,所有的编辑器 继承计算是相对于跳跃类的,而不是原始子类。 这使得我们可以看到 不插入pdb的代码执行。 这个一揽子计划旨在帮助解决这些问题。 它有一组cli工具,可以帮助排除复杂类的故障 有大的mro树。

使用

mro工具通过一个组命令公开所有工具。 通过执行mro-toolscommand可以看到所有可用的命令:

❯❯❯ mro-tools
Usage: mro-tools [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  method  Get all method definitions within all classes...
  version  Print version of mro-tools

每个子命令都有更多文档:

❯❯❯ mro-tools version --help
Usage: mro-tools version [OPTIONS]

  Print version of mro-tools

Options:
  --help  Show this message and exit.

mro-tools也可以作为python模块访问:

❯❯❯ python -m mro_tools

示例

❯❯❯ python -m mro_tools method django.views.generic:FormView.get_context_data
========
Full MRO
========
django.views.generic.edit.FormView
django.views.generic.base.TemplateResponseMixin
django.views.generic.edit.BaseFormView
django.views.generic.edit.FormMixin
django.views.generic.base.ContextMixin
django.views.generic.edit.ProcessFormView
django.views.generic.base.View
builtins.object

----------------------------------------------------
django.views.generic.edit.FormMixin.get_context_data
----------------------------------------------------
def get_context_data(self, **kwargs):
    """Insert the form into the context dict."""
    if 'form' not in kwargs:
        kwargs['form'] = self.get_form()
    return super().get_context_data(**kwargs)

-------------------------------------------------------
django.views.generic.base.ContextMixin.get_context_data
-------------------------------------------------------
def get_context_data(self, **kwargs):
    if 'view' not in kwargs:
        kwargs['view'] = self
    if self.extra_context is not None:
        kwargs.update(self.extra_context)
    return kwargs

历史记录

0.3.0(2019-02-08)

  • 添加了--no-color选项。 这允许在其他编辑器中打开语法突出显示: mro-tools klass ... | vim -R - +'set syntax=python'
  • klass命令中将文件添加到类标题

0.2.0(2018-09-22)

  • 添加了klass命令

0.1.3(2018-09-13)

  • 将pygments代码突出显示添加到method

0.1.2(2018-02-13)

  • 添加了--django-configurations选项

0.1.1(2018-01-05)

  • 修复自述文件中的rst标记

0.1.0(2018-01-05)

  • pypi上的第一个版本。

学分

开发领导

贡献者

还没有。为什么不做第一个呢?

许可证

麻省理工学院许可证(MIT)

版权所有(c)2018,Miroslav Shubernetskiy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何将JButton合并到图形中?   java在每个循环中使用基类类型或派生类类型   JavaSwingGUI应用程序完全是空白的,没有任何内容,而按钮被添加到面板中   java Android获取getDefaultSensor括号时出错   java Spring引导和安全性与AngularJS登录页面   java注销appengine应用程序而不从google注销。通用域名格式   java仅在发生错误或异常时创建日志文件,而不使用log4j   java get json数组和Retrift 2   swing中的java响应映像   为什么java的inputstream。close()块?   java驱动管理器。getConnection()非常冗长   java如何使用joml将标准化向量旋转到一个点   ubuntu将Java程序的输出结果保存到一个文件中   java动态可拖动、可编辑和自动调整大小的文本字段