-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Future upgrades should no longer require a restart (service is hot-de…
…ployed)
- Loading branch information
killdash9
committed
Aug 21, 2012
1 parent
22a379c
commit 8d22c46
Showing
11 changed files
with
89 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
c73624bb30c532990425605e07622323 | ||
741a087c59e1ba8dd0f16efbc4d6a347 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
mkdir "$HOME/Library/Application Support/XBMC/addons/script.video.parentalcontrols" | ||
cp -Rv script.video.parentalcontrols/* "$HOME/Library/Application Support/XBMC/addons/script.video.parentalcontrols" | ||
while true | ||
do | ||
cp -R script.video.parentalcontrols/* "$HOME/Library/Application Support/XBMC/addons/script.video.parentalcontrols" | ||
sleep 1 | ||
done |
Binary file added
BIN
+53.2 KB
repo/script.video.parentalcontrols/script.video.parentalcontrols-1.5.2.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 19 additions & 36 deletions
55
script.video.parentalcontrols/resources/lib/parentalcontrols/service.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,29 @@ | ||
import time | ||
import common | ||
import hook | ||
import traceback | ||
import xbmcgui | ||
import xbmcaddon | ||
import os | ||
import xbmc | ||
|
||
def checkProtection(): | ||
plugins = common.getProtectedPlugins() | ||
for plugin in plugins: | ||
state = hook.getPluginHookState(plugin) | ||
if (not state['hooked']) or not (state['uptodate']): | ||
p=hook.hookPlugin(plugin) | ||
common.msg("Re-protecting plugin " + p['name']) | ||
|
||
def closeProgressDialogIfInterfering(): | ||
pythonWindow = None | ||
pythonWindowId=13000 | ||
try: | ||
pythonWindow=xbmcgui.Window(pythonWindowId) | ||
except: | ||
pass | ||
#window not found | ||
if pythonWindow: | ||
xmlfile = pythonWindow.getProperty('xmlfile') | ||
codeDialogIsUp = xmlfile and xmlfile.find('DialogCode.xml')>=0 | ||
if codeDialogIsUp: | ||
#close any other open dialogs so they don't interfere | ||
common.closeProgressDialogIfOpen() | ||
import common | ||
import serviceiter | ||
|
||
__addonpath__ = xbmcaddon.Addon().getAddonInfo('path') | ||
|
||
common.msg("Started") | ||
lastMessage = time.time() | ||
counter=0 | ||
while (not xbmc.abortRequested): | ||
try: | ||
counter = counter+1 | ||
if counter % 20 == 0: | ||
checkProtection() | ||
common.getXbmcAdultIds() #keep the cache up to date | ||
closeProgressDialogIfInterfering() | ||
|
||
files = os.listdir(__addonpath__ + "/resources/lib/parentalcontrols") | ||
for file in files: | ||
if file.endswith(".py") and file != "service.py" and file != "settings.py": | ||
module=file[:-3] | ||
#reimport the module | ||
try: | ||
reload(eval(module)) | ||
except NameError: | ||
exec("import " + module) | ||
serviceiter.iterate() | ||
except: | ||
traceback.print_exc() | ||
if (time.time() - lastMessage > 5*60): #we don't want to be too annoying with errors | ||
common.msg("Error checking plugin protection status") | ||
lastMessage = time.time() | ||
time.sleep(.5) | ||
time.sleep(10) | ||
|
46 changes: 46 additions & 0 deletions
46
script.video.parentalcontrols/resources/lib/parentalcontrols/serviceiter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import time | ||
import xbmcgui | ||
import xbmcaddon | ||
import xbmc | ||
import inspect | ||
|
||
import common | ||
import hook | ||
|
||
__addon__ = xbmcaddon.Addon() | ||
__addonpath__ = __addon__.getAddonInfo('path') | ||
|
||
def checkProtection(): | ||
plugins = common.getProtectedPlugins() | ||
for plugin in plugins: | ||
state = hook.getPluginHookState(plugin) | ||
if (not state['hooked']) or not (state['uptodate']): | ||
p=hook.hookPlugin(plugin) | ||
common.msg("Re-protecting plugin " + p['name']) | ||
|
||
def closeProgressDialogIfInterfering(): | ||
pythonWindow = None | ||
pythonWindowId=13000 | ||
try: | ||
pythonWindow=xbmcgui.Window(pythonWindowId) | ||
except: | ||
pass | ||
#window not found | ||
if pythonWindow: | ||
xmlfile = pythonWindow.getProperty('xmlfile') | ||
codeDialogIsUp = xmlfile and xmlfile.find('DialogCode.xml')>=0 | ||
if codeDialogIsUp: | ||
#close any other open dialogs so they don't interfere | ||
common.closeProgressDialogIfOpen() | ||
|
||
|
||
def iterate(): | ||
counter=0 | ||
while (not xbmc.abortRequested and counter < 20): | ||
if counter % 20 == 0: | ||
checkProtection() | ||
common.getXbmcAdultIds() #keep the cache up to date | ||
closeProgressDialogIfInterfering() | ||
time.sleep(.5) | ||
counter = counter+1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters