Make RBClient cookie_file optional
Review Request #3913 — Created Feb. 25, 2013 and submitted
Make RBClient cookie_file optional If a cookie_file is not provided it will now default to '~/.rbtools-cookies'. Also, if we default to '~/.rbtools-cookies' and it does not exist, we will attempt to copy the old '~/.post-review-cookies.txt' file over.
Accessed the API using default and provided cookie files, observed proper behaviour.
Description | From | Last Updated |
---|---|---|
Should optimistically import from cStringIO, like: try: from cStringIO import StringIO except ImportError: from StringIO import StringIO |
chipx86 | |
We need to be careful with this. I'm not sure we want to do it this way. With just post-review, … |
chipx86 | |
Col: 43 E128 continuation line under-indented for visual indent |
reviewbot | |
We should catch any IOErrors here. There may be permission problems we should log but not die from. |
chipx86 | |
Indentation is off. |
chipx86 |
-
-
Should optimistically import from cStringIO, like: try: from cStringIO import StringIO except ImportError: from StringIO import StringIO
-
We need to be careful with this. I'm not sure we want to do it this way. With just post-review, we knew that we were *the* app, and we knew what we were writing. We don't know that with an API. os.umask could easily break a consumer. I'd suggest we check for the existence of the file, and if it's not there, create it and chmod, then reference it. Actually, this would be a good time to do an import of .post-review-cookies.txt, too. If the cookie file is missing, and we have a .post-review-cookies.txt, copy it over.
SM
- Change Summary:
-
Update based on Christian's review.
- Description:
-
Make RBClient cookie_file optional
If a cookie_file is not provided it will now default to
~ '~/.rbtools-cookies'. ~ '~/.rbtools-cookies'. Also, if we default to '~/.rbtools-cookies' and + it does not exist, we will attempt to copy the old + '~/.post-review-cookies.txt' file over.
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: rbtools/api/transport/sync.py rbtools/api/request.py rbtools/commands/__init__.py Ignored Files:
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: rbtools/api/transport/sync.py rbtools/api/request.py rbtools/commands/__init__.py Ignored Files: