[RELEASE] - The Scheduler

  Thread Rating:
  • 2 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
giftie Offline
Skilled Python Coder
Posts: 2,364
Joined: Mar 2010
Reputation: 55
Location: Calgary, Alberta
Post: #76
Latest version available.. -> https://www.dropbox.com/s/19jarh5fnkg29o...-1.0.1.zip

[Image: e4f63e45ba34fe4695b3bb08eb2499d8e4ee484e...4c076g.jpg]
For troubleshooting and bug reporting please make sure you read this first you can also use XBMC Log Uploader Script.
Cinema Experience
Cinema Experience Wiki
cdART Manager
fanart.tv


find quote
Lunatixz Offline
Skilled Python Coder
Posts: 3,456
Joined: May 2011
Reputation: 73
Location: New York
Post: #77
Thanks
find quote
thos Offline
Member
Posts: 84
Joined: Dec 2011
Reputation: 1
Post: #78
I'm confused with this ....

I want to run plugin.video.mms on a scheduled basis ...

So do I need:
RunScript(/home/thos/.xbmc/addons/plugin.video.mms/default.py)
or
RunScript(plugin.video.mms)


Here's the snip from my settings file
<setting id="custom1" value="true" />
<setting id="custom1_cycle" value="1" />
<setting id="custom1_day" value="0" />
<setting id="custom1_disable_music" value="false" />
<setting id="custom1_disable_video" value="false" />
<setting id="custom1_interval" value="1" />
<setting id="custom1_script" value="RunScript(plugin.video.mms)" />
<setting id="custom1_time" value="19:45" />


19:22:27 T:140519424935680 DEBUG: Process - Entering source directory /home/thos/.xbmc/addons/service.scheduler
19:22:27 T:140519424935680 DEBUG: Instantiating addon using automatically obtained id of "service.scheduler" dependent on version 2.1.0 of the xbmc.python api
19:22:27 T:140519424935680 NOTICE: [service.scheduler] - Loading Setting
19:22:27 T:140519424935680 DEBUG: [service.scheduler] - Setting Settings Load Interval: 86400 seconds
19:22:27 T:140519424935680 DEBUG: [service.scheduler] - cdart_manager_running: False
19:22:27 T:140519424935680 DEBUG: [service.scheduler] - cdart_manager_update: False
19:22:27 T:140519424935680 DEBUG: [service.scheduler] - Current Day: Wednesday
19:22:27 T:140519424935680 DEBUG: [service.scheduler] - Current Time: 19:22
19:22:27 T:140519424935680 DEBUG: [service.scheduler] - Adjusting Testing time
19:22:27 T:140519424935680 DEBUG: [service.scheduler] - Current Value: 19:45
19:22:27 T:140519424935680 DEBUG: [service.scheduler] - Current Interval: 16
19:22:27 T:140519424935680 DEBUG: [service.scheduler] - Test time: 20:01
19:22:27 T:140519424935680 DEBUG: [service.scheduler] - Setting Sleep Interval: 900 seconds


I'm NOTseeing the log entries like others are:
417 20:12:36 T:7964 NOTICE: [service.scheduler] - Starting Custom 1 Hourly Schedule, every 8 Hours
find quote
BootsC5 Offline
Junior Member
Posts: 7
Joined: May 2013
Reputation: 0
Post: #79
I'm getting this error on startup. Running Gotham, fresh install, running 1.0.1. Any ideas?

11:10:40 T:14400 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.NameError'>
Error Contents: global name 'hour_multiplier' is not defined
Traceback (most recent call last):
File "C:\Users\Boots\AppData\Roaming\XBMC\addons\service.scheduler\default.py", line 850, in <module>
script.start()
File "C:\Users\Boots\AppData\Roaming\XBMC\addons\service.scheduler\default.py", line 844, in start
self.schedule_check()
File "C:\Users\Boots\AppData\Roaming\XBMC\addons\service.scheduler\default.py", line 573, in schedule_check
self.custom1_timer = Timer( self.custom1[ "interval" ] * hour_multiplier, self.trigger_builtin, [ self.custom1[ "script" ], "custom1" ] )
NameError: global name 'hour_multiplier' is not defined
-->End of Python script error report<--
find quote
Frozin Offline
Senior Member
Posts: 253
Joined: Aug 2012
Reputation: 3
Post: #80
I'm getting the same error Sad

(2014-06-01 17:14)BootsC5 Wrote:  I'm getting this error on startup. Running Gotham, fresh install, running 1.0.1. Any ideas?

11:10:40 T:14400 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.NameError'>
Error Contents: global name 'hour_multiplier' is not defined
Traceback (most recent call last):
File "C:\Users\Boots\AppData\Roaming\XBMC\addons\service.scheduler\default.py", line 850, in <module>
script.start()
File "C:\Users\Boots\AppData\Roaming\XBMC\addons\service.scheduler\default.py", line 844, in start
self.schedule_check()
File "C:\Users\Boots\AppData\Roaming\XBMC\addons\service.scheduler\default.py", line 573, in schedule_check
self.custom1_timer = Timer( self.custom1[ "interval" ] * hour_multiplier, self.trigger_builtin, [ self.custom1[ "script" ], "custom1" ] )
NameError: global name 'hour_multiplier' is not defined
-->End of Python script error report<--

[Image: all-clearlogo.jpg]
find quote
dafy1974 Offline
Junior Member
Posts: 5
Joined: Jul 2014
Reputation: 0
Post: #81
Hi I was wondering if anyone could help me with some scripting. I am trying to use the custom script to start up a tvcatchup channel from favourites but am unable to get the script to work. This is what I have so far RunScript(&quot;script.tvcatchup&quot;,17,BBC News)

Any help would be appreciated
find quote
shaktoo Offline
Posting Freak
Posts: 916
Joined: Mar 2010
Reputation: 6
Location: Surrey
Post: #82
runscript error in kodi helix alpha4 as well
find quote
lrgreen Offline
Junior Member
Posts: 1
Joined: Oct 2014
Reputation: 0
Post: #83
Sorry if this has been answered already, I've read through the thread. I'm no programer,so I'm lost. I want to set this up to run a slideshow from a network location and refresh as often as possible. I've tried RunScript(script.RecursiveSlideShow) along with RunScript(script.RecursiveSlideShow(smb://server/directory)), neither works. I've tried a few things I've seen on other forums too, I've disabled and re-enabled between each change, but I keep getting nothing. What should I be typing?
find quote
ponch0 Offline
Junior Member
Posts: 1
Joined: Jan 2015
Reputation: 1
Post: #84
(2014-06-01 17:14)BootsC5 Wrote:  I'm getting this error on startup. Running Gotham, fresh install, running 1.0.1. Any ideas?

11:10:40 T:14400 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.NameError'>
Error Contents: global name 'hour_multiplier' is not defined
Traceback (most recent call last):
File "C:\Users\Boots\AppData\Roaming\XBMC\addons\service.scheduler\default.py", line 850, in <module>
script.start()
File "C:\Users\Boots\AppData\Roaming\XBMC\addons\service.scheduler\default.py", line 844, in start
self.schedule_check()
File "C:\Users\Boots\AppData\Roaming\XBMC\addons\service.scheduler\default.py", line 573, in schedule_check
self.custom1_timer = Timer( self.custom1[ "interval" ] * hour_multiplier, self.trigger_builtin, [ self.custom1[ "script" ], "custom1" ] )
NameError: global name 'hour_multiplier' is not defined
-->End of Python script error report<--

Adding the line:
hour_multiplier=3600

At the beggining of the definition of function schedule_check (line 401 in default.py) seems to do the magic
find quote
Frozin Offline
Senior Member
Posts: 253
Joined: Aug 2012
Reputation: 3
Post: #85
(2015-01-07 19:56)ponch0 Wrote:  
(2014-06-01 17:14)BootsC5 Wrote:  I'm getting this error on startup. Running Gotham, fresh install, running 1.0.1. Any ideas?

11:10:40 T:14400 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.NameError'>
Error Contents: global name 'hour_multiplier' is not defined
Traceback (most recent call last):
File "C:\Users\Boots\AppData\Roaming\XBMC\addons\service.scheduler\default.py", line 850, in <module>
script.start()
File "C:\Users\Boots\AppData\Roaming\XBMC\addons\service.scheduler\default.py", line 844, in start
self.schedule_check()
File "C:\Users\Boots\AppData\Roaming\XBMC\addons\service.scheduler\default.py", line 573, in schedule_check
self.custom1_timer = Timer( self.custom1[ "interval" ] * hour_multiplier, self.trigger_builtin, [ self.custom1[ "script" ], "custom1" ] )
NameError: global name 'hour_multiplier' is not defined
-->End of Python script error report<--

Adding the line:
hour_multiplier=3600

At the beggining of the definition of function schedule_check (line 401 in default.py) seems to do the magic

Hate to ask but can you be more specific, i'm using word pad and it has no line numbers and there is two instances of schedule_check and no instances of function schedule_check I'm unsure as to where I'm suppose to insert that additional line.

[Image: all-clearlogo.jpg]
(This post was last modified: 2015-02-10 07:17 by Frozin.)
find quote
lysin Offline
Senior Member
Posts: 105
Joined: Mar 2012
Reputation: 1
Post: #86
Wrong thread. Sorry

[Image: all-thin-banner.jpg]
(This post was last modified: 2015-02-11 03:22 by lysin.)
find quote
pieman Offline
Junior Member
Posts: 43
Joined: Jan 2014
Reputation: 0
Location: Cyprus
Post: #87
Ok I think I am making progress with The Scheduler.

Can users confirm that Kodi needs to be restarted after each amendment to the Schedule. As a script I see why this would be the case but there are some scripts that just pick up the latest xml file and process it without the service needing a restart.

Is there a way to restart the service without restarting Kodi. Edit: I was thinking we could just disable the service and then enable it again but doing this crashes Kodi for me on Windows 8.1. Will keep testing and try other OS' too.

I can confirm that RunScript(script.whatever) does work in Gotham but AFAIK you will need to restart Kodi (or The Scheduler service) for it to take effect.

Any progress on using Custom scripts 3 to 10?

Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
[Image: Easy_Home_Automation.PNG]
(This post was last modified: 2015-03-08 23:50 by pieman.)
find quote
pieman Offline
Junior Member
Posts: 43
Joined: Jan 2014
Reputation: 0
Location: Cyprus
Post: #88
(2015-02-23 15:07)pieman Wrote:  Ok I think I am making progress with The Scheduler.

Can users confirm that Kodi needs to be restarted after each amendment to the Schedule. As a script I see why this would be the case but there are some scripts that just pick up the latest xml file and process it without the service needing a restart.

Is there a way to restart the service without restarting Kodi. Edit: I was thinking we could just disable the service and then enable it again but doing this crashes Kodi for me on Windows 8.1. Will keep testing and try other OS' too.

I can confirm that RunScript(script.whatever) does work in Gotham but AFAIK you will need to restart Kodi (or The Scheduler service) for it to take effect.

Any progress on using Custom scripts 3 to 10?

I'm just waiting for my 10 Custom scripts to complete before I send this post but all looks fine at the moment. Tested 6 scripts earlier that ran through ok and The Scheduler has completed the first 8 of the 10 scripts I currently have set. They are set at 5 minute intervals so they will be finished in less than 10 minutes now. As expected all 10 scripts ran as expected.

2 custom scripts for us would be a bit limiting as it would just allow one transition from on to off (or off to on) per day but 10 scripts is more than adequate, giving us 5 transitions per day.

For those that couldn't get scripts 3 to 10 to fire up are you on Helix (my main system is Gotham but I'll try to check one of My Helix systems later) or has the 'bug' been fixed?

Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
[Image: Easy_Home_Automation.PNG]
(This post was last modified: 2015-03-08 23:51 by pieman.)
find quote
Post Reply