Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Copy home_automation file over to userdata/addon_data/ha_scripts in t…

…he service script since it is the first thing run
  • Loading branch information...
commit f71a0f45c74e0074f9475437c7892e548179b56f 1 parent 3a37bac
@Giftie authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 service.py
View
12 service.py
@@ -1,4 +1,4 @@
-import xbmc, xbmcaddon, xbmcgui
+import xbmc, xbmcaddon, xbmcgui, xbmcvfs
import os, sys
__addon__ = xbmcaddon.Addon()
@@ -9,6 +9,7 @@
__scriptID__ = __addonid__
BASE_RESOURCE_PATH = xbmc.translatePath( os.path.join( __addon__.getAddonInfo('path').decode('utf-8'), 'resources' ) )
+BASE_CURRENT_SOURCE_PATH = os.path.join( xbmc.translatePath( "special://profile/addon_data/" ).decode('utf-8'), os.path.basename( __addon__.getAddonInfo('path') ) )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib" ) )
true = True
false = False
@@ -43,6 +44,15 @@
"ha_resumed": eval( __setting__( "ha_resumed" ) )
}
+ `
+#Check to see if module is moved to /userdata/addon_data/script.cinema.experience
+if not xbmcvfs.exists( os.path.join( BASE_CURRENT_SOURCE_PATH, "ha_scripts", "home_automation.py" ) ) and ha_settings[ "ha_enable" ]:
+ source = os.path.join( BASE_RESOURCE_PATH, "ha_scripts", "home_automation.py" )
+ destination = os.path.join( BASE_CURRENT_SOURCE_PATH, "ha_scripts", "home_automation.py" )
+ xbmcvfs.mkdir( os.path.join( BASE_CURRENT_SOURCE_PATH, "ha_scripts" ) )
+ xbmcvfs.copy( source, destination )
+ log( "[ script.cinema.experience ] - home_automation.py copied", level=xbmc.LOGNOTICE )
+
from launch_automation import Launch_automation
from utils import log
Please sign in to comment.
Something went wrong with that request. Please try again.