summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Garnaat <mitch@garnaat.com>2012-03-27 19:17:24 -0700
committerMitch Garnaat <mitch@garnaat.com>2012-03-27 19:17:24 -0700
commit3e66569fb9345c10ed6ed057689f924d415a1000 (patch)
tree80454617e5707b7e3af30c755a289abf08d033d2
parenta25a740196290e9cabf81ae38de963545f49b057 (diff)
downloadboto-3e66569fb9345c10ed6ed057689f924d415a1000.tar.gz
PEP8 and pyflakes cleanup.
-rw-r--r--boto/cloudformation/__init__.py2
-rw-r--r--boto/cloudformation/connection.py12
-rw-r--r--boto/cloudformation/stack.py33
-rw-r--r--boto/cloudformation/template.py28
-rw-r--r--setup.py5
5 files changed, 70 insertions, 10 deletions
diff --git a/boto/cloudformation/__init__.py b/boto/cloudformation/__init__.py
index bc32bbab..c995c608 100644
--- a/boto/cloudformation/__init__.py
+++ b/boto/cloudformation/__init__.py
@@ -15,7 +15,7 @@
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
diff --git a/boto/cloudformation/connection.py b/boto/cloudformation/connection.py
index b0221bef..29b73cc7 100644
--- a/boto/cloudformation/connection.py
+++ b/boto/cloudformation/connection.py
@@ -14,7 +14,7 @@
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
@@ -118,11 +118,11 @@ class CloudFormationConnection(AWSQueryConnection):
" specified, only TemplateBody will be honored by the API")
if len(parameters) > 0:
for i, (key, value) in enumerate(parameters):
- params['Parameters.member.%d.ParameterKey' % (i+1)] = key
- params['Parameters.member.%d.ParameterValue' % (i+1)] = value
+ params['Parameters.member.%d.ParameterKey' % (i + 1)] = key
+ params['Parameters.member.%d.ParameterValue' % (i + 1)] = value
if capabilities:
for i, value in enumerate(capabilities):
- params['Capabilities.member.%d' % (i+1)] = value
+ params['Capabilities.member.%d' % (i + 1)] = value
if len(notification_arns) > 0:
self.build_list_params(params, notification_arns,
"NotificationARNs.member")
@@ -188,8 +188,8 @@ class CloudFormationConnection(AWSQueryConnection):
" specified, only TemplateBody will be honored by the API")
if len(parameters) > 0:
for i, (key, value) in enumerate(parameters):
- params['Parameters.member.%d.ParameterKey' % (i+1)] = key
- params['Parameters.member.%d.ParameterValue' % (i+1)] = value
+ params['Parameters.member.%d.ParameterKey' % (i + 1)] = key
+ params['Parameters.member.%d.ParameterValue' % (i + 1)] = value
if len(notification_arns) > 0:
self.build_list_params(params, notification_arns,
"NotificationARNs.member")
diff --git a/boto/cloudformation/stack.py b/boto/cloudformation/stack.py
index 8b9e1157..4ad67b22 100644
--- a/boto/cloudformation/stack.py
+++ b/boto/cloudformation/stack.py
@@ -1,7 +1,30 @@
-from datetime import datetime
+# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
+# All Rights Reserved
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish, dis-
+# tribute, sublicense, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the fol-
+# lowing conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+from datetime import datetime
from boto.resultset import ResultSet
+
class Stack:
def __init__(self, connection=None):
self.connection = connection
@@ -91,6 +114,7 @@ class Stack:
def get_template(self):
return self.connection.get_template(stack_name_or_id=self.stack_id)
+
class StackSummary:
def __init__(self, connection=None):
self.connection = connection
@@ -122,6 +146,7 @@ class StackSummary:
else:
setattr(self, name, value)
+
class Parameter:
def __init__(self, connection=None):
self.connection = None
@@ -142,6 +167,7 @@ class Parameter:
def __repr__(self):
return "Parameter:\"%s\"=\"%s\"" % (self.key, self.value)
+
class Output:
def __init__(self, connection=None):
self.connection = connection
@@ -165,6 +191,7 @@ class Output:
def __repr__(self):
return "Output:\"%s\"=\"%s\"" % (self.key, self.value)
+
class StackResource:
def __init__(self, connection=None):
self.connection = connection
@@ -207,6 +234,7 @@ class StackResource:
return "StackResource:%s (%s)" % (self.logical_resource_id,
self.resource_type)
+
class StackResourceSummary:
def __init__(self, connection=None):
self.connection = connection
@@ -241,9 +269,12 @@ class StackResourceSummary:
return "StackResourceSummary:%s (%s)" % (self.logical_resource_id,
self.resource_type)
+
class StackEvent:
+
valid_states = ("CREATE_IN_PROGRESS", "CREATE_FAILED", "CREATE_COMPLETE",
"DELETE_IN_PROGRESS", "DELETE_FAILED", "DELETE_COMPLETE")
+
def __init__(self, connection=None):
self.connection = connection
self.event_id = None
diff --git a/boto/cloudformation/template.py b/boto/cloudformation/template.py
index f1f85018..0c968346 100644
--- a/boto/cloudformation/template.py
+++ b/boto/cloudformation/template.py
@@ -1,5 +1,29 @@
+# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2011 Amazon.com, Inc. or its affiliates.
+# All Rights Reserved
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish, dis-
+# tribute, sublicense, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the fol-
+# lowing conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
from boto.resultset import ResultSet
+
class Template:
def __init__(self, connection=None):
self.connection = connection
@@ -8,7 +32,8 @@ class Template:
def startElement(self, name, attrs, connection):
if name == "Parameters":
- self.template_parameters = ResultSet([('member', TemplateParameter)])
+ self.template_parameters = ResultSet([('member',
+ TemplateParameter)])
return self.template_parameters
else:
return None
@@ -19,6 +44,7 @@ class Template:
else:
setattr(self, name, value)
+
class TemplateParameter:
def __init__(self, parent):
self.parent = parent
diff --git a/setup.py b/setup.py
index 01110576..64984f22 100644
--- a/setup.py
+++ b/setup.py
@@ -75,6 +75,9 @@ setup(name = "boto",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
- "Programming Language :: Python :: 2.7"],
+ "Programming Language :: Python :: 2.7",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.1",
+ "Programming Language :: Python :: 3.2"],
**extra
)