本文整理汇总了Python中gtk.Label.set_markup方法的典型用法代码示例。如果您正苦于以下问题:Python Label.set_markup方法的具体用法?Python Label.set_markup怎么用?Python Label.set_markup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gtk.Label
的用法示例。
在下文中一共展示了Label.set_markup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from gtk import Label [as 别名]
# 或者: from gtk.Label import set_markup [as 别名]
def __init__(self, parent, backend):
self.backend = backend
self.dialog = GtkAboutDialog()
self.dialog.set_transient_for(parent)
self.dialog.set_modal(True)
self.dialog.set_name(_("Subscription Manager"))
self.dialog.set_license(LICENSE)
self.dialog.set_wrap_license(True)
self.dialog.set_website("https://fedorahosted.org/subscription-manager/")
self.dialog.set_copyright(_("Copyright (c) 2012 Red Hat, Inc."))
self.dialog.set_logo(gdk.pixbuf_new_from_file_at_size(LOGO_PATH, 100, 100))
rhsm_version_label = Label()
backend_version_label = Label()
context_box = self.dialog.vbox.get_children()[0]
context_box.pack_end(rhsm_version_label)
context_box.pack_end(backend_version_label)
# Set the component versions.
versions = get_version_dict(self.backend.uep)
self.dialog.set_version(versions['subscription manager'])
rhsm_version_label.set_markup(_("<b>python-rhsm version:</b> %s" % \
versions['python-rhsm']))
backend_version_label.set_markup(_("<b>remote entitlement server version:</b> %s" % \
versions['candlepin']))
self.dialog.connect("response", self._handle_response)
self.dialog.show_all()
示例2: __init__
# 需要导入模块: from gtk import Label [as 别名]
# 或者: from gtk.Label import set_markup [as 别名]
def __init__(self, parent, backend):
self.backend = backend
self.dialog = GtkAboutDialog()
self.dialog.set_transient_for(parent)
self.dialog.set_modal(True)
self.dialog.set_name(_("Subscription Manager"))
self.dialog.set_license(LICENSE)
self.dialog.set_wrap_license(True)
if not get_running_as_firstboot():
self.dialog.set_website("https://fedorahosted.org/subscription-manager/")
self.dialog.set_copyright(_("Copyright (c) 2012 Red Hat, Inc."))
self.dialog.set_logo_icon_name("subscription-manager")
self.dialog.set_icon_name("subscription-manager")
next_update_label = Label()
rhsm_version_label = Label()
backend_version_label = Label()
context_box = self.dialog.vbox.get_children()[0]
context_box.pack_end(next_update_label)
context_box.pack_end(rhsm_version_label)
context_box.pack_end(backend_version_label)
self._set_next_update(next_update_label)
# Set the component versions.
server_versions = get_server_versions(self.backend.cp_provider.get_consumer_auth_cp())
client_versions = get_client_versions()
self.dialog.set_version(client_versions['subscription-manager'])
rhsm_version_label.set_markup(_("<b>python-rhsm version:</b> %s") %
client_versions['python-rhsm'])
backend_version_label.set_markup(_("<b>subscription management service version:</b> %s") %
server_versions['candlepin'])
self.dialog.connect("response", self._handle_response)
self.dialog.show_all()