+ global lastpath
+ filename = self["filelist"].getFilename()
+ if filename is not None:
+ if filename.upper().endswith("VIDEO_TS/"):
+ print "dvd structure found, trying to open..."
+ dvdpath = filename[0:-9]
+ lastpath = (dvdpath.rstrip("/").rsplit("/",1))[0]
+ print "lastpath video_ts/=", lastpath
+ self.close(dvdpath)
+ return
+ if self["filelist"].canDescent(): # isDir
+ self["filelist"].descent()
+ pathname = self["filelist"].getCurrentDirectory() or ""
+ if fileExists(pathname+"VIDEO_TS.IFO"):
+ print "dvd structure found, trying to open..."
+ lastpath = (pathname.rstrip("/").rsplit("/",1))[0]
+ print "lastpath video_ts.ifo=", lastpath
+ self.close(pathname)
+ else:
+ lastpath = filename[0:filename.rfind("/")]
+ print "lastpath directory=", lastpath
+ self.close(filename)