diff --git a/gcloud/datastore/demo/demo.py b/gcloud/datastore/demo/demo.py index 908d05e9b1af..aff81aad22a2 100644 --- a/gcloud/datastore/demo/demo.py +++ b/gcloud/datastore/demo/demo.py @@ -16,11 +16,12 @@ # Don't worry though. You don't need to do anything, just keep hitting enter... # Let's start by importing the demo module and initializing our connection. +from gcloud import datastore from gcloud.datastore import demo + demo.initialize() # Let's import the package containing our helper classes: -from gcloud import datastore # Let's create a new entity of type "Thing" and name it 'Toy': key = datastore.Key('Thing') diff --git a/gcloud/datastore/helpers.py b/gcloud/datastore/helpers.py index c6178b369ad3..8990c6ce921a 100644 --- a/gcloud/datastore/helpers.py +++ b/gcloud/datastore/helpers.py @@ -17,8 +17,6 @@ The non-private functions are part of the API. """ -__all__ = ('entity_from_protobuf', 'key_from_protobuf') - import calendar import datetime @@ -30,6 +28,8 @@ from gcloud.datastore.entity import Entity from gcloud.datastore.key import Key +__all__ = ('entity_from_protobuf', 'key_from_protobuf') + INT_VALUE_CHECKER = Int64ValueChecker() diff --git a/gcloud/storage/demo/demo.py b/gcloud/storage/demo/demo.py index a2bf29561eaf..ff5912b8913b 100644 --- a/gcloud/storage/demo/demo.py +++ b/gcloud/storage/demo/demo.py @@ -19,14 +19,16 @@ # Don't worry though. You don't need to do anything, just keep hitting enter... # Let's start by importing the demo module and getting a connection: +import time + from gcloud.storage import demo + connection = demo.get_connection() # OK, now let's look at all of the buckets... print(connection.get_all_buckets()) # This might take a second... # Now let's create a new bucket... -import time bucket_name = ("bucket-%s" % time.time()).replace(".", "") # Get rid of dots. print(bucket_name) bucket = connection.create_bucket(bucket_name)