Example #1
0
 def __init__(self, dataset_id=None, namespace=None,
              credentials=None, http=None):
     dataset_id = _determine_default_dataset_id(dataset_id)
     if dataset_id is None:
         raise EnvironmentError('Dataset ID could not be inferred.')
     self.dataset_id = dataset_id
     self.namespace = namespace
     self._batch_stack = _LocalStack()
     super(Client, self).__init__(credentials, http)
Example #2
0
 def __init__(self, project=None, namespace=None,
              credentials=None, http=None):
     project = _determine_default_project(project)
     if project is None:
         raise EnvironmentError('Project could not be inferred.')
     self.project = project
     self.namespace = namespace
     self._batch_stack = _LocalStack()
     super(Client, self).__init__(credentials, http)
Example #3
0
 def __init__(self,
              project=None,
              namespace=None,
              credentials=None,
              http=None):
     _ClientProjectMixin.__init__(self, project=project)
     self.namespace = namespace
     self._batch_stack = _LocalStack()
     super(Client, self).__init__(credentials, http)
Example #4
0
 def __init__(self, dataset_id=None, namespace=None, connection=None):
     dataset_id = _determine_default_dataset_id(dataset_id)
     if dataset_id is None:
         raise EnvironmentError('Dataset ID could not be inferred.')
     self.dataset_id = dataset_id
     if connection is None:
         connection = Connection.from_environment()
     self.connection = connection
     self._batch_stack = _LocalStack()
     self.namespace = namespace
Example #5
0
 def __init__(self, dataset_id=None, namespace=None, connection=None):
     dataset_id = _determine_default_dataset_id(dataset_id)
     if dataset_id is None:
         raise EnvironmentError('Dataset ID could not be inferred.')
     self.dataset_id = dataset_id
     if connection is None:
         connection = Connection.from_environment()
     self.connection = connection
     self._batch_stack = _LocalStack()
     self.namespace = namespace
Example #6
0
 def __init__(self,
              project=None,
              namespace=None,
              credentials=None,
              http=None):
     project = _determine_default_project(project)
     if project is None:
         raise EnvironmentError('Project could not be inferred.')
     self.project = project
     self.namespace = namespace
     self._batch_stack = _LocalStack()
     super(Client, self).__init__(credentials, http)
Example #7
0
 def __init__(self,
              dataset_id=None,
              namespace=None,
              credentials=None,
              http=None):
     dataset_id = _determine_default_dataset_id(dataset_id)
     if dataset_id is None:
         raise EnvironmentError('Dataset ID could not be inferred.')
     self.dataset_id = dataset_id
     self.namespace = namespace
     self._batch_stack = _LocalStack()
     super(Client, self).__init__(credentials, http)
Example #8
0
 def __init__(self, project=None, namespace=None,
              credentials=None, http=None):
     _ClientProjectMixin.__init__(self, project=project)
     self.namespace = namespace
     self._batch_stack = _LocalStack()
     super(Client, self).__init__(credentials, http)
Example #9
0
from email.encoders import encode_noop
from email.generator import Generator
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from email.parser import Parser
import io
import json

import six

from gcloud._helpers import _LocalStack
from gcloud.storage import _implicit_environ
from gcloud.storage.connection import Connection


_BATCHES = _LocalStack()


class MIMEApplicationHTTP(MIMEApplication):
    """MIME type for ``application/http``.

    Constructs payload from headers and body

    :type headers:  dict
    :param headers: HTTP headers

    :type body: text or None
    :param body: HTTP payload
    """
    def __init__(self, method, uri, headers, body):
        if isinstance(body, dict):
Example #10
0
from email.generator import Generator
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from email.parser import Parser
import httplib2
import io
import json

import six

from gcloud._helpers import _LocalStack
from gcloud.exceptions import make_exception
from gcloud.storage import _implicit_environ
from gcloud.storage.connection import Connection

_BATCHES = _LocalStack()


class MIMEApplicationHTTP(MIMEApplication):
    """MIME type for ``application/http``.

    Constructs payload from headers and body

    :type headers:  dict
    :param headers: HTTP headers

    :type body: text or None
    :param body: HTTP payload
    """
    def __init__(self, method, uri, headers, body):
        if isinstance(body, dict):
Example #11
0
 def __init__(self, project=None, credentials=None, http=None):
     self._connection = None
     super(Client, self).__init__(project=project,
                                  credentials=credentials,
                                  http=http)
     self._batch_stack = _LocalStack()
Example #12
0
 def __init__(self, project=None, credentials=None, http=None):
     self._connection = None
     super(Client, self).__init__(project=project, credentials=credentials,
                                  http=http)
     self._batch_stack = _LocalStack()