- Angelscry - 2010-12-10
jpreville Wrote:looks like xbmc is opening to many pipes...
and causes the above error. there' got be someway of possibly closing each process. or possibly opening only up one cmd/bash process. then throwing the command needed to mame. then close that cmd/bash.. i'll play around.
lsof|grep xbmc.bin will show number of files open. We could try to close them like this :Code: def _test_mame_name( app, filename ):
if ( app.lower().find('mame') > 0 ):
try:
page = subprocess.Popen(app+' -listfull '+filename, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, errors = page.communicate()
pclose(page)
except :
page = subprocess.Popen(app+' -listfull '+filename, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output = page.stdout.read()
pclose(page)
name = ''.join(re.findall('"(.*?)"', output.replace('\n', '')))
romname = re.sub(' \(.*?\)', '', name).replace('/','-')
return romname
else:
return filename
- jpreville - 2010-12-10
ok. i will try that... i added this in the code to try and its still going..
Quote:def _test_mame_name( app, filename ):
if ( app.lower().find('mame') > 0 ):
try:
page = subprocess.Popen(app+' -listfull '+filename, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,close_fds=True)
output, errors = page.communicate()
except :
page = subprocess.Popen(app+' -listfull '+filename, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,close_fds=True)
output = page.stdout.read()
name = ''.join(re.findall('"(.*?)"', output.replace('\n', '')))
romname = re.sub(' \(.*?\)', '', name).replace('/','-')
page.stdout.close()
return romname
else:
return filename
but i'm not sure if that's the proper way of doing it.
Never mind it just failed after Posting...err. lol. I'll try your code.
- davidw - 2010-12-10
Angelscry Wrote:Do you have an error message when you start the rom scanner or nothing happen. If error could you post here the XBMC crash log and launchers.xml file. If you have no error message only send me your launchers.xml file. Code: 21:06:28 T:3045181296 M:3182419968 DEBUG: RunScriptWithParams - calling plugin Advanced Launcher('plugin://plugin.program.advanced.launcher/','-1','?zsnes/%%IMPORT%%')
21:06:28 T:3045181296 M:3182419968 INFO: initializing python engine.
21:06:28 T:3045181296 M:3182419968 DEBUG: new python thread created. id=2
21:06:28 T:2747624304 M:3182419968 DEBUG: thread start, auto delete: 0
21:06:28 T:2747624304 M:3182419968 DEBUG: Python thread: start processing
21:06:28 T:2747624304 M:3182071808 NOTICE: -->Python Interpreter Initialized<--
21:06:28 T:2747624304 M:3182071808 DEBUG: Process - The source file to load is /home/xbmc/.xbmc/addons/plugin.program.advanced.launcher/addon.py
21:06:28 T:2747624304 M:3182071808 DEBUG: Process - Setting the Python path to /home/xbmc/.xbmc/addons/plugin.program.advanced.launcher:/home/xbmc/.xbmc/addons/script.module.simplejson/lib:/home/xbmc/.xbmc/addons/script.module.beautifulsoup/lib:/usr/lib/xbmc/addons/script.module.pil/lib:/home/xbmc/.xbmc/addons/script.module.elementtree/lib:/usr/lib/xbmc/addons/script.module.pysqlite/lib:/usr/lib/xbmc/system/python/python24.zip:/usr/share/xbmc/system/python/lib/python24.zip:/usr/share/xbmc/system/python/lib/python2.4/:/usr/share/xbmc/system/python/lib/python2.4/plat-linux2:/usr/share/xbmc/system/python/lib/python2.4/lib-tk:/usr/share/xbmc/system/python/lib/python2.4/lib-dynload
21:06:28 T:2747624304 M:3182071808 DEBUG: Process - Entering source directory /home/xbmc/.xbmc/addons/plugin.program.advanced.launcher
21:06:28 T:2747624304 M:3182297088 NOTICE: Mode AddOn ON
21:06:28 T:2747624304 M:3182297088 NOTICE: /home/xbmc/.xbmc/userdata/addon_data/plugin.program.advanced.launcher
21:06:28 T:2747624304 M:3182297088 NOTICE: -1
21:06:28 T:2747624304 M:3182403584 NOTICE: Launcher: found 1 launchers
21:06:28 T:2747624304 M:3182510080 INFO: Loading skin file: DialogProgress.xml
21:06:28 T:2747624304 M:3182297088 DEBUG: Load DialogProgress.xml: 33.48ms
21:06:28 T:2747624304 M:3182297088 DEBUG: DialogProgress::StartModal called
21:06:28 T:2747624304 M:3182297088 DEBUG: ------ Window Init (DialogProgress.xml) ------
21:06:28 T:2747624304 M:3182297088 DEBUG: Alloc resources: 0.16ms (0.01 ms skin load)
21:06:28 T:3045181296 M:3182239744 DEBUG: ------ Window Deinit (DialogProgress.xml) ------
21:06:28 T:2747624304 M:3182239744 INFO: Loading skin file: DialogProgress.xml
21:06:29 T:2747624304 M:3182346240 DEBUG: Load DialogProgress.xml: 18.06ms
21:06:29 T:2747624304 M:3182346240 DEBUG: DialogProgress::StartModal called
21:06:29 T:2747624304 M:3182346240 DEBUG: ------ Window Init (DialogProgress.xml) ------
21:06:29 T:2747624304 M:3182346240 DEBUG: Alloc resources: 0.22ms (0.01 ms skin load)
21:06:29 T:2747624304 M:3182346240 INFO: -->Python script returned the following error<--
21:06:29 T:2747624304 M:3182346240 ERROR: Error Type: exceptions.TypeError
21:06:29 T:2747624304 M:3182346240 ERROR: Error Contents: expected string or buffer
21:06:29 T:2747624304 M:3182063616 ERROR: Traceback (most recent call last):
File "/home/xbmc/.xbmc/addons/plugin.program.advanced.launcher/addon.py", line 20, in ?
plugin.Main()
File "/home/xbmc/.xbmc/addons/plugin.program.advanced.launcher/resources/lib/launcher_plugin.py", line 168, in __init__
self._import_roms(launcher)
File "/home/xbmc/.xbmc/addons/plugin.program.advanced.launcher/resources/lib/launcher_plugin.py", line 921, in _import_roms
romname = re.sub('\[.*?\]', '', romname)
File "/usr/lib/xbmc/system/python/python24.zip/sre.py", line 142, in sub
return _compile(pattern, 0).sub(repl, string, count)
TypeError: expected string or buffer
21:06:29 T:2747624304 M:3182063616 INFO: -->End of Python script error report<--
21:06:29 T:2747624304 M:3181555712 INFO: Python script stopped
21:06:29 T:2747624304 M:3181555712 DEBUG: Thread 2747624304 terminating
Sorry but i just had time do test it now again. And I see that someone else already updated the german translation !
- Angelscry - 2010-12-10
davidw Wrote:Code: 21:06:28 T:3045181296 M:3182419968 DEBUG: RunScriptWithParams - calling plugin Advanced Launcher('plugin://plugin.program.advanced.launcher/','-1','?zsnes/%%IMPORT%%')
21:06:28 T:3045181296 M:3182419968 INFO: initializing python engine.
21:06:28 T:3045181296 M:3182419968 DEBUG: new python thread created. id=2
21:06:28 T:2747624304 M:3182419968 DEBUG: thread start, auto delete: 0
21:06:28 T:2747624304 M:3182419968 DEBUG: Python thread: start processing
21:06:28 T:2747624304 M:3182071808 NOTICE: -->Python Interpreter Initialized<--
21:06:28 T:2747624304 M:3182071808 DEBUG: Process - The source file to load is /home/xbmc/.xbmc/addons/plugin.program.advanced.launcher/addon.py
21:06:28 T:2747624304 M:3182071808 DEBUG: Process - Setting the Python path to /home/xbmc/.xbmc/addons/plugin.program.advanced.launcher:/home/xbmc/.xbmc/addons/script.module.simplejson/lib:/home/xbmc/.xbmc/addons/script.module.beautifulsoup/lib:/usr/lib/xbmc/addons/script.module.pil/lib:/home/xbmc/.xbmc/addons/script.module.elementtree/lib:/usr/lib/xbmc/addons/script.module.pysqlite/lib:/usr/lib/xbmc/system/python/python24.zip:/usr/share/xbmc/system/python/lib/python24.zip:/usr/share/xbmc/system/python/lib/python2.4/:/usr/share/xbmc/system/python/lib/python2.4/plat-linux2:/usr/share/xbmc/system/python/lib/python2.4/lib-tk:/usr/share/xbmc/system/python/lib/python2.4/lib-dynload
21:06:28 T:2747624304 M:3182071808 DEBUG: Process - Entering source directory /home/xbmc/.xbmc/addons/plugin.program.advanced.launcher
21:06:28 T:2747624304 M:3182297088 NOTICE: Mode AddOn ON
21:06:28 T:2747624304 M:3182297088 NOTICE: /home/xbmc/.xbmc/userdata/addon_data/plugin.program.advanced.launcher
21:06:28 T:2747624304 M:3182297088 NOTICE: -1
21:06:28 T:2747624304 M:3182403584 NOTICE: Launcher: found 1 launchers
21:06:28 T:2747624304 M:3182510080 INFO: Loading skin file: DialogProgress.xml
21:06:28 T:2747624304 M:3182297088 DEBUG: Load DialogProgress.xml: 33.48ms
21:06:28 T:2747624304 M:3182297088 DEBUG: DialogProgress::StartModal called
21:06:28 T:2747624304 M:3182297088 DEBUG: ------ Window Init (DialogProgress.xml) ------
21:06:28 T:2747624304 M:3182297088 DEBUG: Alloc resources: 0.16ms (0.01 ms skin load)
21:06:28 T:3045181296 M:3182239744 DEBUG: ------ Window Deinit (DialogProgress.xml) ------
21:06:28 T:2747624304 M:3182239744 INFO: Loading skin file: DialogProgress.xml
21:06:29 T:2747624304 M:3182346240 DEBUG: Load DialogProgress.xml: 18.06ms
21:06:29 T:2747624304 M:3182346240 DEBUG: DialogProgress::StartModal called
21:06:29 T:2747624304 M:3182346240 DEBUG: ------ Window Init (DialogProgress.xml) ------
21:06:29 T:2747624304 M:3182346240 DEBUG: Alloc resources: 0.22ms (0.01 ms skin load)
21:06:29 T:2747624304 M:3182346240 INFO: -->Python script returned the following error<--
21:06:29 T:2747624304 M:3182346240 ERROR: Error Type: exceptions.TypeError
21:06:29 T:2747624304 M:3182346240 ERROR: Error Contents: expected string or buffer
21:06:29 T:2747624304 M:3182063616 ERROR: Traceback (most recent call last):
File "/home/xbmc/.xbmc/addons/plugin.program.advanced.launcher/addon.py", line 20, in ?
plugin.Main()
File "/home/xbmc/.xbmc/addons/plugin.program.advanced.launcher/resources/lib/launcher_plugin.py", line 168, in __init__
self._import_roms(launcher)
File "/home/xbmc/.xbmc/addons/plugin.program.advanced.launcher/resources/lib/launcher_plugin.py", line 921, in _import_roms
romname = re.sub('\[.*?\]', '', romname)
File "/usr/lib/xbmc/system/python/python24.zip/sre.py", line 142, in sub
return _compile(pattern, 0).sub(repl, string, count)
TypeError: expected string or buffer
21:06:29 T:2747624304 M:3182063616 INFO: -->End of Python script error report<--
21:06:29 T:2747624304 M:3181555712 INFO: Python script stopped
21:06:29 T:2747624304 M:3181555712 DEBUG: Thread 2747624304 terminating
Sorry but i just had time do test it now again. And I see that someone else already updated the german translation !
For this last error you can do this
- jpreville - 2010-12-10
@Angelscry
This seems to be working good.. so far. still scanning. i added the polling . then killing the pid with os. Only problem i see with my code is. which i'm far from a expert on python. is i'm expecting the process to terminate properly. if for some reason it doesn't it might build up again. maybe something if poll doesnt return -1 then go into a waiting loop. then possibly kill the pid in a certain amount of time... just thinking out loud.
Quote:def _test_mame_name( app, filename ):
if ( app.lower().find('mame') > 0 ):
try:
page = subprocess.Popen(app+' -listfull '+filename, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, errors = page.communicate()
except :
page = subprocess.Popen(app+' -listfull '+filename, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output = page.stdout.read()
if (page.poll==-1):os.kill(RESULT.pid,0)
name = ''.join(re.findall('"(.*?)"', output.replace('\n', '')))
romname = re.sub(' \(.*?\)', '', name).replace('/','-')
return romname
else:
return filename
Quote:15:57:05 T:140524306114320 M:985747456 ERROR: Error Type: exceptions.OSError
15:57:05 T:140524306114320 M:985747456 ERROR: Error Contents: (24, 'Too many open files')
15:57:06 T:140524306114320 M:986128384 ERROR: Traceback (most recent call last):
File "/home/john/.xbmc/addons/plugin.program.advanced.launcher/addon.py", line 20, in ?
plugin.Main()
File "/home/john/.xbmc/addons/plugin.program.advanced.launcher/resources/lib/launcher_plugin.py", line 168, in __init__
self._import_roms(launcher)
File "/home/john/.xbmc/addons/plugin.program.advanced.launcher/resources/lib/launcher_plugin.py", line 920, in _import_roms
romname = self._test_mame_name(selectedLauncher["application"],f[:-len(ext)-1])
File "/home/john/.xbmc/addons/plugin.program.advanced.launcher/resources/lib/emulators.py", line 40, in _test_mame_name
page = subprocess.Popen(app+' -listfull '+filename, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
File "/usr/lib/xbmc/system/python/python24.zip/subprocess.py", line 534, in __init__
(p2cread, p2cwrite,
File "/usr/lib/xbmc/system/python/python24.zip/subprocess.py", line 835, in _get_handles
c2pread, c2pwrite = os.pipe()
OSError: (24, 'Too many open files')
errrr.. nope.. back to the drawing board...
- davidw - 2010-12-10
Angelscry Wrote:For this last error you can do this Great yes that worked for me too!
Cheers,
David
- Angelscry - 2010-12-11
jpreville Wrote:@Angelscry
This seems to be working good.. so far. still scanning. i added the polling . then killing the pid with os. Only problem i see with my code is. which i'm far from a expert on python. is i'm expecting the process to terminate properly. if for some reason it doesn't it might build up again. maybe something if poll doesnt return -1 then go into a waiting loop. then possibly kill the pid in a certain amount of time... just thinking out loud.
errrr.. nope.. back to the drawing board... Ok... I give up the -listfull command line approach. I think I will add a specific scraper for MAME roms.
- moeff - 2010-12-11
Hi,
one of the best plugins for xbmc, but i couldnt scrape fanart or thums for my "apps" - xmbc.log ->
Code: 16:40:31 T:2756 M:2307452928 NOTICE: -->Python Interpreter Initialized<--
16:40:31 T:2756 M:2307534848 NOTICE: Mode AddOn ON
16:40:31 T:2756 M:2307534848 NOTICE: C:\Users\moeff\AppData\Roaming\XBMC\userdata\addon_data\plugin.program.advanced.launcher
16:40:31 T:2756 M:2307534848 NOTICE: 0
16:40:31 T:2756 M:2307522560 NOTICE: Launcher: found 2 launchers
16:40:38 T:4720 M:2307837952 NOTICE: -->Python Interpreter Initialized<--
16:40:39 T:4720 M:2307465216 NOTICE: Mode AddOn ON
16:40:39 T:4720 M:2307465216 NOTICE: C:\Users\moeff\AppData\Roaming\XBMC\userdata\addon_data\plugin.program.advanced.launcher
16:40:39 T:4720 M:2307465216 NOTICE: -1
16:40:39 T:4720 M:2307452928 NOTICE: Launcher: found 2 launchers
16:40:43 T:4720 M:2308804608 NOTICE: http://image.com.com/gamespot/images/2003/all/boxshots2/914766_24124.jpg
16:40:43 T:4720 M:2308804608 NOTICE: http://image.com.com/gamespot/images/2003/all/boxshots2/914766_168831.jpg
16:40:43 T:4720 M:2308804608 NOTICE: http://image.com.com/gamespot/images/2003/all/boxshots2/914766_168460.jpg
16:41:02 T:4720 M:2306281472 NOTICE: 6
16:41:02 T:4720 M:2306281472 NOTICE: 2
16:41:02 T:672 M:2306289664 ERROR: CLocalizeStrings::ClearBlock: Trying to clear non existent block C:\Users\moeff\AppData\Roaming\XBMC\userdata\
16:41:03 T:4720 M:2306977792 ERROR: Error Type: exceptions.OSError
16:41:03 T:4720 M:2306977792 ERROR: Error Contents: (0, 'Error', 'D:\\Games\\Need For Speed Underground\\Need for Speed: Underground_thumb.jpg')
16:41:03 T:4720 M:2306895872 ERROR: Traceback (most recent call last):
File "C:\Users\moeff\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\addon.py", line 20, in ?
plugin.Main()
File "C:\Users\moeff\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\resources\lib\launcher_plugin.py", line 155, in __init__
self._scrap_thumb_launcher(launcher)
File "C:\Users\moeff\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\resources\lib\launcher_plugin.py", line 321, in _scrap_thumb_launcher
_update_cache(img_url,file_path)
File "C:\Users\moeff\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\resources\lib\launcher_plugin.py", line 1304, in _update_cache
shutil.copy2( file_path , cached_thumb )
File "special://xbmc/system/python/Lib\shutil.py", line 93, in copy2
copystat(src, dst)
File "special://xbmc/system/python/Lib\shutil.py", line 65, in copystat
st = os.stat(src)
OSError: (0, 'Error', 'D:\\Games\\Need For Speed Underground\\Need for Speed: Underground_thumb.jpg')
any idea? thx for any help!
- Angelscry - 2010-12-11
moeff Wrote:Hi,
one of the best plugins for xbmc, but i couldnt scrape fanart or thums for my "apps" - XBMC.log ->
Code: 16:40:31 T:2756 M:2307452928 NOTICE: -->Python Interpreter Initialized<--
16:40:31 T:2756 M:2307534848 NOTICE: Mode AddOn ON
16:40:31 T:2756 M:2307534848 NOTICE: C:\Users\moeff\AppData\Roaming\XBMC\userdata\addon_data\plugin.program.advanced.launcher
16:40:31 T:2756 M:2307534848 NOTICE: 0
16:40:31 T:2756 M:2307522560 NOTICE: Launcher: found 2 launchers
16:40:38 T:4720 M:2307837952 NOTICE: -->Python Interpreter Initialized<--
16:40:39 T:4720 M:2307465216 NOTICE: Mode AddOn ON
16:40:39 T:4720 M:2307465216 NOTICE: C:\Users\moeff\AppData\Roaming\XBMC\userdata\addon_data\plugin.program.advanced.launcher
16:40:39 T:4720 M:2307465216 NOTICE: -1
16:40:39 T:4720 M:2307452928 NOTICE: Launcher: found 2 launchers
16:40:43 T:4720 M:2308804608 NOTICE: http://image.com.com/gamespot/images/2003/all/boxshots2/914766_24124.jpg
16:40:43 T:4720 M:2308804608 NOTICE: http://image.com.com/gamespot/images/2003/all/boxshots2/914766_168831.jpg
16:40:43 T:4720 M:2308804608 NOTICE: http://image.com.com/gamespot/images/2003/all/boxshots2/914766_168460.jpg
16:41:02 T:4720 M:2306281472 NOTICE: 6
16:41:02 T:4720 M:2306281472 NOTICE: 2
16:41:02 T:672 M:2306289664 ERROR: CLocalizeStrings::ClearBlock: Trying to clear non existent block C:\Users\moeff\AppData\Roaming\XBMC\userdata\
16:41:03 T:4720 M:2306977792 ERROR: Error Type: exceptions.OSError
16:41:03 T:4720 M:2306977792 ERROR: Error Contents: (0, 'Error', 'D:\\Games\\Need For Speed Underground\\Need for Speed: Underground_thumb.jpg')
16:41:03 T:4720 M:2306895872 ERROR: Traceback (most recent call last):
File "C:\Users\moeff\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\addon.py", line 20, in ?
plugin.Main()
File "C:\Users\moeff\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\resources\lib\launcher_plugin.py", line 155, in __init__
self._scrap_thumb_launcher(launcher)
File "C:\Users\moeff\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\resources\lib\launcher_plugin.py", line 321, in _scrap_thumb_launcher
_update_cache(img_url,file_path)
File "C:\Users\moeff\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\resources\lib\launcher_plugin.py", line 1304, in _update_cache
shutil.copy2( file_path , cached_thumb )
File "special://xbmc/system/python/Lib\shutil.py", line 93, in copy2
copystat(src, dst)
File "special://xbmc/system/python/Lib\shutil.py", line 65, in copystat
st = os.stat(src)
OSError: (0, 'Error', 'D:\\Games\\Need For Speed Underground\\Need for Speed: Underground_thumb.jpg')
any idea? thx for any help!
It is strange that you have "\\" on your thumbs paths : Code: D:\\Games\\Need For Speed Underground\\Need for Speed: Underground_thumb.jpg
. It seems to create an error into the refresh thumb cache function. Could you please pastebin your launchers.xml file. It may be will help me to identify the error source. Thank you.
- Angelscry - 2010-12-11
Version 0.7.8
This new version of the Advanced Launcher bring the support for MAME roms with MAWS data and images scrapers. Because MAME roms files cannot be renamed as for the other game emulators, the MAWS scrapers use the rom filename for the search instead of the rom title name.
Changelog:- add MAME support
- add mameworld data and images scrapers
- fix all scrapers exeption errors
- jpreville - 2010-12-12
@Angelscry
Looks Like you did it!!!! its Scanning My collection Still. But it doesn't look like its missed to many!!
Does it remember what scraper you choose? for each Launcher? or you just switch it up for certain emulators?
Thank You for getting this working!
John
- argus - 2010-12-12
Just installed your launcher for the first time and I'm having a problem.
When I try to add a launcher for ZSNES or MAME when I get to the "Select your game system" menu, the only option I get is 3DO
- Angelscry - 2010-12-12
argus Wrote:Just installed your launcher for the first time and I'm having a problem.
When I try to add a launcher for ZSNES or MAME when I get to the "Select your game system" menu, the only option I get is 3DO I have just discover it also. I'm actually working on this error !!!! Sorry for the inconvenience.
- argus - 2010-12-12
Well I deleted the first line from the game systems file in the addon directory and now it works. since I don't intend on emulating 3DO I'm fine with that
- Death-Axe - 2010-12-12
Cool man, I'll have a go at the new version with mame. There is a mame front end addon, but whomever made it forgot to have the emulator path name in " " so if your path has spaces, you're screwed.
|