inkex.py 文件源码

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

项目:pdftohtml5canvas 作者: greipfrut 项目源码 文件源码
def errormsg(msg):
    """Intended for end-user-visible error messages.

       (Currently just writes to stderr with an appended newline, but could do
       something better in future: e.g. could add markup to distinguish error
       messages from status messages or debugging output.)

       Note that this should always be combined with translation:

         import inkex
         inkex.localize()
         ...
         inkex.errormsg(_("This extension requires two selected paths."))
    """
    if isinstance(msg, unicode):
        sys.stderr.write(msg.encode("UTF-8") + "\n")
    else:
        sys.stderr.write((unicode(msg, "utf-8", errors='replace') + "\n").encode("UTF-8"))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号