本文整理汇总了Python中miro.plat.resources.path函数的典型用法代码示例。如果您正苦于以下问题:Python path函数的具体用法?Python path怎么用?Python path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
示例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)
示例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)
示例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)
示例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'))
示例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)
示例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)
示例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)
示例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
示例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")
示例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
示例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))
示例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))
示例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)
示例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')