original_docstring: Asks the user to provide the VSS store identifiers.
  
      Args:
        volume_system: The volume system (instance of dfvfs.VShadowVolumeSystem).
        volume_identifiers: List of allowed volume identifiers.
        vss_stores: Optional list of preferred VSS stored identifiers. The
                    default is None.
  
      Returns:
        The list of selected VSS store identifiers or None.
  
      Raises:
        SourceScannerError: if the source cannot be processed.
      
docstring: Asks the user to provide the VSS store identifiers.
docstring_tokens: Asks the user to provide the VSS store identifiers .
code: def _GetVssStoreIdentifiersFromUser(
        self, volume_system, volume_identifiers, vss_stores=None):
      """Asks the user to provide the VSS store identifiers.
  
      Args:
        volume_system: The volume system (instance of dfvfs.VShadowVolumeSystem).
        volume_identifiers: List of allowed volume identifiers.
        vss_stores: Optional list of preferred VSS stored identifiers. The
                    default is None.
  
      Returns:
        The list of selected VSS store identifiers or None.
  
      Raises:
        SourceScannerError: if the source cannot be processed.
      """
      normalized_volume_identifiers = []
      for volume_identifier in volume_identifiers:
        volume = volume_system.GetVolumeByIdentifier(volume_identifier)
        if not volume:
          raise errors.SourceScannerError(
              u'Volume missing for identifier: {0:s}.'.format(volume_identifier))
  
        try:
          volume_identifier = int(volume.identifier[3:], 10)
          normalized_volume_identifiers.append(volume_identifier)
        except ValueError:
          pass
  
      if vss_stores:
        if not set(vss_stores).difference(
            normalized_volume_identifiers):
          return vss_stores
  
      print_header = True
      while True:
        if print_header:
          self._output_writer.Write(
              u'The following Volume Shadow Snapshots (VSS) were found:\n'
              u'Identifier\tVSS store identifier\tCreation Time\n')
  
          for volume_identifier in volume_identifiers:
            volume = volume_system.GetVolumeByIdentifier(volume_identifier)
            if not volume:
              raise errors.SourceScannerError(
                  u'Volume missing for identifier: {0:s}.'.format(
                      volume_identifier))
  
            vss_identifier = volume.GetAttribute('identifier')
            vss_creation_time = volume.GetAttribute('creation_time')
            vss_creation_time = timelib.Timestamp.FromFiletime(
                vss_creation_time.value)
            vss_creation_time = timelib.Timestamp.CopyToIsoFormat(
                vss_creation_time)
            self._output_writer.Write(u'{0:s}\t\t{1:s}\t{2:s}\n'.format(
                volume.identifier, vss_identifier.value, vss_creation_time))
  
          self._output_writer.Write(u'\n')
  
          print_header = False
  
        self._output_writer.Write(
            u'Please specify the identifier(s) of the VSS that should be '
            u'processed:\nNote that a range of stores can be defined as: 3..5. '
            u'Multiple stores can\nbe defined as: 1,3,5 (a list of comma '
            u'separated values). Ranges and lists can\nalso be combined '
            u'as: 1,3..5. The first store is 1. If no stores are specified\n'
            u'none will be processed. You can abort with Ctrl^C.\n')
  
        selected_vss_stores = self._input_reader.Read()
  
        selected_vss_stores = selected_vss_stores.strip()
        if not selected_vss_stores:
          break
  
        try:
          selected_vss_stores = self._ParseVssStores(selected_vss_stores)
        except errors.BadConfigOption:
          selected_vss_stores = []
  
        if not set(selected_vss_stores).difference(normalized_volume_identifiers):
          break
  
        self._output_writer.Write(
            u'\n'
            u'Unsupported VSS identifier(s), please try again or abort with '
            u'Ctrl^C.\n'
            u'\n')
  
      return selected_vss_stores
code_tokens: def _GetVssStoreIdentifiersFromUser ( self , volume_system , volume_identifiers , vss_stores = None ) : normalized_volume_identifiers = [ ] for volume_identifier in volume_identifiers : volume = volume_system . GetVolumeByIdentifier ( volume_identifier ) if not volume : raise errors . SourceScannerError ( u'Volume missing for identifier: {0:s}.' . format ( volume_identifier ) ) try : volume_identifier = int ( volume . identifier [ 3 : ] , 10 ) normalized_volume_identifiers . append ( volume_identifier ) except ValueError : pass if vss_stores : if not set ( vss_stores ) . difference ( normalized_volume_identifiers ) : return vss_stores print_header = True while True : if print_header : self . _output_writer . Write ( u'The following Volume Shadow Snapshots (VSS) were found:\n' u'Identifier\tVSS store identifier\tCreation Time\n' ) for volume_identifier in volume_identifiers : volume = volume_system . GetVolumeByIdentifier ( volume_identifier ) if not volume : raise errors . SourceScannerError ( u'Volume missing for identifier: {0:s}.' . format ( volume_identifier ) ) vss_identifier = volume . GetAttribute ( 'identifier' ) vss_creation_time = volume . GetAttribute ( 'creation_time' ) vss_creation_time = timelib . Timestamp . FromFiletime ( vss_creation_time . value ) vss_creation_time = timelib . Timestamp . CopyToIsoFormat ( vss_creation_time ) self . _output_writer . Write ( u'{0:s}\t\t{1:s}\t{2:s}\n' . format ( volume . identifier , vss_identifier . value , vss_creation_time ) ) self . _output_writer . Write ( u'\n' ) print_header = False self . _output_writer . Write ( u'Please specify the identifier(s) of the VSS that should be ' u'processed:\nNote that a range of stores can be defined as: 3..5. ' u'Multiple stores can\nbe defined as: 1,3,5 (a list of comma ' u'separated values). Ranges and lists can\nalso be combined ' u'as: 1,3..5. The first store is 1. If no stores are specified\n' u'none will be processed. You can abort with Ctrl^C.\n' ) selected_vss_stores = self . _input_reader . Read ( ) selected_vss_stores = selected_vss_stores . strip ( ) if not selected_vss_stores : break try : selected_vss_stores = self . _ParseVssStores ( selected_vss_stores ) except errors . BadConfigOption : selected_vss_stores = [ ] if not set ( selected_vss_stores ) . difference ( normalized_volume_identifiers ) : break self . _output_writer . Write ( u'\n' u'Unsupported VSS identifier(s), please try again or abort with ' u'Ctrl^C.\n' u'\n' ) return selected_vss_stores
short_docstring: Asks the user to provide the VSS store identifiers.
short_docstring_tokens: Asks the user to provide the VSS store identifiers .
comment: """Asks the user to provide the VSS store identifiers.
  
      Args:
        volume_system: The volume system (instance of dfvfs.VShadowVolumeSystem).
        volume_identifiers: List of allowed volume identifiers.
        vss_stores: Optional list of preferred VSS stored identifiers. The
                    default is None.
  
      Returns:
        The list of selected VSS store identifiers or None.
  
      Raises:
        SourceScannerError: if the source cannot be processed.
      """