2017-10-15, 17:33
@Milhouse:
After having removed all "notify()" calls, the shell.py script now looks as following:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys, subprocess
def shellcmd(args):
process = subprocess.Popen(args, stderr=open(os.devnull, 'w'))
output = process.communicate()[0]
def shellnotify(args):
pidfile = "C:\Users\Stefan\AppData\Roaming\KODI\userdata\shellpy.pid"
if os.path.isfile(pidfile):
sys.exit(1)
file(pidfile, 'w').write(" ".join(args))
try:
os.chdir(os.path.dirname(os.path.realpath(__file__)))
shellcmd(args)
finally:
os.unlink(pidfile)
shellnotify(sys.argv[1:])
I've changed the keymap entry to:
When trying to run the script from my remote control red button, I'm getting the following exception:
16:54:49.250 T:6956 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.WindowsError'>
Error Contents: [Error 193] %1 ist keine zulässige Win32-Anwendung
Traceback (most recent call last):
File "C:\Users\Stefan\AppData\Roaming\Kodi\userdata\shell.py", line 31, in <module>
shellnotify(sys.argv[1:])
File "C:\Users\Stefan\AppData\Roaming\Kodi\userdata\shell.py", line 25, in shellnotify
shellcmd(args)
File "C:\Users\Stefan\AppData\Roaming\Kodi\userdata\shell.py", line 7, in shellcmd
process = subprocess.Popen(args, stderr=open(os.devnull, 'w'))
File "C:\Program Files (x86)\Kodi\system\python\Lib\subprocess.py", line 390, in __init__
errread, errwrite)
File "C:\Program Files (x86)\Kodi\system\python\Lib\subprocess.py", line 640, in _execute_child
startupinfo)
WindowsError: [Error 193] %1 ist keine zulässige Win32-Anwendung
-->End of Python script error report<--
"WindowsError 193: [Error 193} %1 ist keine zulässige Win32 Anwendung" translated to english means something like "%1 is not a valid Win32 application".
Any idea how to solve this?
After having removed all "notify()" calls, the shell.py script now looks as following:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys, subprocess
def shellcmd(args):
process = subprocess.Popen(args, stderr=open(os.devnull, 'w'))
output = process.communicate()[0]
def shellnotify(args):
pidfile = "C:\Users\Stefan\AppData\Roaming\KODI\userdata\shellpy.pid"
if os.path.isfile(pidfile):
sys.exit(1)
file(pidfile, 'w').write(" ".join(args))
try:
os.chdir(os.path.dirname(os.path.realpath(__file__)))
shellcmd(args)
finally:
os.unlink(pidfile)
shellnotify(sys.argv[1:])
I've changed the keymap entry to:
Code:
<red>XBMC.RunScript(special://profile/shell.py,./texturecache.py,c)</red>
When trying to run the script from my remote control red button, I'm getting the following exception:
16:54:49.250 T:6956 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.WindowsError'>
Error Contents: [Error 193] %1 ist keine zulässige Win32-Anwendung
Traceback (most recent call last):
File "C:\Users\Stefan\AppData\Roaming\Kodi\userdata\shell.py", line 31, in <module>
shellnotify(sys.argv[1:])
File "C:\Users\Stefan\AppData\Roaming\Kodi\userdata\shell.py", line 25, in shellnotify
shellcmd(args)
File "C:\Users\Stefan\AppData\Roaming\Kodi\userdata\shell.py", line 7, in shellcmd
process = subprocess.Popen(args, stderr=open(os.devnull, 'w'))
File "C:\Program Files (x86)\Kodi\system\python\Lib\subprocess.py", line 390, in __init__
errread, errwrite)
File "C:\Program Files (x86)\Kodi\system\python\Lib\subprocess.py", line 640, in _execute_child
startupinfo)
WindowsError: [Error 193] %1 ist keine zulässige Win32-Anwendung
-->End of Python script error report<--
"WindowsError 193: [Error 193} %1 ist keine zulässige Win32 Anwendung" translated to english means something like "%1 is not a valid Win32 application".
Any idea how to solve this?