• Home
  • Raw
  • Download

Lines Matching +full:dir +full:- +full:glob

19       dir
20 directory from which files will be taken -- only used if
38 def findall(self, dir=os.curdir): argument
39 self.allfiles = findall(dir)
49 # -- List-like methods ---------------------------------------------
65 # -- Other miscellaneous utility methods ---------------------------
69 for i in range(len(self.files) - 1, 0, -1):
70 if self.files[i] == self.files[i - 1]:
74 # -- "File template" methods ---------------------------------------
80 patterns = dir = dir_pattern = None
83 'global-include', 'global-exclude'):
88 elif action in ('recursive-include', 'recursive-exclude'):
91 "'%s' expects <dir> <pattern1> <pattern2> ..." % action)
92 dir = convert_path(words[1])
102 return (action, patterns, dir, dir_pattern)
109 # patterns, (dir and patterns), or (dir_pattern).
110 (action, patterns, dir, dir_pattern) = self._parse_template_line(line)
113 # right number of words on the line for that action -- so we
114 # can proceed with minimal error-checking.
126 log.warn(("warning: no previously-included files "
129 elif action == 'global-include':
130 self.debug_print("global-include " + ' '.join(patterns))
136 elif action == 'global-exclude':
137 self.debug_print("global-exclude " + ' '.join(patterns))
140 log.warn(("warning: no previously-included files matching "
144 elif action == 'recursive-include':
145 self.debug_print("recursive-include %s %s" %
146 (dir, ' '.join(patterns)))
148 if not self.include_pattern(pattern, prefix=dir):
151 pattern, dir)
153 elif action == 'recursive-exclude':
154 self.debug_print("recursive-exclude %s %s" %
155 (dir, ' '.join(patterns)))
157 if not self.exclude_pattern(pattern, prefix=dir):
158 log.warn(("warning: no previously-included files matching "
160 pattern, dir)
171 log.warn(("no previously-included directories found "
178 # -- Filtering/selection methods -----------------------------------
182 match 'pattern', a Unix-style wildcard (glob) pattern. Patterns
184 and '?' match non-special characters, where "special" is platform-
198 regex object -- no translation is done, the regex is just compiled
199 and used as-is.
235 for i in range(len(self.files)-1, -1, -1):
243 # ----------------------------------------------------------------------
258 def findall(dir=os.curdir): argument
260 Find all files under 'dir' and return the list of full filenames.
261 Unless dir is '.', return full filenames with dir prepended.
263 files = _find_all_simple(dir)
264 if dir == os.curdir:
265 make_rel = functools.partial(os.path.relpath, start=dir)
271 """Translate a shell-like glob pattern to a regular expression; return
274 platform-specific).
278 # '?' and '*' in the glob pattern become '.' and '.*' in the RE, which
279 # IMHO is wrong -- '?' and '*' aren't supposed to match slash in Unix,
281 # any OS. So change all non-escaped dots in the RE to match any
294 """Translate a shell-like wildcard pattern to a compiled regular
297 or just returned as-is (assumes it's a regex object).
317 prefix_re = prefix_re[len(start): len(prefix_re) - len(end)]
321 pattern_re = pattern_re[len(start): len(pattern_re) - len(end)]
323 else: # no prefix -- respect anchor flag