2010-05-23, 13:43
Pages: 1 2
2010-05-23, 17:17
the script start from startup.xml works good now, thanks.
2010-05-23, 17:38
Hey, Nuka1195 why do you already start those scripts in startup.xml ?
Does it speed up loading home.xml ?
I run a animated image in MM Waffa! startup and would be nice if those scripts start while you see the animation and have them ready in homescreen so it would take less time to load Home.xml.
Recently added is always the last that pops up and takes some time (extra).
Does it speed up loading home.xml ?
I run a animated image in MM Waffa! startup and would be nice if those scripts start while you see the animation and have them ready in homescreen so it would take less time to load Home.xml.
Recently added is always the last that pops up and takes some time (extra).
2010-05-23, 18:22
OT:
i run it from there to start because i don't like running it everytime i enter home.
advantages:
it only runs every half an hour and doesn't run everytime you enter home.
disadvantages:
if you watch a movie then it may still appear in your recently added until the script is scheduled to run. plus if you update database it won't update until the script is run.
the update can be handled by running the script after a scan, from the scanning dialog. i think ronnie or someone came up with that.
not sure what the best way to do it, other than a new feature to xbmc, that can run commands based on an event.
i run it from there to start because i don't like running it everytime i enter home.
advantages:
it only runs every half an hour and doesn't run everytime you enter home.
disadvantages:
if you watch a movie then it may still appear in your recently added until the script is scheduled to run. plus if you update database it won't update until the script is run.
the update can be handled by running the script after a scan, from the scanning dialog. i think ronnie or someone came up with that.
not sure what the best way to do it, other than a new feature to xbmc, that can run commands based on an event.
2010-05-23, 18:38
TY !
Going to play with it
Going to play with it
2010-05-23, 20:39
elupus Wrote:Yup
Thank you, superb.
Havn't tried it yet, running XBMCLive. Is there a way to upgrade the Live installation to the newest build?
2010-05-24, 19:48
Would this work? I looked at some examples of an asyncore server. The actual code works but I can't try the xbmc.abortRequested boolean, because I'm on the wrong XBMC version.
I'm not a programmer so bare with me.
Tips on the code is welcome.
I'm not a programmer so bare with me.
Tips on the code is welcome.
PHP Code:
import socket, threading, thread, sys, asyncore, xbmc, xbmcgui
from time import *
from string import *
TIMEOUT = 15
PORT = 10629
class showCaller(xbmcgui.WindowDialog):
def __init__(self):
w = self.getWidth()
h = self.getHeight()
self.addControl(xbmcgui.ControlImage(w - 490, h - 240, 420, 170, 'special://home/scripts/CallerID/frame.png'))
self.addControl(xbmcgui.ControlLabel(w - 475, h - 229, 380, 20, 'Nummerpresentation', 'font13', '0xffffffff'))
self.addControl(xbmcgui.ControlLabel(w - 470, h - 173, 302, 128, data, 'font14', '0xff000000'))
self.a = -1
self.shown = 1
subThread = threading.Thread(target=self.SubthreadProc, args=())
subThread.start()
def SubthreadProc(self):
sleep(TIMEOUT)
if self.shown:
self.close()
def onAction(self, action):
if self.a == action:
self.shown = 0
self.close()
self.a = action
class Server(asyncore.dispatcher):
def __init__(self, host, port):
asyncore.dispatcher.__init__(self)
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.bind((host, port))
self.listen(1)
def handle_accept(self):
socket, address = self.accept()
ConnectionHandler(socket)
def handle_close(self):
self.close()
class ConnectionHandler(asyncore.dispatcher_with_send):
def handle_read(self):
self.buffer = self.recv(1024)
self.buffer = split(self.buffer[5:], "~")
self.close()
global data
if len(self.buffer) > 1:
name = self.buffer[0]
number = self.buffer[1]
data = number + "\n" + name
w = showCaller()
w.doModal()
del w
else:
data = self.buffer
s = Server('', PORT)
try:
asyncore.loop(timeout=2)
except xbmc.abortRequested == true:
s.close()
sys.exit()
2010-05-24, 20:15
Hmm.. Sort of doubt it. We don't actually throw an exception. We only set that variable to true.
You should probably do.
That way the abortRequested function is checked once every second.
You should probably do.
PHP Code:
while not xbmc.abortRequested:
asynccore.loop(timeout=1)
s.close()
sys.exit()
That way the abortRequested function is checked once every second.
2010-05-24, 20:18
Like this?
All I get is "'module' object has no attribute 'abortRequested'", probably because I'm not on the right version?
PHP Code:
import socket, threading, thread, sys, asyncore, xbmc, xbmcgui
from time import *
from string import *
TIMEOUT = 15
PORT = 10629
class showCaller(xbmcgui.WindowDialog):
def __init__(self):
w = self.getWidth()
h = self.getHeight()
self.addControl(xbmcgui.ControlImage(w - 490, h - 240, 420, 170, 'special://home/scripts/CallerID/frame.png'))
self.addControl(xbmcgui.ControlLabel(w - 475, h - 229, 380, 20, 'Nummerpresentation', 'font13', '0xffffffff'))
self.addControl(xbmcgui.ControlLabel(w - 470, h - 173, 302, 128, data, 'font14', '0xff000000'))
self.a = -1
self.shown = 1
subThread = threading.Thread(target=self.SubthreadProc, args=())
subThread.start()
def SubthreadProc(self):
sleep(TIMEOUT)
if self.shown:
self.close()
def onAction(self, action):
if self.a == action:
self.shown = 0
self.close()
self.a = action
class Server(asyncore.dispatcher):
def __init__(self, host, port):
asyncore.dispatcher.__init__(self)
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.bind((host, port))
self.listen(1)
def handle_accept(self):
socket, address = self.accept()
ConnectionHandler(socket)
def handle_close(self):
self.close()
class ConnectionHandler(asyncore.dispatcher_with_send):
def handle_read(self):
self.buffer = self.recv(1024)
self.buffer = split(self.buffer[5:], "~")
self.close()
global data
if len(self.buffer) > 1:
name = self.buffer[0]
number = self.buffer[1]
data = number + "\n" + name
w = showCaller()
w.doModal()
del w
else:
data = self.buffer
s = Server('', PORT)
while not xbmc.abortRequested:
asyncore.loop(timeout=1)
s.close()
sys.exit()
All I get is "'module' object has no attribute 'abortRequested'", probably because I'm not on the right version?
2010-05-24, 22:22
OT: sorry
elupus since your in those files would you consider this patch
http://trac.xbmc.org/ticket/9290
or a variant to fix the issue described in the ticket or
http://forum.xbmc.org/showthread.php?tid=70349&highlight=python
elupus since your in those files would you consider this patch
http://trac.xbmc.org/ticket/9290
or a variant to fix the issue described in the ticket or
http://forum.xbmc.org/showthread.php?tid=70349&highlight=python
2010-05-24, 22:25
dennis print xbmc.abortRequested works for me.
Pages: 1 2