Skip to content

Conversation

@daspecster
Copy link
Contributor

@daspecster daspecster commented Oct 25, 2016

These snippets don't run yet but the docs build and pull them.
@dhermes suggested I could merged this in before getting them to run.

I'm not sure about removing the imports for some snippets. It seems like those a nice to have?

@daspecster daspecster added docs api: storage Issues related to the Cloud Storage API. labels Oct 25, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 25, 2016
@dhermes
Copy link
Contributor

dhermes commented Oct 25, 2016

@daspecster I have already started a review and noticed a new commit come in. Should I stop reviewing / is it stable?

@daspecster
Copy link
Contributor Author

@dhermes sorry yeah I was getting travis to pass.

I updated the PR's original description with a question though.

I'm not sure about removing the imports for some snippets. It seems like those a nice to have?

@daspecster
Copy link
Contributor Author

#stilltryingtogettravistopass....



def _millis():
return time.time() * 1000

This comment was marked as spam.

This comment was marked as spam.

need to be deleted during teardown.
"""

import time

This comment was marked as spam.


client = storage.Client(project='my-project')
bucket = client.get_bucket('my-bucket')
encryption_key = 'aa426195405adee2c8081bb9e7e74b19'

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

print(bucket.get_blob('/path/to/blob.txt'))
# <Blob: my-bucket, /path/to/blob.txt>
print(bucket.get_blob('/does-not-exist.txt'))
# None

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

except AssertionError as e:
print(' FAIL: %s' % (e,))
except Exception as e: # pylint: disable=broad-except
print(' ERROR: %r' % (e,))

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Oct 25, 2016

RE:

#stilltryingtogettravistopass....

Why can't you run these on your local machine?

@daspecster
Copy link
Contributor Author

daspecster commented Oct 25, 2016

They passed on my local machine(falsely). I keep having to delete my .tox folder for lint and docs to pick up changes and I forget sometimes.

Copy link
Contributor

@dhermes dhermes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah shucks. Many of those asserts ended up being not so useful, in particular the isinstance ones.

Hold off on this until I get the Pub/Sub rewrite proof-of-concept going?

blob = bucket.get_blob('/remote/path/to/file.txt')
print(blob.download_as_string())

(blob.download_as_string())

This comment was marked as spam.

This comment was marked as spam.

@daspecster
Copy link
Contributor Author

@dhermes am I good to go on this then?

@dhermes
Copy link
Contributor

dhermes commented Nov 14, 2016

@daspecster Not sure what you are referring to. You should definitely rebase and get the CIs green before merging..


If you are asking about the assets, I said before

Yeah, don't block this PR based on the ongoing discussion. But you should be uniform and use assert instead

@daspecster daspecster force-pushed the add-storage-snippets branch 2 times, most recently from 47b0ec8 to a589a13 Compare November 14, 2016 18:47
@daspecster
Copy link
Contributor Author

Ok, squashed and we'll see if Travis runs it in a timely fashion.

@daspecster daspecster merged commit ce6756f into googleapis:master Dec 1, 2016
@daspecster daspecster deleted the add-storage-snippets branch December 1, 2016 15:16
richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants