def collect(obj): """ Collect ALL upload files in preparation for submission. Args: obj (ConductorJob): The item whose attributes define the scan. Returns: PathList: All file dependencies. """ result = PathList() # policy: NONE, GLOB, SMART_SEQUENCE policy = obj.get_attribute("dependency_scan_policy").get_long() # If we are not localizing reference contexts, then we need to add the # referenced project files to the dependencies list. include_references = not obj.get_attribute("localize_contexts").get_bool() result.add(*_get_system_dependencies()) result.add(*_get_extra_uploads(obj)) result.add(*get_scan(obj, policy, include_references)) # tell the list to look on disk and expand any "*" or <UDIM> in place result.glob() return result
def test_glob_dedups_when_many_files_match(self): glob.populate(Sequence.create("1-20").expand("/some/file.####.exr")) d = PathList() files = ["/some/file.*.exr", "/some/*.exr"] d.add(*files) d.glob() self.assertEqual(len(d), 20)
def test_glob_when_files_dont_match(self): glob.populate(Sequence.create("1-20").expand("/other/file.####.exr")) d = PathList() file = "/some/file.*.exr" d.add(file) d.glob() self.assertEqual(len(d), 0)
def test_glob_when_files_match_with_questoion_mark(self): glob.populate(Sequence.create("1-20").expand("/some/file.####.exr")) d = PathList() file = "/some/file.00?0.exr" d.add(file) d.glob() self.assertEqual(len(d), 2)
def test_glob_leaves_non_existent_unglobbable_entries_untouched(self): glob.populate(Sequence.create("1-3").expand("/some/file.####.exr")) d = PathList() d.add("/some/file.*.exr", "/other/file1.exr", "/other/file2.exr") d.glob() self.assertEqual(len(d), 5)