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

Python resources.path函数代码示例

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

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



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

示例1: init_info

 def init_info(self, info):
     if info.is_folder:
         thumb_path = resources.path("images/icon-folder.png")
     else:
         thumb_path = resources.path("images/icon-playlist.png")
     info.icon = imagepool.get_surface(thumb_path)
     info.unwatched = info.available = 0
开发者ID:nxmirrors,项目名称:miro,代码行数:7,代码来源:tablist.py


示例2: adjustContent

    def adjustContent(self, videoWindow, animate):
        if videoWindow.is_fullscreen:
            self.popInOutButton.setHidden_(YES)
            self.popInOutLabel.setHidden_(YES)
            self.fsButton.setImage_(NSImage.imageNamed_('fs-button-exitfullscreen'))
            self.fsButton.setAlternateImage_(NSImage.imageNamed_('fs-button-exitfullscreen-alt'))
        else:
            if app.playback_manager.detached_window is None:
                image_path = resources.path('images/popout.png')
                label = _('Pop Out')
            else:
                image_path = resources.path('images/popin.png')
                label = _('Pop In')
            self.popInOutButton.setImage_(NSImage.alloc().initWithContentsOfFile_(image_path))
            self.popInOutButton.setHidden_(NO)
            self.popInOutLabel.setHidden_(NO)
            self.popInOutLabel.setStringValue_(label)
            self.fsButton.setImage_(NSImage.imageNamed_('fs-button-enterfullscreen'))
            self.fsButton.setAlternateImage_(NSImage.imageNamed_('fs-button-enterfullscreen-alt'))

        newFrame = self.window().frame() 
        if videoWindow.is_fullscreen or app.playback_manager.detached_window is not None: 
            self.titleLabel.setHidden_(NO)
            self.feedLabel.setHidden_(NO)
            newFrame.size.height = 198 
        else: 
            self.titleLabel.setHidden_(YES)
            self.feedLabel.setHidden_(YES)
            newFrame.size.height = 144
        newFrame.origin.x = self.getHorizontalPosition(videoWindow, newFrame.size.width)
        self.window().setFrame_display_animate_(newFrame, YES, animate)
        self.playbackControls.setNeedsDisplay_(YES)
开发者ID:nxmirrors,项目名称:miro,代码行数:32,代码来源:overlay.py


示例3: __init__

 def __init__(self):
     widgetset.DrawingArea.__init__(self)
     self.video_icon = imagepool.get_surface(resources.path('images/mini-icon-video.png'))
     self.audio_icon = imagepool.get_surface(resources.path('images/mini-icon-audio.png'))
     self.reset()
     app.playback_manager.connect('selecting-file', self.handle_selecting)
     app.playback_manager.connect('will-play', self.handle_play)
     app.playback_manager.connect('will-stop', self.handle_stop)
开发者ID:cool-RR,项目名称:Miro,代码行数:8,代码来源:videobox.py


示例4: __init__

 def __init__(self):
     ListViewRenderer.__init__(self)
     self.button = {}
     for button in self.BUTTONS:
         path = resources.path('images/%s-button.png' % button)
         self.button[button] = imagepool.get_surface(path)
     path = resources.path('images/download-arrow.png')
     self.download_icon = imagepool.get_surface(path)
开发者ID:codito,项目名称:miro,代码行数:8,代码来源:style.py


示例5: __init__

 def __init__(self):
     widgetset.DragableCustomButton.__init__(self)
     self.value = False
     self.background = imagepool.get_surface(
         resources.path('images/connect-toggle-bg.png'))
     self.on = imagepool.get_surface(
         resources.path('images/connect-toggle-on.png'))
     self.off = imagepool.get_surface(
         resources.path('images/connect-toggle-off.png'))
开发者ID:CodeforEvolution,项目名称:miro,代码行数:9,代码来源:tabcontroller.py


