try: from Plugins.Extensions.LastFM.plugin import main as StartFunction gAvailable = True except: printl("lastFM not found", "I") gAvailable = False def settings(): s = [] if gAvailable is True: s.append(( _("Show"), config.plugins.pvmc.plugins.lastfm.show, )) return s if gAvailable is True: p = [] p.append( Plugin(id="lastfm", name=_("LastFM"), fnc=settings, where=Plugin.SETTINGS)) p.append( Plugin(id="lastfm", name=_("LastFM"), fnc=StartFunction, where=Plugin.MENU_MUSIC)) registerPlugin(p)
try: from Plugins.Extensions.Foreca.plugin import main as StartFunction gAvailable = True except: printl("Foreca not found", "E") gAvailable = False def settings(): s = [] if gAvailable is True: s.append(( _("Show"), config.plugins.pvmc.plugins.foreca.show, )) return s if gAvailable is True: p = [] p.append( Plugin(id="foreca", name=_("Foreca"), fnc=settings, where=Plugin.SETTINGS)) p.append( Plugin(id="foreca", name=_("Foreca"), fnc=StartFunction, where=Plugin.MENU_WEATHER)) registerPlugin(p)
playbackList.append(( episodeDict["Path"], episodeDict["Title"], episodeDict, )) nextEpisode += 1 found = True break return playbackList def buildInfoPlaybackArgs(self, entry): args = {} args["id"] = entry["Id"] args["title"] = entry["Title"] args["year"] = entry["Year"] args["thetvdb"] = entry["TheTvDbId"] args["season"] = entry["Season"] args["episode"] = entry["Episode"] args["type"] = "tvshow" return args if gAvailable is True: registerPlugin( Plugin(id="tvshows", name=_("TV Shows"), start=DMC_TvShowLibrary, where=Plugin.MENU_VIDEOS, weight=4))
if d.has_key("progress"): progress = d["progress"] if d.has_key("status"): status = d["status"] if d.has_key("id"): id = d["id"] if status == "stopped": if progress >= 70: setSeen(id, True) if gAvailable is True: registerPlugin( Plugin(id="seen", name=_("Seen"), fnc=autostart, where=Plugin.AUTOSTART)) registerPlugin( Plugin(id="seen", name=_("Seen"), fnc=info_playback, where=Plugin.INFO_PLAYBACK)) #registerPlugin(Plugin(name=_("Seen"), fnc=is_Seen, where=Plugin.INFO_SEEN)) registerPlugin( Plugin(id="seen", name=_("Mark as Seen"), fnc=markSeen, where=Plugin.MENU_MOVIES_PLUGINS)) registerPlugin( Plugin(id="unseen", name=_("Mark as Unseen"),
reactor.listenTCP(port, site, interface="0.0.0.0") except Exception, ex: printl("Exception(Can be ignored): " + str(ex), __name__, "W") def settings(): s = [] s.append(( _("Port"), config.plugins.pvmc.plugins.webinterface.port, )) #s.append((_("Use Pagination"), config.plugins.pvmc.plugins.webinterface.usepagination, )) s.append(( _("Entry"), config.plugins.pvmc.plugins.webinterface.entrycount, )) return s if gAvailable is True: registerPlugin( Plugin(id="webif", name=_("WebInterface"), fnc=settings, where=Plugin.SETTINGS)) registerPlugin( Plugin(id="webif", name=_("WebInterface"), fnc=autostart, where=Plugin.AUTOSTART_E2))
planedTimestamp += 60*60*24 printl("currentTime: " + str(localtime(currentTimestamp)), "DMC_AutoSync::getPlanedTime", "I") printl("planedTime: " + str(localtime(planedTimestamp)), "DMC_AutoSync::getPlanedTime", "I") return (currentTimestamp, planedTimestamp, ) def callback(): printl("->", "DMC_AutoSync::callback", "I") global gSession from Plugins.Extensions.ProjectValerie.DMC_Global import PowerManagement PowerManagement(gSession).standby() def wakeup(): if config.plugins.pvmc.plugins.autosync.onstart.value == False: return -1 return getPlanedTime()[1] def settings(): s = [] s.append((_("Autosync Database on start"), config.plugins.pvmc.plugins.autosync.onstart, )) s.append((_("Autosync time"), config.plugins.pvmc.plugins.autosync.time, )) return s if gAvailable is True: registerPlugin(Plugin(id="autosync", name=_("AutoSync"), fnc=settings, where=Plugin.SETTINGS)) from Plugins.Extensions.ProjectValerie.DMC_Plugins.DMC_SyncExtras.plugin import ProjectValerieSync registerPlugin(Plugin(id="autosync", name=_("AutoSync"), fnc=autostart, where=Plugin.AUTOSTART_DELAYED, weight=10000)) registerPlugin(Plugin(id="autosync", name=_("AutoSync"), fnc=wakeup, where=Plugin.WAKEUP))
self.skinName = "MediaPlayer" def settings(): s = [] if gAvailable is True: s.append(( _("Show"), config.plugins.pvmc.plugins.mediaplayer.show, )) return s if gAvailable is True: p = [] p.append( Plugin(id="mediaplyer", name=_("MediaPlayer"), fnc=settings, where=Plugin.SETTINGS)) p.append( Plugin(id="mediaplyer", name=_("MediaPlayer"), start=PVMC_MediaPlayer, where=Plugin.MENU_VIDEOS)) p.append( Plugin(id="mediaplyer", name=_("MediaPlayer"), start=PVMC_MediaPlayer, where=Plugin.MENU_MUSIC)) registerPlugin(p)
#skin = "<screen ...." def __init__(self, session): MultiMediathek.__init__(self, session) # If no own screen os provided, use the one of the plugin self.skinName = "MultiMediathek" def settings(): s = [] if gAvailable is True: s.append(( _("Show"), config.plugins.pvmc.plugins.multimediathek.show, )) return s if gAvailable is True: p = [] p.append( Plugin(id="multimediathek", name=_("MultiMediathek"), fnc=settings, where=Plugin.SETTINGS)) p.append( Plugin(id="multimediathek", name=_("MultiMediathek"), start=PVMC_MultiMediathek, where=Plugin.MENU_VIDEOS)) registerPlugin(p)
# self.skinName = "PVMC_PicturePlayerThumbView" # self.onLayoutFinish.append(self.setCustomTitle) # # def setCustomTitle(self): # self.setTitle(_("PicturePlayer ThumbView")) def settings(): s = [] if gAvailable is True: s.append(( _("Show"), config.plugins.pvmc.plugins.pictureplayer.show, )) return s if gAvailable is True: p = [] p.append( Plugin(id="pictureplayer", name=_("PicturePlayer"), fnc=settings, where=Plugin.SETTINGS)) p.append( Plugin(id="pictureplayer", name=_("PicturePlayer"), start=PVMC_PicturePlayer, where=Plugin.MENU_PICTURES)) registerPlugin(p)
if config.plugins.pvmc.plugins.trakt.enabled.value is True: gtrakt.setUsernameAndPassword( config.plugins.pvmc.plugins.trakt.username.value, config.plugins.pvmc.plugins.trakt.password.value) if gtrakt.getStatus() == TraktAPI.STATUS_WATCHED: if gtrakt.getProgress() >= 70: gtrakt.send() else: gtrakt.setStatus(TraktAPI.STATUS_CANCELED) gtrakt.send() else: gtrakt.send() if gAvailable is True: registerPlugin( Plugin(id="trakt", name=_("trakt.tv"), fnc=settings, where=Plugin.SETTINGS)) registerPlugin( Plugin(id="trakt", name=_("trakt.tv"), fnc=autostart, where=Plugin.AUTOSTART)) registerPlugin( Plugin(id="trakt", name=_("trakt.tv"), fnc=info_playback, where=Plugin.INFO_PLAYBACK))
def __init__(self, session): DVDPlayer.__init__(self, session) # If no own screen os provided, use the one of the plugin self.skinName = "DVDPlayer" def settings(): s = [] if gAvailable is True: s.append(( _("Show"), config.plugins.pvmc.plugins.dvdplayer.show, )) return s if gAvailable is True: p = [] p.append( Plugin(id="dvdplayer", name=_("DVDPlayer"), fnc=settings, where=Plugin.SETTINGS)) p.append( Plugin(id="dvdplayer", name=_("DVDPlayer"), start=PVMC_DVDPlayer, where=Plugin.MENU_VIDEOS)) registerPlugin(p)
def buildInfoPlaybackArgs(self, entry): args = {} args["title"] = entry["Title"] return args def settings(): s = [] s.append(( _("Show"), config.plugins.pvmc.plugins.jamendo.show, )) return s if gAvailable is True: p = [] p.append( Plugin(id="jamendo", name=_("Jamendo"), fnc=settings, where=Plugin.SETTINGS)) p.append( Plugin(id="jamendo", name=_("Jamendo"), start=DMC_JamendoLibrary, where=Plugin.MENU_MUSIC)) #p.append(Plugin(id="jamendo", name=_("Jamendo"), start=DMC_JamendoLibrary, where=Plugin.MENU_DEV)) registerPlugin(p)
def startPlugin(session): if isInetAvailable(): from Plugins.Extensions.ProjectValerie.DMC_Plugins.DMC_SyncExtras.plugin import ProjectValerieSync session.open(ProjectValerieSync) else: from Screens.MessageBox import MessageBox session.open(MessageBox, _("No internet connection available!"), MessageBox.TYPE_INFO, timeout=10) registerPlugin( Plugin(id="sync", name=_("Synchronize"), fnc=settings, where=Plugin.SETTINGS)) registerPlugin( Plugin(id="sync", name=_("Synchronize"), fnc=startPlugin, where=Plugin.MENU_SYSTEM, supportStillPicture=True, weight=10)) if config.plugins.pvmc.plugins.sync.fastsynconautostart.value is True: registerPlugin( Plugin(id="sync", name=_("Synchronize"), fnc=autostartPlugin, where=Plugin.AUTOSTART))
args["type"] = "tvshow" return args def settings(): s = [] s.append(( _("Enabled"), config.plugins.pvmc.plugins.latestepisodes.enabled, )) s.append(( _("days back"), config.plugins.pvmc.plugins.latestepisodes.daysback, )) return s if gAvailable is True: registerPlugin( Plugin(id="newestepisodes", name=_("Newest Episodes"), fnc=settings, where=Plugin.SETTINGS)) if config.plugins.pvmc.plugins.latestepisodes.enabled.value: registerPlugin( Plugin(id="newestepisodes", name=_("Newest Episodes"), start=DMC_NewestEpisodes, where=Plugin.MENU_VIDEOS, weight=6))
gAvailable = False try: from Plugins.Extensions.Filebrowser.plugin import start_from_pluginmenu as StartFunction gAvailable = True except: printl("Filebrowser not found", "I") gAvailable = False def settings(): s = [] s.append(( _("Show"), config.plugins.pvmc.plugins.filebrowser.show, )) return s if gAvailable is True: p = [] p.append( Plugin(id="filebrowser", name=_("Filebrowser"), fnc=settings, where=Plugin.SETTINGS)) p.append( Plugin(id="filebrowser", name=_("Filebrowser"), fnc=StartFunction, where=Plugin.MENU_SYSTEM)) registerPlugin(p)
for zip_entry in files: if os.path.splitext( zip_entry )[1] in exts: subtitle_file, file_path = self.create_name(zip_entry,sub_filename,subtitle_lang) shutil.copy(subtitle_file, file_path) #subtitle_set,file_path = self.copy_files( subtitle_file, file_path ) try: shutil.rmtree(str(self.tmp_sub_dir)) except Exception, ex: printl("Exception: " + str(ex), __name__, "E") def create_name(self,zip_entry,sub_filename,subtitle_lang): sub_ext = os.path.splitext( zip_entry )[1] sub_name = os.path.splitext( sub_filename )[0] #Workaroudn the problem that default e2 can not parse movie.eng.srt #file_name = "%s.%s%s" % ( sub_name, subtitle_lang, sub_ext ) file_name = "%s%s" % ( sub_name, sub_ext ) file_path = os.path.join(self.sub_folder, file_name) subtitle_file = os.path.join(self.tmp_sub_dir, zip_entry) return subtitle_file, file_path gsubdown = None def autostart(session): global gsubdown if gAvailable is True: registerPlugin(Plugin(id="subdown", name=_("SubtitleDownloader"), fnc=settings, where=Plugin.SETTINGS)) #registerPlugin(Plugin(name=_("SubtitleDownloader"), fnc=autostart, where=Plugin.AUTOSTART)) registerPlugin(Plugin(id="subdown", name=_("Download subtitles"), start=DMC_SubtitleDownloader, where=Plugin.MENU_MOVIES_PLUGINS))
gmy.setType(-1) if d.has_key("progress"): gmy.setProgress(d["progress"]) if config.plugins.pvmc.plugins.myepisodes.enabled.value is True: gmy.setUsernameAndPassword( config.plugins.pvmc.plugins.myepisodes.username.value, config.plugins.pvmc.plugins.myepisodes.password.value) if gmy.getType() == MyEpisodesAPI.TYPE_TVSHOW: if d.has_key("status"): if d["status"] == "stopped": if gmy.getProgress() >= 70: gmy.send() if gAvailable is True: registerPlugin( Plugin(id="myepisodes", name=_("myepisodes"), fnc=settings, where=Plugin.SETTINGS)) registerPlugin( Plugin(id="myepisodes", name=_("myepisodes"), fnc=autostart, where=Plugin.AUTOSTART)) registerPlugin( Plugin(id="myepisodes", name=_("myepisodes"), fnc=info_playback, where=Plugin.INFO_PLAYBACK))
t = gettext.dgettext("ProjectValerie", txt) if t == txt: t = gettext.gettext(txt) return t localeInit() language.addCallback(localeInit) gAvailable = False try: from Plugins.Extensions.YTTrailer.plugin import YTTrailer gAvailable = True except Exception, ex: printl("YTTrailer not found", "I") gAvailable = False def start(session, args): if args.has_key("Title"): ytTrailer = YTTrailer(session) ytTrailer.showTrailer(args["Title"]) if gAvailable is True: registerPlugin( Plugin(id="yttrailer", name=_("YTTrailer"), desc=_("View Trailer (YTTrailer by Dr. Best)"), fnc=start, where=Plugin.MENU_MOVIES_PLUGINS))
def autostart(session): printl("autostart->") try: thread = InternetTime(session) thread.start() except Exception, ex: printl("Exception(Can be ignored): " + str(ex), __name__, "W") def settings(): s = [] s.append(( _("Sync time on start"), config.plugins.pvmc.plugins.internettime.autosync, )) return s if gAvailable is True: registerPlugin( Plugin(id="internettime", name=_("InternetTime"), fnc=settings, where=Plugin.SETTINGS)) registerPlugin( Plugin(id="internettime", name=_("InternetTime"), fnc=autostart, where=Plugin.AUTOSTART))
gAvailable = False try: from Plugins.Extensions.MerlinMusicPlayer.plugin import MerlinMusicPlayerFileList gAvailable = True except Exception, ex: printl("Merlin Music Player not found", "I") gAvailable = False MerlinMusicPlayerFileList = object class PVMC_MerlinMusicPlayer(MerlinMusicPlayerFileList): #If custom skin should be used, define it here or in the skin.xml file #skin = "<screen ...." def __init__(self, session): MerlinMusicPlayerFileList.__init__(self, session, None) # If no own screen os provided, use the one of the plugin self.skinName = "MerlinMusicPlayerFileList" def settings(): s = [] if gAvailable is True: s.append((_("Show"), config.plugins.pvmc.plugins.merlinmusicplayer.show, )) return s if gAvailable is True: p = [] p.append(Plugin(id="merlinmusicplayer", name=_("MerlinMusicPlayer"), fnc=settings, where=Plugin.SETTINGS)) p.append(Plugin(id="merlinmusicplayer", name=_("MerlinMusicPlayer"), start=PVMC_MerlinMusicPlayer, where=Plugin.MENU_MUSIC)) registerPlugin(p)
import sqlite3 return True except: pass return False def installSqlite(self): os.system("opkg update") os.system("opkg install python-sqlite3") def sqliteCheck(session): if config.plugins.pvmc.plugins.sqlitecheck.nextcheck.value == 0: config.plugins.pvmc.plugins.sqlitecheck.nextcheck.value = 100 config.plugins.pvmc.plugins.sqlitecheck.nextcheck.save() thread = SqliteCheck() thread.start() elif config.plugins.pvmc.plugins.sqlitecheck.nextcheck.value != -1: config.plugins.pvmc.plugins.sqlitecheck.nextcheck.value = config.plugins.pvmc.plugins.sqlitecheck.nextcheck.value - 1 config.plugins.pvmc.plugins.sqlitecheck.nextcheck.save() if gAvailable is True: p = [] p.append( Plugin(id="sqlitecheck", name=_("Sqlite Check"), fnc=sqliteCheck, where=Plugin.AUTOSTART)) registerPlugin(p)