Ticket #6858: pyth.21297fix.patch

File pyth.21297fix.patch, 1.8 KB (added by Raymond Wagner <raymond@…>, 15 years ago)
  • mythtv/bindings/python/MythTV/MythTV.py

     
    288288
    289289        def getFreeSpace(self,all=False):
    290290                """
    291                 Returns a tuple of tuples, in the form:
    292                         str   hostname
    293                         str   path
    294                         bool  is_local
    295                         int   drive number
    296                         int   storage group ID
    297                         int   total space (in KB)
    298                         int   used space (in KB)
     291                Returns a tuple of dictionaries, with the fields:
     292                        str   host              - hostname
     293                        str   path              - file system path
     294                        bool  islocal           - is FS local to queried backend
     295                        int   dnr               - drive number
     296                        int   sgid              - storage group ID
     297                        int   bsize             - block size (in bytes)
     298                        int   tspace            - total space (in KB)
     299                        int   uspace            - used space (in KB)
    299300                """
    300301                command = 'QUERY_FREE_SPACE'
    301302                if all:
    302303                        command = 'QUERY_FREE_SPACE_LIST'
    303304                res = self.backendCommand(command).split(BACKEND_SEP)
    304305                dirs = []
    305                 for i in range(0,len(res)/9):
    306                         line = [res[i*9]]
    307                         line.append(res[i*9+1])
    308                         line.append(bool(int(res[i*9+2])))
    309                         line.append(int(res[i*9+3]))
    310                         line.append(int(res[i*9+4]))
    311                         line.append(self.joinInt(int(res[i*9+5]),int(res[i*9+6])))
    312                         line.append(self.joinInt(int(res[i*9+7]),int(res[i*9+8])))
    313                         dirs.append(tuple(line))
     306                for i in range(0,len(res)/10):
     307                        line = {'hostname':res[i*10]}
     308                        line['path'] = res[i*10+1]
     309                        line['islocal'] = bool(int(res[i*10+2]))
     310                        line['dnr'] = int(res[i*10+3])
     311                        line['sgid'] = int(res[i*10+4])
     312                        line['bsize'] = int(res[i*10+5])
     313                        line['tspace'] = self.joinInt(int(res[i*10+6]),int(res[i*10+7]))
     314                        line['uspace'] = self.joinInt(int(res[i*10+8]),int(res[i*10+9]))
     315                        dirs.append(line)
    314316                return tuple(dirs)
    315317
    316318        def getFreeSpaceSummary(self):