The cleanmymac.util Module¶
-
class
cleanmymac.util.Dir(path)¶ Bases:
tuplea single directory
-
count(value) → integer -- return number of occurrences of value¶
-
index(value[, start[, stop]]) → integer -- return first index of value.¶ Raises ValueError if the value is not present.
-
path¶ Alias for field number 0
-
-
class
cleanmymac.util.DirList(dirs)¶ Bases:
tuplea list of directories
-
count(value) → integer -- return number of occurrences of value¶
-
dirs¶ Alias for field number 0
-
index(value[, start[, stop]]) → integer -- return first index of value.¶ Raises ValueError if the value is not present.
-
-
class
cleanmymac.util.DiskUsage(total, used, free)¶ Bases:
tuplea
collections.namedtuple()holding disk usage statistics-
count(value) → integer -- return number of occurrences of value¶
-
free¶ Alias for field number 2
-
index(value[, start[, stop]]) → integer -- return first index of value.¶ Raises ValueError if the value is not present.
-
total¶ Alias for field number 0
-
used¶ Alias for field number 1
-
-
cleanmymac.util.delete_dir_content(folder)[source]¶ delete all the files and directories in path
Parameters: folder (Dir) – a valid directory path
-
cleanmymac.util.delete_dirs(dir_list)[source]¶ delete all directories in list
Parameters: dir_list (DirList) – the list of directories
-
cleanmymac.util.get_disk_usage(path='/', unit=1024)[source]¶ retrieve disk usage statistics for a given path this function was inspired by the following stackoverflow discussion: http://stackoverflow.com/questions/787776/find-free-disk-space-in-python-on-os-x
Parameters: Returns: the usage statistics
Return type: