当前位置: 首页>>代码示例>>Python>>正文


Python GLib.markup_escape_text方法代码示例

本文整理汇总了Python中gi.repository.GLib.markup_escape_text方法的典型用法代码示例。如果您正苦于以下问题:Python GLib.markup_escape_text方法的具体用法?Python GLib.markup_escape_text怎么用?Python GLib.markup_escape_text使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gi.repository.GLib的用法示例。


在下文中一共展示了GLib.markup_escape_text方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: generate_commandlist

# 需要导入模块: from gi.repository import GLib [as 别名]
# 或者: from gi.repository.GLib import markup_escape_text [as 别名]
def generate_commandlist(self):
        """Generate a list of internal vimiv commands and store it."""
        commands = [cmd.name for cmd in self._app["commandline"].commands
                    if not cmd.is_hidden]
        aliases = list(self._app["commandline"].commands.aliases.keys())
        all_commands = sorted(commands + aliases)
        infodict = read_info_from_man()
        for command in all_commands:
            if command in infodict:
                info = infodict[command]
            elif command in aliases:
                info = "Alias to %s" % (
                    self._app["commandline"].commands.aliases[command])
            else:
                info = ""
            info = "<i>" + GLib.markup_escape_text(info) + "</i>"
            self._liststores["internal"][0].append([command, info]) 
开发者ID:karlch,项目名称:vimiv,代码行数:19,代码来源:completions.py

示例2: _get_pango_text

# 需要导入模块: from gi.repository import GLib [as 别名]
# 或者: from gi.repository.GLib import markup_escape_text [as 别名]
def _get_pango_text(self, text):
        rv = self._pango_text_cache.get(text, None)
        if rv is None:
            rv = GLib.markup_escape_text(text or '')
            self._pango_text_cache[text] = rv
        return rv 
开发者ID:neovim,项目名称:python-gui,代码行数:8,代码来源:gtk_ui.py

示例3: on_connection_changed

# 需要导入模块: from gi.repository import GLib [as 别名]
# 或者: from gi.repository.GLib import markup_escape_text [as 别名]
def on_connection_changed(self, worksheet):
        markup = '<small>Connected to</small>\n'
        if worksheet.connection is not None:
            conn = worksheet.connection.get_label()
        else:
            conn = 'Not connected.'
        markup += '<b>{}</b>'.format(GLib.markup_escape_text(conn))
        self.lbl_conn.set_markup(markup)

        # update schema
        self.browser_model.clear()
        if worksheet.connection:
            worksheet.connection.schema.connect(
                'changed', self._update_browser) 
开发者ID:andialbrecht,项目名称:runsqlrun,代码行数:16,代码来源:context.py

示例4: escape

# 需要导入模块: from gi.repository import GLib [as 别名]
# 或者: from gi.repository.GLib import markup_escape_text [as 别名]
def escape(tooltip):
    '''Escape special characters in tooltip text'''
    return GLib.markup_escape_text(tooltip) 
开发者ID:XuShaohua,项目名称:bcloud,代码行数:5,代码来源:gutil.py

示例5: __init__

# 需要导入模块: from gi.repository import GLib [as 别名]
# 或者: from gi.repository.GLib import markup_escape_text [as 别名]
def __init__(self, plugin, switch_callback):
        super(PluginListRow, self).__init__()

        self.plugin = plugin
        self._refresh = False

        self._switch_callback = switch_callback

        label1 = Gtk.Label()
        escape = GLib.markup_escape_text(plugin.get_name())
        label1.set_markup("<b>" + escape + "</b>")
        label1.set_ellipsize(Pango.EllipsizeMode.END)
        label1.props.halign = Gtk.Align.START
        label1.set_has_tooltip(True)
        label1.props.margin_top = 5
        label1.connect('query-tooltip', self._display_tooltip)
        label2 = Gtk.Label(plugin.get_description())
        label2.set_ellipsize(Pango.EllipsizeMode.END)
        label2.props.halign = Gtk.Align.START
        label2.set_has_tooltip(True)
        label2.connect('query-tooltip', self._display_tooltip)
        label2.props.margin_bottom = 5

        switch = Gtk.Switch.new()
        self._switch = switch
        switch.props.valign = Gtk.Align.CENTER

        sensitive = False

        try:
            if plugin.is_available():
                sensitive = True
            switch.set_active(plugin.is_loaded())
        except:
            pass

        box = Gtk.Box()
        box.set_orientation(Gtk.Orientation.VERTICAL)
        box.pack_start(label1, True, False, 0)
        box.pack_start(label2, True, False, 1)

        outerbox = Gtk.Box()
        outerbox.set_orientation(Gtk.Orientation.HORIZONTAL)
        outerbox.pack_start(Gtk.Label("  "), False, False, 0)
        outerbox.pack_start(box, False, False, 1)
        outerbox.pack_end(switch, False, False, 3)

        self.add(outerbox)
        self.outerbox = outerbox

        if not sensitive:
            self.add_error()

        switch.connect('notify::active', self._switch_changed) 
开发者ID:fossfreedom,项目名称:alternative-toolbar,代码行数:56,代码来源:alttoolbar_plugins.py


注:本文中的gi.repository.GLib.markup_escape_text方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。