How to handle files on library SMB locations in python?
#1
If this is too noob question for experienced developers I apologize upfront. I'm not really a developer. I just want so bad to fix the chapter/scene selector script that 999unreal modified (http://forum.kodi.tv/showthread.php?tid=...pid1857449) to work with SMB paths as I have all my content stored on SMB shares.

Question: Does anyone know how to check for and open files on existing SMB connections in python?

Current script code:
Code:
if os.path.exists(movieHalfPath.decode('utf-8') + ".chapter.xml"):
            chaptersFile = (movieHalfPath + ".chapter.xml")

This fails for SMB paths...
Reply
#2
http://mirrors.xbmc.org/docs/python-docs...ml#-exists
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#3
Use Xbmcvfs
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#4
So the slightly longer answer is that the python module os doesn't understand network directories. The Kodi folks have written an abstraction layer so that programers don't have to worry about the various possible file systems available, and one of the things that abstraction layer (xbmcvfs) supports in SMB volumes. So, as Lunatixz indicated, use the xbmcvfs module for any file calls, and that would do it. Now finding all the file calls is another story all together...
Reply
#5
Thanks guys. I was able to sort it out using xbmcvfs in the chapter add-on.
Reply

Logout Mark Read Team Forum Stats Members Help
How to handle files on library SMB locations in python?0