示例6: init_playlist_info

 def init_playlist_info(self, info):
     info.type = u'sharing-playlist'
     if info.podcast:
         thumb_path = resources.path('images/icon-podcast-small.png')
         active = resources.path('images/icon-podcast-small_active.png')
     else:
         thumb_path = resources.path('images/icon-playlist-small.png')
         active = resources.path('images/icon-playlist-small_active.png')
     info.icon = imagepool.get_surface(thumb_path)
     info.active_icon = imagepool.get_surface(active)
开发者ID:dankamongmen,项目名称:miro,代码行数:10,代码来源:tablist.py


示例7: __init__

 def __init__(self):
     widgetset.CustomButton.__init__(self)
     self.set_can_focus(False)
     self.video_icon = imagepool.get_surface(resources.path('images/mini-icon-video.png'))
     self.audio_icon = imagepool.get_surface(resources.path('images/mini-icon-audio.png'))
     self.reset()
     app.playback_manager.connect('selecting-file', self.on_info_change)
     app.playback_manager.connect('playing-info-changed',
             self.on_info_change)
     app.playback_manager.connect('will-play', self.handle_play)
     app.playback_manager.connect('will-stop', self.handle_stop)
开发者ID:foxi,项目名称:miro,代码行数:11,代码来源:videobox.py


示例8: setUp

    def setUp(self):
        app.testing_mdp = True # hack to override moviedata's in_unit_tests hack
        MiroTestCase.setUp(self)
        self.feed = models.Feed(u'dtv:manualFeed')
        mp3_path = resources.path("testdata/metadata/mp3-0.mp3")
        webm_path = resources.path("testdata/metadata/webm-0.webm")
        jpg_path = resources.path("testdata/dean.jpg")

        self.audio_item = models.FileItem(mp3_path, self.feed.id)
        self.video_item = models.FileItem(webm_path, self.feed.id)
        self.other_item = models.FileItem(jpg_path, self.feed.id)
开发者ID:codito,项目名称:miro,代码行数:11,代码来源:moviedatatest.py


示例9: set_image

    def set_image(self, image_name):
        path = resources.path('images/%s.png' % image_name)
        self.image = imagepool.get_surface(path)
        pressed_path = resources.path('images/%s_active.png' % image_name)
        self.pressed_image = imagepool.get_surface(pressed_path)

        disabled_path = resources.path('images/%s_disabled.png' % image_name)
        if os.path.exists(disabled_path):
            self.disabled_image = imagepool.get_surface(disabled_path)
        else:
            self.disabled_image = None
开发者ID:cool-RR,项目名称:Miro,代码行数:11,代码来源:imagebutton.py


示例10: get_thumbnail

 def get_thumbnail(self):
     if self.cover_art:
         return os.path.join(self.device.mount,
                             self.cover_art)
     elif self.screenshot:
         return os.path.join(self.device.mount,
                             self.screenshot)
     elif self.file_type == 'audio':
         return resources.path("images/thumb-default-audio.png")
     else:
         return resources.path("images/thumb-default-video.png")
开发者ID:kmshi,项目名称:miro,代码行数:11,代码来源:devices.py


示例11: init_info

 def init_info(self, info):
     if info is self.info:
         return
     if info.is_folder:
         info.icon = imagepool.get_surface(
             resources.path('images/icon-folder.png'))
     else:
         info.icon = imagepool.get_surface(
             resources.path('images/icon-playlist-small.png'))
         info.active_icon = imagepool.get_surface(
             resources.path('images/icon-playlist-small_active.png'))
     info.type = self.type
     info.unwatched = info.available = 0
开发者ID:pombredanne,项目名称:miro,代码行数:13,代码来源:tablist.py


