コード例 #1
0
from resources.lib.kodi_utils import HomeWindow
from resources.lib.widgets import checkForNewContent, set_background_image, set_random_movies
from resources.lib.websocket_client import WebSocketClient
from resources.lib.menu_functions import set_library_window_values
from resources.lib.context_monitor import ContextMonitor
from resources.lib.server_detect import checkServer

settings = xbmcaddon.Addon()

# clear user and token when logging in
home_window = HomeWindow()
home_window.clearProperty("userid")
home_window.clearProperty("AccessToken")
home_window.clearProperty("Params")

log = SimpleLogging('service')
monitor = xbmc.Monitor()

# wait for 10 seconds for the Kodi splash screen to close
i = 0
while not monitor.abortRequested():
    if i == 100 or not xbmc.getCondVisibility("Window.IsVisible(startup)"):
        break
    i += 1
    xbmc.sleep(100)

checkServer()

download_utils = DownloadUtils()

# auth the service
コード例 #2
0
ファイル: service.py プロジェクト: Lunatixz/repo-plugins
from resources.lib.downloadutils import DownloadUtils
from resources.lib.simple_logging import SimpleLogging
from resources.lib.play_utils import Service, PlaybackService, sendProgress
from resources.lib.kodi_utils import HomeWindow
from resources.lib.widgets import checkForNewContent, set_background_image
from resources.lib.websocket_client import WebSocketClient
from resources.lib.menu_functions import set_library_window_values

# clear user and token when logging in
home_window = HomeWindow()
home_window.clearProperty("userid")
home_window.clearProperty("AccessToken")
home_window.clearProperty("Params")

log = SimpleLogging('service')
download_utils = DownloadUtils()

# auth the service
try:
    download_utils.authenticate()
    download_utils.getUserId()
except Exception as error:
    log.error("Error with initial service auth: {0}", error)

# set up all the services
monitor = Service()
playback_service = PlaybackService(monitor)

home_window = HomeWindow()
last_progress_update = time.time()
コード例 #3
0
import xbmc
import xbmcgui
import xbmcplugin

import sys
import json

from resources.lib.simple_logging import SimpleLogging

log = SimpleLogging(__name__)


class HomeWindow():
    """
        xbmcgui.Window(10000) with add-on id prefixed to keys
    """
    def __init__(self):
        self.id_string = 'script.viewmaster-%s'
        self.window = xbmcgui.Window(10000)

    def getProperty(self, key):
        key = self.id_string % key
        value = self.window.getProperty(key)
        # log.debug('HomeWindow: getProperty |%s| -> |%s|' % (key, value))
        return value

    def setProperty(self, key, value):
        key = self.id_string % key
        # log.debug('HomeWindow: setProperty |%s| -> |%s|' % (key, value))
        self.window.setProperty(key, value)
コード例 #4
0
# -*- coding: utf-8 -*-

#################################################################################################

import logging
import os
import sys

import xbmc
import xbmcaddon

from resources.lib.functions import show_menu
from resources.lib.simple_logging import SimpleLogging

log = SimpleLogging('contextmenu')

item_id = sys.listitem.getProperty("id")
log.debug("Context Menu Item ID: {0}", item_id)

params = {}
params["item_id"] = item_id
show_menu(params)
コード例 #5
0
ファイル: default.py プロジェクト: ysard/plugin.video.embycon
# Gnu General Public License - see LICENSE.TXT

from resources.lib.simple_logging import SimpleLogging
from resources.lib.functions import mainEntryPoint

log = SimpleLogging('default')

log.debug("About to enter mainEntryPoint()")

mainEntryPoint()

# clear done and exit.
# sys.modules.clear()
コード例 #6
0
ファイル: contextmenu.py プロジェクト: Lunatixz/repo-plugins
# -*- coding: utf-8 -*-

#################################################################################################

import logging
import os
import sys

import xbmc
import xbmcaddon

from resources.lib.functions import showMenu
from resources.lib.simple_logging import SimpleLogging

log = SimpleLogging('contextmenu')

item_id = sys.listitem.getProperty("id")
log.debug("Context Menu Item ID: {0}", item_id)

params = {}
params["item_id"] = item_id
showMenu(params)