Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Unified Diff: third_party/boto/boto/pyami/config.py

Issue 698893003: Update checked in version of gsutil to version 4.6 (Closed) Base URL: http://dart.googlecode.com/svn/third_party/gsutil/
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/boto/boto/provider.py ('k') | third_party/boto/boto/rds/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/boto/boto/pyami/config.py
===================================================================
--- third_party/boto/boto/pyami/config.py (revision 33376)
+++ third_party/boto/boto/pyami/config.py (working copy)
@@ -20,20 +20,15 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
-import StringIO, os, re
-import warnings
import ConfigParser
+import os
+import re
+import StringIO
+import warnings
+
import boto
+from boto.compat import expanduser
-# If running in Google App Engine there is no "user" and
-# os.path.expanduser() will fail. Attempt to detect this case and use a
-# no-op expanduser function in this case.
-try:
- os.path.expanduser('~')
- expanduser = os.path.expanduser
-except (AttributeError, ImportError):
- # This is probably running on App Engine.
- expanduser = (lambda x: x)
# By default we use two locations for the boto configurations,
# /etc/boto.cfg and ~/.boto (which works on Windows and Unix).
@@ -42,7 +37,7 @@
UserConfigPath = os.path.join(expanduser('~'), '.boto')
BotoConfigLocations.append(UserConfigPath)
-# If there's a BOTO_CONFIG variable set, we load ONLY
+# If there's a BOTO_CONFIG variable set, we load ONLY
# that variable
if 'BOTO_CONFIG' in os.environ:
BotoConfigLocations = [expanduser(os.environ['BOTO_CONFIG'])]
@@ -149,14 +144,14 @@
except:
val = default
return val
-
+
def getint(self, section, name, default=0):
try:
val = ConfigParser.SafeConfigParser.getint(self, section, name)
except:
val = int(default)
return val
-
+
def getfloat(self, section, name, default=0.0):
try:
val = ConfigParser.SafeConfigParser.getfloat(self, section, name)
@@ -174,13 +169,13 @@
else:
val = default
return val
-
+
def setbool(self, section, name, value):
if value:
self.set(section, name, 'true')
else:
self.set(section, name, 'false')
-
+
def dump(self):
s = StringIO.StringIO()
self.write(s)
@@ -196,7 +191,7 @@
fp.write('%s = xxxxxxxxxxxxxxxxxx\n' % option)
else:
fp.write('%s = %s\n' % (option, self.get(section, option)))
-
+
def dump_to_sdb(self, domain_name, item_name):
from boto.compat import json
sdb = boto.connect_sdb()
« no previous file with comments | « third_party/boto/boto/provider.py ('k') | third_party/boto/boto/rds/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698