MCPcopy Create free account
hub / github.com/s3tools/s3cmd / DistributionList

Class DistributionList

S3/CloudFront.py:83–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81 return S3Uri(u"cf://%s" % self.info['Id'])
82
83class DistributionList(object):
84 ## Example:
85 ##
86 ## <DistributionList xmlns="http://cloudfront.amazonaws.com/doc/2010-07-15/">
87 ## <Marker />
88 ## <MaxItems>100</MaxItems>
89 ## <IsTruncated>false</IsTruncated>
90 ## <DistributionSummary>
91 ## ... handled by DistributionSummary() class ...
92 ## </DistributionSummary>
93 ## </DistributionList>
94
95 def __init__(self, xml):
96 tree = getTreeFromXml(xml)
97 if tree.tag != "DistributionList":
98 raise ValueError("Expected <DistributionList /> xml, got: <%s />" % tree.tag)
99 self.parse(tree)
100
101 def parse(self, tree):
102 self.info = getDictFromTree(tree)
103 ## Normalise some items
104 self.info['IsTruncated'] = (self.info['IsTruncated'].lower() == "true")
105
106 self.dist_summs = []
107 for dist_summ in tree.findall(".//DistributionSummary"):
108 self.dist_summs.append(DistributionSummary(dist_summ))
109
110class Distribution(object):
111 ## Example:

Callers 1

GetListMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…