示例12: test_stripper_data

    def test_stripper_data(self):
        stripper = util.HTMLStripper()

        testdir = resources.path(os.path.join("testdata", "stripperdata"))
        tests = [m for m in os.listdir(testdir) if m.endswith(".in")]

        for mem in tests:
            mem = os.path.join(testdir, mem)
            if not os.path.isfile(mem):
                continue

            f = open(mem, "r")
            input_ = f.read()
            f.close()

            input_ = input_.decode("utf-8")
            output = stripper.strip(input_)

            expected = os.path.splitext(mem)[0] + ".expected"
            if not os.path.isfile(expected):
                self.assertEquals(0, 1, "%s not found." % expected)
            else:
                f = open(expected, "r")
                data = f.read().strip()
                f.close()
                self.assertEquals(
                    repr(output), data, "output: %s" % repr(output))
开发者ID:CodeforEvolution,项目名称:miro,代码行数:27,代码来源:strippertest.py


示例13: __init__

    def __init__(self):
        widgetset.SolidBackground.__init__(self, itemlistwidgets.StandardView.BACKGROUND_COLOR)
        bg = widgetutil.RoundedSolidBackground(widgetutil.WHITE)
        vbox = widgetset.VBox()
        title = widgetset.HBox()
        logo = imagepool.get_image_display(resources.path("images/icon-search_large.png"))
        title.pack_start(widgetutil.align_middle(logo))
        label = widgetset.Label(self.TITLE)
        label.set_bold(True)
        label.set_size(widgetutil.font_scale_from_osx_points(30))
        title.pack_start(widgetutil.align_middle(label, left_pad=5))
        vbox.pack_start(widgetutil.align_center(title, bottom_pad=20))
        desc = widgetset.Label(self.DESC)
        vbox.pack_start(widgetutil.align_center(desc, bottom_pad=40))

        engine_width = int((desc.get_width() - 30) / 2)

        engine_widgets = self.build_engine_widgets()
        for widgets in engine_widgets[:-1]:  # widgets with borders
            hbox = widgetset.HBox(spacing=30)
            for widget in widgets:
                widget.set_size_request(engine_width, 45)
                hbox.pack_start(widget, expand=True)
            vbox.pack_start(hbox)

        hbox = widgetset.HBox(spacing=30)
        for widget in engine_widgets[-1]:  # has no border
            widget.set_has_border(False)
            widget.set_size_request(engine_width, 45)
            hbox.pack_start(widget, expand=True)

        vbox.pack_start(hbox)

        bg.add(widgetutil.pad(vbox, 45, 45, 45, 45))
        self.add(widgetutil.align(bg, xalign=0.5, top_pad=50))
开发者ID:kmshi,项目名称:miro,代码行数:35,代码来源:searchcontroller.py


示例14: test_shared_cover_art

    def test_shared_cover_art(self):
        # test what happens when 2 files with coverart share the same album.
        # In this case the first one we process should create the cover art
        # file and the next one should just skip cover art processing.
        src_path = resources.path(path.join('testdata', 'metadata',
                                            'drm.m4v'))
        dest_paths = []
        for x in range(3):
            new_filename = 'drm-%s.m4v' % x
            dest_path = path.join(self.tempdir, new_filename)
            shutil.copyfile(src_path, dest_path)
            dest_paths.append(dest_path)

        # process the first file
        result_1 = process_file(dest_paths[0], self.tempdir)
        self.assertEquals(result_1['cover_art'],
                          path.join(self.tempdir, result_1['album']))
        self.assert_(path.exists(result_1['cover_art']))
        org_mtime = stat(result_1['cover_art']).st_mtime

        # process the rest, they should fill in the cover_art value, but
        # not rewrite the file
        for dup_path in dest_paths[1:]:
            results = process_file(dup_path, self.tempdir)
            self.assertEquals(results['cover_art'],
                              result_1['cover_art'])
            self.assert_(path.exists(results['cover_art']))
            self.assertEquals(stat(results['cover_art']).st_mtime,
                              org_mtime)
开发者ID:CodeforEvolution,项目名称:miro,代码行数:29,代码来源:filetagstest.py


