diff options
author | Takayuki Shimizukawa <shimizukawa@gmail.com> | 2014-08-03 16:22:08 +0900 |
---|---|---|
committer | Takayuki Shimizukawa <shimizukawa@gmail.com> | 2014-08-03 16:22:08 +0900 |
commit | eaed3ca9f1a1ed1ff2c1ee1ab67bb1949919babe (patch) | |
tree | 6ec992bee2914ecaf4c9ee0b8f395a964d9655ed /tests/util.py | |
parent | eb8dbf4631598985250cd585a0779e94d49055dc (diff) | |
download | sphinx-git-eaed3ca9f1a1ed1ff2c1ee1ab67bb1949919babe.tar.gz |
Automatically compile ``*.mo`` files from ``*.po`` files.
Diffstat (limited to 'tests/util.py')
-rw-r--r-- | tests/util.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/util.py b/tests/util.py index 24c548b2b..2e2f96655 100644 --- a/tests/util.py +++ b/tests/util.py @@ -7,6 +7,7 @@ :license: BSD, see LICENSE for details. """ +import os import sys import tempfile import shutil @@ -233,3 +234,11 @@ def sprint(*args): _unicode_literals_re = re.compile(r'u(".*?")|u(\'.*?\')') def remove_unicode_literals(s): return _unicode_literals_re.sub(lambda x: x.group(1) or x.group(2), s) + + +def find_files(root, suffix=None): + for dirpath, dirs, files in os.walk(root, followlinks=True): + dirpath = path(dirpath) + for f in [f for f in files if not suffix or f.endswith(suffix)]: + fpath = dirpath / f + yield os.path.relpath(fpath, root) |