# HG changeset patch # User Oleg Oshmyan # Date 1308581529 -10800 # Node ID 0d657576b1ac34dbd8544a0d81a443713287cb00 # Parent 88e1e6786f678ec07f60d63375ec4cae3f7d112b tests directories are now searched for within archives diff -r 88e1e6786f67 -r 0d657576b1ac upreckon/files.py --- a/upreckon/files.py Mon Jun 20 16:00:45 2011 +0300 +++ b/upreckon/files.py Mon Jun 20 17:52:09 2011 +0300 @@ -5,7 +5,7 @@ from __future__ import division, with_statement from .compat import * -import contextlib, os, shutil, sys +import contextlib, os, posixpath, shutil, sys # You don't need to know about anything else. __all__ = 'File', @@ -205,11 +205,10 @@ return True return False - def realize_path_archive(self, archive, root, virtpath, archpath): + def realize_path_archive(self, archive, root, virtpath, archpath, hastests=False): if root and not archive.exists(root): return False - if root: path = '/'.join((root, virtpath[0])) - else: path = virtpath[0] + path = posixpath.join(root, virtpath[0]) if len(virtpath) > 1: if self.realize_path_archive(archive, path, virtpath[1:], archpath): return True @@ -221,6 +220,9 @@ self.real_path = path self.full_real_path = os.path.join(archpath, *path.split('/')) return True + if not hastests: + if self.realize_path_archive(archive, posixpath.join(root, 'tests'), virtpath, archpath, True): + return True return False def open(self):