parameters: (all=False)
return_statement: return retlist
docstring: Return system disk partitions.
docstring_summary: Return system disk partitions.
docstring_tokens: Return system disk partitions .
function: def disk_partitions(all=False):
      """Return system disk partitions."""
      # TODO - the filtering logic should be better checked so that
      # it tries to reflect 'df' as much as possible
      retlist = []
      partitions = cext.disk_partitions()
      for partition in partitions:
          device, mountpoint, fstype, opts = partition
          if device == 'none':
              device = ''
          if not all:
              # Differently from, say, Linux, we don't have a list of
              # common fs types so the best we can do, AFAIK, is to
              # filter by filesystem having a total size > 0.
              if not disk_usage(mountpoint).total:
                  continue
          ntuple = _common.sdiskpart(device, mountpoint, fstype, opts)
          retlist.append(ntuple)
      return retlist
function_tokens: def disk_partitions ( all = False ) : # TODO - the filtering logic should be better checked so that # it tries to reflect 'df' as much as possible retlist = [ ] partitions = cext . disk_partitions ( ) for partition in partitions : device , mountpoint , fstype , opts = partition if device == 'none' : device = '' if not all : # Differently from, say, Linux, we don't have a list of # common fs types so the best we can do, AFAIK, is to # filter by filesystem having a total size > 0. if not disk_usage ( mountpoint ) . total : continue ntuple = _common . sdiskpart ( device , mountpoint , fstype , opts ) retlist . append ( ntuple ) return retlist