original_docstring: List available snapshots. If a snapshot name is supplied,
      give more detailed info.
  
      Return 0 on success, 1 on failure.
docstring: List available snapshots. If a snapshot name is supplied,
  give more detailed info.
  
  Return 0 on success, 1 on failure.
docstring_tokens: List available snapshots . If a snapshot name is supplied give more detailed info . Return 0 on success 1 on failure .
code: def list_command(args, filename):
      """List available snapshots. If a snapshot name is supplied,
      give more detailed info.
  
      Return 0 on success, 1 on failure."""
  
      LOGGER.debug('In subcommand list.')
      os.chdir(args.project)
  
      with open(filename, 'r') as metafile:
          json_object = json.load(metafile)
          LOGGER.info('Loaded json data from ' + filename)
          LOGGER.debug(json_object)
  
      if args.name_was_given:
          entry = check_for_snapshot_entry(args.name, json_object)
          if not entry:
              LOGGER.error('Snapshot entry ' + args.name + ' does not exist.')
              return 1
          else:
              LOGGER.info('Detailed info for snapshot ' + entry['name'] + ':')
              if entry['description'] != '':
                  LOGGER.info('Description: ' + entry['description'])
              LOGGER.info('Date: ' + entry['date'])
              LOGGER.info('Openframeworks:')
              LOGGER.info('  path: ' + entry['core']['path'])
              LOGGER.info('  SHA: ' + entry['core']['sha'])
              LOGGER.info('Addons:')
              for addon in entry['addons']:
                  LOGGER.info('  name: ' + addon['name'])
                  LOGGER.info('  SHA: ' + addon['sha'])
              return 0
      else:
          LOGGER.info('Available snapshots:')
          for snapshot in json_object['snapshots']:
              temp_string = '  ' + snapshot['name']
              if snapshot['description'] != '':
                  temp_string += (': ' + snapshot['description'])
              LOGGER.info(temp_string)
          LOGGER.info('Get more information by specifying desired ' +
                      'snapshot with -n <name>.')
          return 0
code_tokens: def list_command ( args , filename ) : LOGGER . debug ( 'In subcommand list.' ) os . chdir ( args . project ) with open ( filename , 'r' ) as metafile : json_object = json . load ( metafile ) LOGGER . info ( 'Loaded json data from ' + filename ) LOGGER . debug ( json_object ) if args . name_was_given : entry = check_for_snapshot_entry ( args . name , json_object ) if not entry : LOGGER . error ( 'Snapshot entry ' + args . name + ' does not exist.' ) return 1 else : LOGGER . info ( 'Detailed info for snapshot ' + entry [ 'name' ] + ':' ) if entry [ 'description' ] != '' : LOGGER . info ( 'Description: ' + entry [ 'description' ] ) LOGGER . info ( 'Date: ' + entry [ 'date' ] ) LOGGER . info ( 'Openframeworks:' ) LOGGER . info ( '  path: ' + entry [ 'core' ] [ 'path' ] ) LOGGER . info ( '  SHA: ' + entry [ 'core' ] [ 'sha' ] ) LOGGER . info ( 'Addons:' ) for addon in entry [ 'addons' ] : LOGGER . info ( '  name: ' + addon [ 'name' ] ) LOGGER . info ( '  SHA: ' + addon [ 'sha' ] ) return 0 else : LOGGER . info ( 'Available snapshots:' ) for snapshot in json_object [ 'snapshots' ] : temp_string = '  ' + snapshot [ 'name' ] if snapshot [ 'description' ] != '' : temp_string += ( ': ' + snapshot [ 'description' ] ) LOGGER . info ( temp_string ) LOGGER . info ( 'Get more information by specifying desired ' + 'snapshot with -n <name>.' ) return 0
short_docstring: List available snapshots.
short_docstring_tokens: List available snapshots .
comment: """List available snapshots. If a snapshot name is supplied,
      give more detailed info.
  
      Return 0 on success, 1 on failure."""