comparison decoupage/web.py @ 98:abf23c2e4e82

make sure all hashes are ordered
author Jeff Hammel <k0scist@gmail.com>
date Mon, 22 Aug 2016 18:19:07 -0700
parents 21273cdb2047
children 82ee67b95a0c
comparison
equal deleted inserted replaced
97:a31de0eaf565 98:abf23c2e4e82
9 # 9 #
10 # oops. Handle it better 10 # oops. Handle it better
11 # - either # is a magic hide character 11 # - either # is a magic hide character
12 # - or you urlescape that guy 12 # - or you urlescape that guy
13 13
14 # OrderedDict
15 14
16 import os 15 import os
17 import sys 16 import sys
18 17
19 from collections import OrderedDict 18 from collections import OrderedDict
283 data['size'] = os.path.getsize(filepath) 282 data['size'] = os.path.getsize(filepath)
284 files.append(data) 283 files.append(data)
285 284
286 # TODO: deal with other links in conf 285 # TODO: deal with other links in conf
287 for i in conf: 286 for i in conf:
287
288 if i in filenames or i.startswith('/'): 288 if i in filenames or i.startswith('/'):
289 continue 289 continue
290 if i.startswith('http://') or i.startswith('https://'): 290 if i.startswith('http://') or i.startswith('https://'):
291 files.append({'path': i, 291 files.append({'path': i,
292 'name': i, 292 'name': i,
338 conf[key] = value 338 conf[key] = value
339 339
340 # cache configuration 340 # cache configuration
341 if not self.auto_reload: 341 if not self.auto_reload:
342 if not hasattr(self, '_conf'): 342 if not hasattr(self, '_conf'):
343 self._conf = {} 343 self._conf = OrderedDict()
344 self._conf[path_tuple] = conf 344 self._conf[path_tuple] = conf
345 345
346 return conf 346 return conf
347 347
348 def get_formatters(self, path): 348 def get_formatters(self, path):