def updateInfo(path): global trash_count, trash_size trash_count = trash_count + 1 if os.path.isfile(path): trash_size += os.path.getsize(path) else: from ServiceUtils import getFolderSize trash_size += getFolderSize(os.path.dirname(path))
def getInfoObject(self, serviceref, type): try: dvd = detectDVDStructure(serviceref.getPath() + '/') if dvd: return getFolderSize(os.path.dirname(dvd)) return os.path.getsize(serviceref.getPath()) except Exception as e: print(str(e)) return -1
def getInfoObject(self, serviceref, type): if type == iServiceInformation.sFileSize: try: dvd = detectDVDStructure(serviceref.getPath() + "/") if dvd: return getFolderSize(os.path.dirname(dvd)) return os.path.getsize(serviceref.getPath()) except Exception, e: print e return -1