comparison piecrust/page.py @ 458:612ed0526afd

internal: Just use the plain old standard function.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 09 Jul 2015 22:30:45 -0700
parents 96d363e2da4b
children 683be25cbdb2
comparison
equal deleted inserted replaced
457:7d868afc6791 458:612ed0526afd
1 import re 1 import re
2 import sys 2 import sys
3 import json 3 import json
4 import codecs
5 import os.path 4 import os.path
6 import hashlib 5 import hashlib
7 import logging 6 import logging
8 import datetime 7 import datetime
9 import dateutil.parser 8 import dateutil.parser
268 content = json_load_segments(cache_data['content']) 267 content = json_load_segments(cache_data['content'])
269 return config, content, True 268 return config, content, True
270 269
271 # Nope, load the page from the source file. 270 # Nope, load the page from the source file.
272 logger.debug("Loading page configuration from: %s" % path) 271 logger.debug("Loading page configuration from: %s" % path)
273 with codecs.open(path, 'r', 'utf-8') as fp: 272 with open(path, 'r', encoding='utf-8') as fp:
274 raw = fp.read() 273 raw = fp.read()
275 header, offset = parse_config_header(raw) 274 header, offset = parse_config_header(raw)
276 275
277 if 'format' not in header: 276 if 'format' not in header:
278 auto_formats = app.config.get('site/auto_formats') 277 auto_formats = app.config.get('site/auto_formats')