Exemple #1
0
def load_config_from_stream(stream, increment_id=None):
    """Parse a bulkloader.yaml file into bulkloader loader classes.

  Args:
    stream: A stream containing bulkloader.yaml data.
    increment_id: Method IncrementId(key) which will increment the
      auto-allocated ids in the datastore beyond the key.id(). Can be None.

  Returns:
    importer_classes, exporter_classes: Constructors suitable to pass to the
    bulkloader.
  """
    config_globals = {}
    config = bulkloader_parser.load_config(stream, config_globals)
    importer_classes = []
    exporter_classes = []
    for transformer in config.transformers:
        importer, exporter = create_transformer_classes(
            transformer, config_globals, increment_id)
        if importer:
            importer_classes.append(importer)
        if exporter:
            exporter_classes.append(exporter)

    return importer_classes, exporter_classes
def load_config_from_stream(stream, reserve_keys=None):
  """Parse a bulkloader.yaml file into bulkloader loader classes.

  Args:
    stream: A stream containing bulkloader.yaml data.
    reserve_keys: Method ReserveKeys(keys) which will advance the id
        sequence in the datastore beyond each key.id(). Can be None.

  Returns:
    importer_classes, exporter_classes: Constructors suitable to pass to the
    bulkloader.
  """
  config_globals = {}
  config = bulkloader_parser.load_config(stream, config_globals)
  importer_classes = []
  exporter_classes = []
  for transformer in config.transformers:
    importer, exporter = create_transformer_classes(transformer, config_globals,
                                                    reserve_keys)
    if importer:
      importer_classes.append(importer)
    if exporter:
      exporter_classes.append(exporter)

  return importer_classes, exporter_classes
def load_config_from_stream(stream, reserve_keys=None):
  """Parse a bulkloader.yaml file into bulkloader loader classes.

  Args:
    stream: A stream containing bulkloader.yaml data.
    reserve_keys: Method ReserveKeys(keys) which will advance the id
        sequence in the datastore beyond each key.id(). Can be None.

  Returns:
    importer_classes, exporter_classes: Constructors suitable to pass to the
    bulkloader.
  """
  config_globals = {}
  config = bulkloader_parser.load_config(stream, config_globals)
  importer_classes = []
  exporter_classes = []
  for transformer in config.transformers:
    importer, exporter = create_transformer_classes(transformer, config_globals,
                                                    reserve_keys)
    if importer:
      importer_classes.append(importer)
    if exporter:
      exporter_classes.append(exporter)

  return importer_classes, exporter_classes
Exemple #4
0
def load_config_from_stream(stream, increment_id=None):
  """Parse a bulkloader.yaml file into bulkloader loader classes.

  Args:
    stream: A stream containing bulkloader.yaml data.
    increment_id: Method IncrementId(key) which will increment the
      auto-allocated ids in the datastore beyond the key.id(). Can be None.

  Returns:
    importer_classes, exporter_classes: Constructors suitable to pass to the
    bulkloader.
  """
  config_globals = {}
  config = bulkloader_parser.load_config(stream, config_globals)
  importer_classes = []
  exporter_classes = []
  for transformer in config.transformers:
    importer, exporter = create_transformer_classes(transformer, config_globals,
                                                    increment_id)
    if importer:
      importer_classes.append(importer)
    if exporter:
      exporter_classes.append(exporter)

  return importer_classes, exporter_classes
def load_config_from_stream(stream):
  """Parse a bulkloader.yaml file into bulkloader loader classes.

  Args:
    stream: A stream containing bulkloader.yaml data.

  Returns:
    importer_classes, exporter_classes: Constructors suitable to pass to the
    bulkloader.
  """
  config_globals = {}
  config = bulkloader_parser.load_config(stream, config_globals)
  importer_classes = []
  exporter_classes = []
  for transformer in config.transformers:
    importer, exporter = create_transformer_classes(transformer, config_globals)
    if importer:
      importer_classes.append(importer)
    if exporter:
      exporter_classes.append(exporter)

  return importer_classes, exporter_classes
def load_config_from_stream(stream):
    """Parse a bulkloader.yaml file into bulkloader loader classes.

  Args:
    stream: A stream containing bulkloader.yaml data.

  Returns:
    importer_classes, exporter_classes: Constructors suitable to pass to the
    bulkloader.
  """
    config_globals = {}
    config = bulkloader_parser.load_config(stream, config_globals)
    importer_classes = []
    exporter_classes = []
    for transformer in config.transformers:
        importer, exporter = create_transformer_classes(
            transformer, config_globals)
        if importer:
            importer_classes.append(importer)
        if exporter:
            exporter_classes.append(exporter)

    return importer_classes, exporter_classes