Mercurial > piecrust2
comparison piecrust/data/assetor.py @ 1113:29c51b981c17
data: Rename JSON-ifier function.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 21 Feb 2018 21:21:42 -0800 |
parents | b2a34a6ec5e5 |
children | 0aeb6f18d6a0 |
comparison
equal
deleted
inserted
replaced
1112:a3dec0fbd9ce | 1113:29c51b981c17 |
---|---|
19 self.uri = uri | 19 self.uri = uri |
20 | 20 |
21 def __str__(self): | 21 def __str__(self): |
22 return self.uri | 22 return self.uri |
23 | 23 |
24 def json(self): | 24 def as_json(self): |
25 with open(self.content_item.spec, 'r', encoding='utf8') as fp: | 25 with open(self.content_item.spec, 'r', encoding='utf8') as fp: |
26 return json.load(fp) | 26 return json.load(fp) |
27 | 27 |
28 | 28 |
29 class Assetor: | 29 class Assetor: |