MCPcopy Create free account
hub / github.com/ActiveState/code / GetFreeSpace

Method GetFreeSpace

recipes/Python/578977_Python_SQLSMO_/recipe-578977.py:395–414  ·  view source on GitHub ↗

Returns dictionary with drive letters and free space in GB C 11.553 D 26.849 E 31.829 F 64.230

(self)

Source from the content-addressed store, hash-verified

393 return self.dictfiles, self.dictheader
394
395 def GetFreeSpace(self):
396 """
397 Returns dictionary with drive letters and free space in GB
398 C 11.553 D 26.849 E 31.829 F 64.230
399 """
400
401 self.dictfreespace = {}
402 rows, fnames = [], []
403 try:
404 rows, fnames = SqlExecute(self.conn, self.sqlxp_fixeddrives)
405 except Exception as inst:
406 print('Error getting disk space', inst)
407 return self.dictfreespace
408
409 i = 0
410
411 for x in rows:
412 self.dictfreespace[x[0]] = str(float(rows[i][1])/1000) # changing to gb
413 i += 1
414 return self.dictfreespace
415
416 def Ok_to_restore(self):
417 """

Callers 1

Ok_to_restoreMethod · 0.95

Calls 3

SqlExecuteFunction · 0.85
printFunction · 0.85
strFunction · 0.85

Tested by

no test coverage detected