| 81 | return S3Uri(u"cf://%s" % self.info['Id']) |
| 82 | |
| 83 | class 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 | |
| 110 | class Distribution(object): |
| 111 | ## Example: |
no outgoing calls
no test coverage detected
searching dependent graphs…