Mercurial > piecrust2
comparison piecrust/osutil.py @ 529:6f1f45fb7790
cm: Re-fix Mac file-system wrappers.
Man, I shouldn't write code with a headache.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 28 Jul 2015 22:16:22 -0700 |
parents | fa9eb8f866cd |
children | 6ef89b31ddda |
comparison
equal
deleted
inserted
replaced
528:cf3218766fe2 | 529:6f1f45fb7790 |
---|---|
22 name = _from_osx_fs(name) | 22 name = _from_osx_fs(name) |
23 yield name | 23 yield name |
24 | 24 |
25 def _glob(pathname): | 25 def _glob(pathname): |
26 pathname = _to_osx_fs(pathname) | 26 pathname = _to_osx_fs(pathname) |
27 matches = _glob.glob(pathname) | 27 matches = _system_glob.glob(pathname) |
28 return list(map(_from_osx_fs, matches)) | 28 return list(map(_from_osx_fs, matches)) |
29 | 29 |
30 def _from_osx_fs(s): | 30 def _from_osx_fs(s): |
31 return unicodedata.normalize('NFC', s) | 31 return unicodedata.normalize('NFC', s) |
32 | 32 |
33 def _to_osx_fs(s): | 33 def _to_osx_fs(s): |
34 return unicodedata.ucd_3_2_0.normalize('NFD', s) | 34 return unicodedata.ucd_3_2_0.normalize('NFD', s) |
35 | 35 |
36 global walk, listdir, glob | |
37 | |
36 walk = _walk | 38 walk = _walk |
37 listdir = _listdir | 39 listdir = _listdir |
38 glob = _glob | 40 glob = _glob |
39 | 41 |