示例15: get_image_path

 def get_image_path(self):
     if self.feed_mode:
         feed_info = widgetutil.get_feed_info(self.info.feed_id)
         return feed_info.thumbnail
     else:
         # use placeholder image until the metadata changes happen
         return resources.path('images/album-art-placeholder.gif')
开发者ID:codito,项目名称:miro,代码行数:7,代码来源:style.py


示例16: send_feedparser_task

 def send_feedparser_task(self):
     # send feedparser successfully parsing a feed
     path = os.path.join(resources.path("testdata/feedparsertests/feeds"),
         "http___feeds_miroguide_com_miroguide_featured.xml")
     html = open(path).read()
     msg = workerprocess.FeedparserTask(html)
     workerprocess.send(msg, self.callback, self.errback)
开发者ID:ShriramK,项目名称:miro,代码行数:7,代码来源:subprocesstest.py


示例17: get

def get(descriptor):
    if descriptor == prefs.MOVIES_DIRECTORY:
        return os.path.join(MOVIES_DIRECTORY_PARENT, "Miro")

    elif descriptor == prefs.NON_VIDEO_DIRECTORY:
        return os.path.expanduser('~/Desktop')

    elif descriptor == prefs.GETTEXT_PATHNAME:
        return os.path.abspath(resources.path("../locale"))

    elif descriptor == prefs.RUN_AT_STARTUP:
        # On Mac, don't mark as run at startup by default.
        return False

    elif descriptor == prefs.SUPPORT_DIRECTORY:
        path = os.path.join(SUPPORT_DIRECTORY_PARENT, "Miro")
        os.environ['APPDATA'] = path # This is for the Bittorent module
        try:
            os.makedirs(path)
        except:
            pass
        return path

    elif descriptor == prefs.ICON_CACHE_DIRECTORY:
        return _makeSupportFilePath('icon-cache')

    elif descriptor == prefs.COVER_ART_DIRECTORY:
        return _makeSupportFilePath('cover-art')
    
    elif descriptor == prefs.SQLITE_PATHNAME:
        return _makeSupportFilePath('sqlitedb')

    elif descriptor == prefs.CRASH_PATHNAME:
        return _makeSupportFilePath('crashes')

    elif descriptor == prefs.LOG_PATHNAME:
        return _makeSupportFilePath('dtv-log')

    elif descriptor == prefs.DOWNLOADER_LOG_PATHNAME:
        return _makeSupportFilePath('dtv-downloader-log')

    elif descriptor == prefs.HTTP_PROXY_ACTIVE:
        return _getProxyInfo('HTTPEnable', 0) == 1
        
    elif descriptor == prefs.HTTP_PROXY_HOST:
        return _getProxyInfo('HTTPProxy')
        
    elif descriptor == prefs.HTTP_PROXY_PORT:
        return _getProxyInfo('HTTPPort', 0)
        
    elif descriptor == prefs.HTTP_PROXY_IGNORE_HOSTS:
        return _getProxyInfo('ExceptionsList', list())
    
    elif descriptor == prefs.HTTP_PROXY_AUTHORIZATION_USERNAME:
        return _getProxyAuthInfo('username')
    
    elif descriptor == prefs.HTTP_PROXY_AUTHORIZATION_PASSWORD:
        return _getProxyAuthInfo('password')
    
    return descriptor.default
开发者ID:codito,项目名称:miro,代码行数:60,代码来源:config.py


示例18: _makeSearchIcon

