(self)
convenience attrs for direct querying really.
convenience attrs for direct querying really.
convenience attrs for direct querying really .
def Refresh(self):
    """convenience attrs for direct querying really."""

    self._attributes = _DictFromDiskutilInfo(self.deviceid)
    # We iterate over all known keys, yes this includes DeviceIdentifier
    # even though we"re using deviceid internally for init.
    # This is why the rest of the code has gratuitous use of
    # disable-msg=E1101 due to constructing the attributes this way.
    keys = ["Content", "Internal", "CanBeMadeBootableRequiresDestroy",
            "MountPoint", "DeviceNode", "SystemImage", "CanBeMadeBootable",
            "SupportsGlobalPermissionsDisable", "VolumeName",
            "DeviceTreePath", "DeviceIdentifier", "VolumeUUID", "Bootable",
            "BusProtocol", "Ejectable", "MediaType", "RAIDSlice",
            "FilesystemName", "RAIDMaster", "WholeDisk", "FreeSpace",
            "TotalSize", "GlobalPermissionsEnabled", "SMARTStatus",
            "Writable", "ParentWholeDisk", "MediaName"]

    for key in keys:
      try:
        attribute = key.lower().replace(" ", "")
        setattr(self, attribute, self._attributes[key])
      # pylint: disable=pointless-except
      except KeyError:  # not all objects have all these attributes
        pass

    if self.busprotocol == "Disk Image":  # pylint: disable=no-member
      self.diskimage = True
    else:
      self.diskimage = False
def Refresh ( self ) : self . _attributes = _DictFromDiskutilInfo ( self . deviceid ) # We iterate over all known keys, yes this includes DeviceIdentifier # even though we"re using deviceid internally for init. # This is why the rest of the code has gratuitous use of # disable-msg=E1101 due to constructing the attributes this way. keys = [ "Content" , "Internal" , "CanBeMadeBootableRequiresDestroy" , "MountPoint" , "DeviceNode" , "SystemImage" , "CanBeMadeBootable" , "SupportsGlobalPermissionsDisable" , "VolumeName" , "DeviceTreePath" , "DeviceIdentifier" , "VolumeUUID" , "Bootable" , "BusProtocol" , "Ejectable" , "MediaType" , "RAIDSlice" , "FilesystemName" , "RAIDMaster" , "WholeDisk" , "FreeSpace" , "TotalSize" , "GlobalPermissionsEnabled" , "SMARTStatus" , "Writable" , "ParentWholeDisk" , "MediaName" ] for key in keys : try : attribute = key . lower ( ) . replace ( " " , "" ) setattr ( self , attribute , self . _attributes [ key ] ) # pylint: disable=pointless-except except KeyError : # not all objects have all these attributes pass if self . busprotocol == "Disk Image" : # pylint: disable=no-member self . diskimage = True else : self . diskimage = False