• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python icon.get_icon_file_name函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中sugar3.graphics.icon.get_icon_file_name函数的典型用法代码示例。如果您正苦于以下问题:Python get_icon_file_name函数的具体用法?Python get_icon_file_name怎么用?Python get_icon_file_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: _add_row

 def _add_row(self, sender, message, icon_name, icon_color):
     self._store.append((get_icon_file_name(icon_name),
                         XoColor(icon_color),
                         sender,
                         message,
                         get_icon_file_name('list-remove'),
                         XoColor('#FFFFFF,#000000')))
开发者ID:Anubhav-J,项目名称:sugar,代码行数:7,代码来源:expandedentry.py


示例2: _get_icon_for_mime

def _get_icon_for_mime(mime_type):
    generic_types = mime.get_all_generic_types()
    for generic_type in generic_types:
        if mime_type in generic_type.mime_types:
            file_name = get_icon_file_name(generic_type.icon)
            if file_name is not None:
                return file_name

    icons = Gio.content_type_get_icon(mime_type)
    logging.debug('icons for this file: %r', icons.props.names)
    for icon_name in icons.props.names:
        file_name = get_icon_file_name(icon_name)
        if file_name is not None:
            return file_name
开发者ID:edudev,项目名称:sugar,代码行数:14,代码来源:misc.py


示例3: get_icon_name

def get_icon_name(metadata):
    file_name = None

    bundle_id = metadata.get('activity', '')
    if not bundle_id:
        bundle_id = metadata.get('bundle_id', '')

    if bundle_id:
        activity_info = bundleregistry.get_registry().get_bundle(bundle_id)
        if activity_info:
            file_name = activity_info.get_icon()

    if file_name is None and is_activity_bundle(metadata):
        file_path = model.get_file(metadata['uid'])
        if file_path is not None and os.path.exists(file_path):
            try:
                bundle = ActivityBundle(file_path)
                file_name = bundle.get_icon()
            except Exception:
                logging.exception('Could not read bundle')

    if file_name is None:
        file_name = _get_icon_for_mime(metadata.get('mime_type', ''))

    if file_name is None:
        file_name = get_icon_file_name('application-octet-stream')

    return file_name
开发者ID:edudev,项目名称:sugar,代码行数:28,代码来源:misc.py


示例4: get_icon_name

def get_icon_name(metadata):
    file_name = None

    bundle_id = metadata.get("activity", "")
    if not bundle_id:
        bundle_id = metadata.get("bundle_id", "")

    if bundle_id:
        activity_info = bundleregistry.get_registry().get_bundle(bundle_id)
        if activity_info:
            file_name = activity_info.get_icon()

    if file_name is None and is_activity_bundle(metadata):
        file_path = model.get_file(metadata["uid"])
        if file_path is not None and os.path.exists(file_path):
            try:
                bundle = ActivityBundle(file_path)
                file_name = bundle.get_icon()
            except Exception:
                logging.exception("Could not read bundle")

    if file_name is None:
        file_name = _get_icon_for_mime(metadata.get("mime_type", ""))

    if file_name is None:
        file_name = get_icon_file_name("application-octet-stream")

    return file_name
开发者ID:erikos,项目名称:sugar,代码行数:28,代码来源:misc.py


示例5: __init__

    def __init__(self, file_transfer):
        BaseTransferButton.__init__(self, file_transfer)

        self._ds_object = datastore.create()

        file_transfer.connect('notify::state', self.__notify_state_cb)
        file_transfer.connect('notify::transferred-bytes',
                              self.__notify_transferred_bytes_cb)

        icons = Gio.content_type_get_icon(file_transfer.mime_type).props.names
        icons.append('application-octet-stream')
        for icon_name in icons:
            icon_name = 'transfer-from-%s' % icon_name
            file_name = get_icon_file_name(icon_name)
            if file_name is not None:
                self.props.icon_widget.props.icon_name = icon_name
                self.notif_icon.props.icon_name = icon_name
                break

        icon_color = file_transfer.buddy.props.color
        self.props.icon_widget.props.xo_color = icon_color
        self.notif_icon.props.xo_color = icon_color

        frame = jarabe.frame.get_view()
        frame.add_notification(self.notif_icon,
                               Gtk.CornerType.TOP_LEFT)
开发者ID:AxEofBone7,项目名称:sugar,代码行数:26,代码来源:activitiestray.py


示例6: get_icon_name

def get_icon_name(metadata):
    file_name = None

    bundle_id = metadata.get('activity', '')
    if not bundle_id:
        bundle_id = metadata.get('bundle_id', '')

    if bundle_id:
        if bundle_id == PROJECT_BUNDLE_ID:
            file_name = \
                '/home/broot/sugar-build/build' + \
                '/out/install/share/icons/sugar/' + \
                'scalable/mimetypes/project-box.svg'
            return file_name

        activity_info = bundleregistry.get_registry().get_bundle(bundle_id)
        if activity_info:
            file_name = activity_info.get_icon()

    if file_name is None and is_activity_bundle(metadata):
        file_path = model.get_file(metadata['uid'])
        if file_path is not None and os.path.exists(file_path):
            try:
                bundle = get_bundle_instance(file_path)
                file_name = bundle.get_icon()
            except Exception:
                logging.exception('Could not read bundle')

    if file_name is None:
        file_name = _get_icon_for_mime(metadata.get('mime_type', ''))

    if file_name is None:
        file_name = get_icon_file_name('application-octet-stream')

    return file_name
开发者ID:iamutkarshtiwari,项目名称:sugar,代码行数:35,代码来源:misc.py


示例7: _load_mode

 def _load_mode(self, mode):
     if mode == _MODE_HELP:
         self._webview.load_uri(self._help_url)
     else:
         # Loading any content for the social help page can take a
         # very long time (eg. the site is behind a redirector).
         # Loading the animation forces webkit to re-render the
         # page instead of keeping the previous page (so the user
         # sees that it is loading)
         path = get_icon_file_name(_LOADING_ICON)
         if path:
             self._webview.load_uri('file://' + path)
             # Social help is loaded after the icon is loaded
         else:
             self._webview.load_uri(self._social_help_url)
开发者ID:richaseh,项目名称:sugar,代码行数:15,代码来源:viewhelp.py


示例8: __init__

    def __init__(self, file_transfer):
        BaseTransferButton.__init__(self, file_transfer)

        icons = Gio.content_type_get_icon(file_transfer.mime_type).props.names
        icons.append("application-octet-stream")
        for icon_name in icons:
            icon_name = "transfer-to-%s" % icon_name
            file_name = get_icon_file_name(icon_name)
            if file_name is not None:
                self.props.icon_widget.props.icon_name = icon_name
                self.notif_icon.props.icon_name = icon_name
                break

        icon_color = profile.get_color()
        self.props.icon_widget.props.xo_color = icon_color
        self.notif_icon.props.xo_color = icon_color

        frame = jarabe.frame.get_view()
        frame.add_notification(self.notif_icon, Gtk.CornerType.TOP_LEFT)
开发者ID:native93,项目名称:bulletinframe,代码行数:19,代码来源:activitiestray.py


示例9: __init__

    def __init__(self, file_transfer):
        BaseTransferButton.__init__(self, file_transfer)

        icons = Gio.content_type_get_icon(file_transfer.mime_type).props.names
        icons.append('application-octet-stream')
        for icon_name in icons:
            icon_name = 'transfer-to-%s' % icon_name
            file_name = get_icon_file_name(icon_name)
            if file_name is not None:
                self.props.icon_widget.props.icon_name = icon_name
                self.notif_icon.props.icon_name = icon_name
                break

        client = GConf.Client.get_default()
        icon_color = XoColor(client.get_string('/desktop/sugar/user/color'))
        self.props.icon_widget.props.xo_color = icon_color
        self.notif_icon.props.xo_color = icon_color

        frame = jarabe.frame.get_view()
        frame.add_notification(self.notif_icon,
                               Gtk.CornerType.TOP_LEFT)
开发者ID:ChristoferR,项目名称:sugar,代码行数:21,代码来源:activitiestray.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python icon.CanvasIcon类代码示例发布时间:2022-05-27
下一篇:
Python combobox.ComboBox类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap