示例#1
0
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))
示例#2
0
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))
示例#3
0
 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
示例#4
0
 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