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

Class Distribution

S3/CloudFront.py:110–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108 self.dist_summs.append(DistributionSummary(dist_summ))
109
110class Distribution(object):
111 ## Example:
112 ##
113 ## <Distribution xmlns="http://cloudfront.amazonaws.com/doc/2010-07-15/">
114 ## <Id>1234567890ABC</Id>
115 ## <Status>InProgress</Status>
116 ## <LastModifiedTime>2009-01-16T13:07:11.319Z</LastModifiedTime>
117 ## <DomainName>blahblahblah.cloudfront.net</DomainName>
118 ## <DistributionConfig>
119 ## ... handled by DistributionConfig() class ...
120 ## </DistributionConfig>
121 ## </Distribution>
122
123 def __init__(self, xml):
124 tree = getTreeFromXml(xml)
125 if tree.tag != "Distribution":
126 raise ValueError("Expected <Distribution /> xml, got: <%s />" % tree.tag)
127 self.parse(tree)
128
129 def parse(self, tree):
130 self.info = getDictFromTree(tree)
131 ## Normalise some items
132 self.info['LastModifiedTime'] = dateS3toPython(self.info['LastModifiedTime'])
133
134 self.info['DistributionConfig'] = DistributionConfig(tree = tree.find(".//DistributionConfig"))
135
136 def uri(self):
137 return S3Uri(u"cf://%s" % self.info['Id'])
138
139class DistributionConfig(object):
140 ## Example:

Callers 2

CreateDistributionMethod · 0.85
GetDistInfoMethod · 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…