def __init__(self, filepaths: List[Union[Path, str]], *args, depends=None, cwd=None, **kwargs): if depends is None: depends = [] if cwd is None: cwd = current_project().build_path super().__init__(EventKind.GENERATOR, PathList(cwd, *filepaths), *args, depends=depends, cwd=cwd, **kwargs)
class PathListTestCase(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.lst = PathList(Path('/tmp'), '1', '2') def test_nominal(self): self.assertTrue(self.lst.absolute() == [Path('/tmp/1'), Path('/tmp/2')]) lst = copy.deepcopy(self.lst) lst.append(Path('/usr/lib')) print(lst.absolute()) self.assertTrue(lst.absolute( ) == [Path('/tmp/1'), Path('/tmp/2'), Path('/usr/lib')]) def test_update_path_list(self): lst = copy.deepcopy(self.lst) lst.extend(PathList(Path('/usr'), 'lib')) self.assertTrue(lst.absolute( ) == [Path('/tmp/1'), Path('/tmp/2'), Path('/usr/lib')])
def test_update_path_list(self): lst = copy.deepcopy(self.lst) lst.extend(PathList(Path('/usr'), 'lib')) self.assertTrue(lst.absolute( ) == [Path('/tmp/1'), Path('/tmp/2'), Path('/usr/lib')])
def __init__(self, datapath: Path = Path.cwd()): self._paths = PathList(datapath)
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.lst = PathList(Path('/tmp'), '1', '2')
def make_link_dirs_option(self, link_dirs: PathList): return [f'/LIBPATH:{d.as_posix()}' for d in link_dirs.absolute()]
def make_include_dirs_option(self, include_dirs: PathList): return [f'/I{d.as_posix()}' for d in include_dirs.absolute()]
def make_link_dirs_option(self, link_dirs: PathList): return [f'-L{d}' for d in link_dirs.absolute()]
def make_include_dirs_option(self, include_dirs: PathList): return [f'-I{d}' for d in include_dirs.absolute()]