Beispiel #1
0
def Prepare():
	try:
		log("",None,"__init__::Prepare()")
		getBoxInformation()
		#localeInit()
		registerSkinParamsInstance()
		loadEnigmalightSkin()
		registerEnigmalightFonts()
	except:
		from traceback import format_exc
		log("",None,"__init__::Prepare > ERROR: " +format_exc() )
		try:
			open(crashFile,"w").write(format_exc())
		except:
			pass
Beispiel #2
0
def Prepare():
	try:
		log("",None,"__init__::Prepare()")
		
		getBoxInformation()
		localeInit()
		registerSkinParamsInstance()
		loadEnigmalightSkin()
		registerEnigmalightFonts()
	except:
		from traceback import format_exc
		log("",None,"__init__::Prepare > ERROR: " +format_exc() )
		try:
			open(crashFile,"w").write(format_exc())
		except:
			pass
Beispiel #3
0
	def keyRed(self):
		printl("", self, "S")

		client = PlexGdm(debug=3)
		version = str(getVersion())
		gBoxType = getBoxInformation()
		clientBox = gBoxType[1]
		printl("clientBox: " + str(gBoxType), self, "D")
		client.clientDetails(clientBox, "DreamPlex Client", "3003", "DreamPlex", version)

		client.start_discovery()
		while not client.discovery_complete:
			print "Waiting for results"
			time.sleep(1)
		
		client.stop_discovery()
		serverList = client.getServerList()
		printl("serverList: " + str(serverList),self, "D")
		
		menu = []
		for server in serverList:
			printl("server: " + str(server), self, "D")
			menu.append((str(server.get("serverName")) + " (" + str(server.get("server")) + ":" + str(server.get("port")) + ")", server,))
			
		printl("menu: " + str(menu), self, "D")
		self.session.openWithCallback(self.useSelectedServerData, ChoiceBox, title=_("Select server"), list=menu)
		
		printl("", self, "C")
Beispiel #4
0
def initBoxInformation():
    printl("", "__init__::getBoxInformation", "S")

    boxInfo = getBoxInformation()
    printl("=== BOX INFORMATION ===", "__init__::getBoxInformation", "I")
    printl("Box: " + str(boxInfo), "__init__::getBoxInformation", "I")

    printl("", "__init__::getBoxInformation", "C")
Beispiel #5
0
def initBoxInformation():
	printl("", "__init__::getBoxInformation", "S")

	boxInfo = getBoxInformation()
	printl("=== BOX INFORMATION ===", "__init__::getBoxInformation", "I")
	printl("Box: " + str(boxInfo), "__init__::getBoxInformation", "I")

	printl("", "__init__::getBoxInformation", "C")
Beispiel #6
0
    def __init__(self):
        printl("", self, "S")

        self.boxInformation = getBoxInformation()

        try:
            self.load()
        except Exception, ex:
            printl("Exception(" + str(type(ex)) + "): " + str(ex), self, "E")
	def __init__(self):
		printl("", self , "S")

		self.boxInformation = getBoxInformation()

		try:
			self.load()
		except Exception, ex:
			printl("Exception(" + str(type(ex)) + "): " + str(ex), self, "E")
Beispiel #8
0
	def setClientDetails(self):
		printl("", self, "S")

		gBoxType = getBoxInformation()
		self.client_id = str(getUUID())

		self.client_data = "Content-Type: plex/media-player\n"
		self.client_data += "Resource-Identifier: %s\n" % self.client_id
		self.client_data += "Name: %s\n" % config.plugins.dreamplex.boxName.value
		self.client_data += "Port: %s\n" % config.plugins.dreamplex.remotePort.value
		self.client_data += "Product: %s\n" % gBoxType[1] + " (" + str(getMyIp()) +")"
		self.client_data += "Version: %s\n" % str(getVersion())
		self.client_data += "Protocol: plex\n"
		self.client_data += "Protocol-Version: 1\n"
		self.client_data += "Protocol-Capabilities: playback, navigation\n"
		self.client_data += "Device-Class: stb\n"

		printl("", self, "C")
Beispiel #9
0
    def setClientDetails(self):
        printl("", self, "S")

        gBoxType = getBoxInformation()
        self.client_id = str(getUUID())

        self.client_data = "Content-Type: plex/media-player\n"
        self.client_data += "Resource-Identifier: %s\n" % self.client_id
        self.client_data += "Name: %s\n" % config.plugins.dreamplex.boxName.value
        self.client_data += "Port: %s\n" % config.plugins.dreamplex.remotePort.value
        self.client_data += "Product: %s\n" % gBoxType[1] + " (" + str(
            getMyIp()) + ")"
        self.client_data += "Version: %s\n" % str(getVersion())
        self.client_data += "Protocol: plex\n"
        self.client_data += "Protocol-Version: 1\n"
        self.client_data += "Protocol-Capabilities: playback, navigation\n"
        self.client_data += "Device-Class: stb\n"

        printl("", self, "C")
Beispiel #10
0
	def startDeamon(self):
		printl("", self, "S")

		t = Thread(target=runHttp)
		t.start()

		client = PlexGdm(debug=3)
		version = str(getVersion())
		gBoxType = getBoxInformation()
		clientBox = "8000"
		printl("clientBox: " + str(gBoxType), self, "D")
		client.clientDetails(clientBox, "192.168.45.80", "8000", "DreamPlex", version)
		client.start_registration()

		if client.check_client_registration():
			printl("Successfully registered", self, "D")
		else:
			printl("Unsuccessfully registered", self, "D")

		printl("", self, "C")
Beispiel #11
0
    def startDeamon(self):
        printl("", self, "S")

        t = Thread(target=runHttp)
        t.start()

        client = PlexGdm(debug=3)
        version = str(getVersion())
        gBoxType = getBoxInformation()
        clientBox = "8000"
        printl("clientBox: " + str(gBoxType), self, "D")
        client.clientDetails(clientBox, "192.168.45.80", "8000", "DreamPlex", version)
        client.start_registration()

        if client.check_client_registration():
            printl("Successfully registered", self, "D")
        else:
            printl("Unsuccessfully registered", self, "D")

        printl("", self, "C")
Beispiel #12
0
    def keyRed(self):
        printl("", self, "S")

        client = PlexGdm(debug=3)
        version = str(getVersion())
        gBoxType = getBoxInformation()
        clientBox = gBoxType[1]
        printl("clientBox: " + str(gBoxType), self, "D")
        client.clientDetails(clientBox, "DreamPlex Client", "3003",
                             "DreamPlex", version)

        client.start_discovery()
        while not client.discovery_complete:
            print "Waiting for results"
            time.sleep(1)

        client.stop_discovery()
        serverList = client.getServerList()
        printl("serverList: " + str(serverList), self, "D")

        menu = []
        for server in serverList:
            printl("server: " + str(server), self, "D")
            menu.append((
                str(server.get("serverName")) + " (" +
                str(server.get("server")) + ":" + str(server.get("port")) +
                ")",
                server,
            ))

        printl("menu: " + str(menu), self, "D")
        self.session.openWithCallback(self.useSelectedServerData,
                                      ChoiceBox,
                                      title=_("Select server"),
                                      list=menu)

        printl("", self, "C")