def _makeSearchIcon(engine):
    popupRectangle = NSImage.imageNamed_(u'search_popup_triangle')
    popupRectangleSize = popupRectangle.size()

    engineIconPath = resources.path('images/search_icon_%s.png' % engine.name)
    if not os.path.exists(engineIconPath):
        return nil
    engineIcon = NSImage.alloc().initByReferencingFile_(
      filename_to_unicode(engineIconPath))
    engineIconSize = engineIcon.size()

    searchIconSize = (engineIconSize.width + popupRectangleSize.width + 2, engineIconSize.height)
    searchIcon = NSImage.alloc().initWithSize_(searchIconSize)
    
    searchIcon.lockFocus()
    try:
        engineIcon.drawAtPoint_fromRect_operation_fraction_(
          (0,0), NSZeroRect, NSCompositeSourceOver, 1.0)
        popupRectangleX = engineIconSize.width + 2
        popupRectangleY = (engineIconSize.height - popupRectangleSize.height) / 2
        popupRectangle.drawAtPoint_fromRect_operation_fraction_(
          (popupRectangleX, popupRectangleY), NSZeroRect,
          NSCompositeSourceOver, 1.0)
    finally:
        searchIcon.unlockFocus()

    return searchIcon
开发者ID:CodeforEvolution,项目名称:miro,代码行数:27,代码来源:control.py


示例19: awakeFromNib

    def awakeFromNib(self):
        image_path = resources.path('images/subtitles_down.png')
        self.subtitlesButton.setImage_(NSImage.alloc().initWithContentsOfFile_(image_path))
        self.subtitlesLabel.setTitleWithMnemonic_(_("Subtitles"))
        self.fsLabel.setTitleWithMnemonic_(_("Fullscreen"))
        self.shareButton.setImage_(getOverlayButtonImage(self.shareButton.bounds().size))
        self.shareButton.setAlternateImage_(getOverlayButtonAlternateImage(self.shareButton.bounds().size))
        self.shareButton.setTitle_(_("Share"))

        self.keepButton.setImage_(getOverlayButtonImage(self.keepButton.bounds().size))
        self.keepButton.setAlternateImage_(getOverlayButtonAlternateImage(self.keepButton.bounds().size))
        self.keepButton.setTitle_(_("Keep"))

        self.deleteButton.setImage_(getOverlayButtonImage(self.deleteButton.bounds().size))
        self.deleteButton.setAlternateImage_(getOverlayButtonAlternateImage(self.deleteButton.bounds().size))
        self.deleteButton.setTitle_(_("Delete"))

        self.seekForwardButton.setCell_(SkipSeekButtonCell.cellFromButtonCell_direction_delay_(self.seekForwardButton.cell(), 1, 0.0))
        self.seekForwardButton.cell().setAllowsSkipping(False)
        self.seekBackwardButton.setCell_(SkipSeekButtonCell.cellFromButtonCell_direction_delay_(self.seekBackwardButton.cell(), -1, 0.0))
        self.seekBackwardButton.cell().setAllowsSkipping(False)

        self.progressSlider.cursor = NSImage.imageNamed_(u'fs-progress-slider')
        self.progressSlider.sliderWasClicked = self.progressSliderWasClicked
        self.progressSlider.sliderWasDragged = self.progressSliderWasDragged
        self.progressSlider.sliderWasReleased = self.progressSliderWasReleased
        self.progressSlider.setShowCursor_(True)

        self.volumeSlider.cursor = NSImage.imageNamed_(u'fs-volume-slider')
        self.volumeSlider.sliderWasClicked = self.volumeSliderWasClicked
        self.volumeSlider.sliderWasDragged = self.volumeSliderWasDragged
        self.volumeSlider.sliderWasReleased = self.volumeSliderWasReleased
        self.volumeSlider.setShowCursor_(True)
开发者ID:codito,项目名称:miro,代码行数:33,代码来源:overlay.py


示例20: __init__

    def __init__(self, theme=None):
        self.theme_vars = {}

        app_config_path = resources.path('app.config')
        self.default_vars = buildutils.read_simple_config_file(app_config_path)

        self.load_theme(theme)
开发者ID:CodeforEvolution,项目名称:miro,代码行数:7,代码来源:appconfig.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python utils.filename_to_unicode函数代码示例发布时间:2022-05-27
下一篇:
Python resources.app_root函数代码示例发布时间: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