workflow.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Gank-Alfred-Workflow 作者: hujiaweibujidao 项目源码 文件源码
def register(self, name, serializer):
        """Register ``serializer`` object under ``name``.

        Raises :class:`AttributeError` if ``serializer`` in invalid.

        .. note::

            ``name`` will be used as the file extension of the saved files.

        :param name: Name to register ``serializer`` under
        :type name: ``unicode`` or ``str``
        :param serializer: object with ``load()`` and ``dump()``
            methods

        """

        # Basic validation
        getattr(serializer, 'load')
        getattr(serializer, 'dump')

        self._serializers[name] = serializer
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号