Example #1
0
 def __init__(self, client=None):
     """Constructs an ImportAttempt."""
     if not client:
         client = utils.create_datastore_client()
     self.client = client
     self.database = import_attempt_database.ImportAttemptDatabase(
         self.client)
Example #2
0
    def __init__(self, kind, client=None, id_field=None):
        """Constructs an BaseDatabase.

        Args:
            kind: Kind of entities stored
            client: Client to communicate with Datastore.
            id_field: Name of the ID field of an entity as a string.
                Every operation checks if id_field is not already a field in the
                entity. If not, it will be added to the entity with the value of
                the key name.
        """
        if not client:
            client = utils.create_datastore_client()
        self.kind = kind
        self.client = client
        self.id_field = id_field
Example #3
0
    def __init__(self, client=None, message_manager=None):
        """Constructs a ProgressLog.

        Args:
            client: datastore Client object used to communicate with Datastore.
            message_manager: LogMessageManager object used to store and retreive
                log messages.
        """
        if not client:
            client = utils.create_datastore_client()
        self.client = client
        self.run_database = system_run_database.SystemRunDatabase(self.client)
        self.log_database = progress_log_database.ProgressLogDatabase(
            self.client, message_manager)
        self.attempt_database = import_attempt_database.ImportAttemptDatabase(
            self.client)
Example #4
0
 def __init__(self, client=None):
     """Constructs a SystemRun."""
     if not client:
         client = utils.create_datastore_client()
     self.client = client
     self.database = system_run_database.SystemRunDatabase(self.client)