Elo,
here is a plugin in its MOST simple form (yes, i've been looking at imdb.py:)
No fancy looking, just doing what I want:
Press a button in the menu and you will get the imdb information for the movie you
planned to watch.
(Independant of selected skin)
I planned to make it visually better, but hey, since it gives the information and my
knowledge of the gui-stuff
in freevo is lacking, I'll leave that to the pro's.
Put the file in src/video/plugins/
and add following to bind it to button 2 (then press escape to remove the
info-popupbox)
# ======================================================================
# Movieinfo plugin:
# ======================================================================
plugin.activate('video.info')
EVENTS['menu']['2'] = Event(MENU_CALL_ITEM_ACTION, arg='info_show')
Works for me :)
// Bj�rn# -----------------------------------------------------------------------
# info.py - Plugin for displaying movieinfo
# -----------------------------------------------------------------------
#
# Notes: Info plugin.
# You can show IMDB informations for video items with this plugin.
# Activate with: plugin.activate('video.info')
# You can also bind it to a key (in this case key 2):
# EVENTS['menu']['2'] = Event(MENU_CALL_ITEM_ACTION, arg='info_show')
#
# Todo: - Scaling and nice graphics
#
# -----------------------------------------------------------------------
import os
import menu
import config
import plugin
import re
import time
from video import xml_parser
from gui.PopupBox import PopupBox
class PluginInterface(plugin.ItemPlugin):
def actions(self, item):
self.item = item
if item.type == 'video' and item.info:
if item.mode == 'file':
return [ ( self.info_showdata, 'Show info for this file',
'info_show') ]
return []
def info_showdata(self, arg=None, menuw=None):
"""
show info for this item
"""
file = self.item.xml_file
infolist = xml_parser.save_parseMovieFile(file, os.path.dirname(file),[])
for info in infolist:
box = PopupBox(width=550, height=400, text=' %s\n \n %s\n \n Year: %s\n
Genre: %s\n Rating: %s\n Runtime: %s' %
(info.name,info.info['plot'],info.info['year'],info.info['genre'],info.info['rating'],info.info['runtime']))
box.show()
# time.sleep(3)
# box.destroy()