[RELEASE] Texture Cache Maintenance utility
@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:
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?
Reply


Messages In This Thread
Crash on Gotham on OS X - by desepticon - 2014-05-29, 17:57
RE: [RELEASE] Texture Cache Maintenance utility - by Mr.Floppy - 2017-10-15, 17:33
Cleaning - by AleisterHH - 2018-05-28, 22:03
RE: Cleaning - by Milhouse - 2018-05-28, 22:16
qax genre not updated - by Just-Me_A-User - 2018-06-12, 22:06
RE: qax genre not updated - by Milhouse - 2018-06-12, 23:40
Logout Mark Read Team Forum Stats Members Help
[RELEASE] Texture Cache Maintenance utility17