Lines Matching refs:self

174   def __init__(self, sums_file_name):
175 self.sums = {}
176 self.sums_file_name = sums_file_name
178 def Load(self):
182 sums_file = open(self.sums_file_name, 'rb')
183 self.sums = pickle.load(sums_file)
191 def Save(self):
193 sums_file = open(self.sums_file_name, 'wb')
194 pickle.dump(self.sums, sums_file)
200 os.unlink(self.sums_file_name)
206 def FilterUnchangedFiles(self, files):
212 if not file in self.sums or self.sums[file] != file_sum:
214 self.sums[file] = file_sum
219 def RemoveFile(self, file):
220 if file in self.sums:
221 self.sums.pop(file)
230 def RunOnPath(self, path):
234 for file in self.GetPathsToSearch():
235 all_files += self.FindFilesIn(join(path, file))
236 return self.ProcessFiles(all_files)
238 def RunOnFiles(self, files):
246 search_paths = [('' if p == '.' else p) for p in self.GetPathsToSearch()]
251 if (not self.IgnoreFile(f.LocalPath()) and
252 self.IsRelevant(f.LocalPath()) and
253 all(not self.IgnoreDir(d) for d in dirs(f.LocalPath())) and
257 return self.ProcessFiles(all_files)
259 def IgnoreDir(self, name):
264 def IgnoreFile(self, name):
267 def FindFilesIn(self, path):
270 for ignored in [x for x in dirs if self.IgnoreDir(x)]:
273 if not self.IgnoreFile(file) and self.IsRelevant(file):
285 def __init__(self, use_cache, cache_file_path, file_type):
286 self.use_cache = use_cache
287 self.cache_file_path = cache_file_path
288 self.file_type = file_type
290 def GetProcessorWorker(self):
294 def GetProcessorScript(self):
299 def GetProcessorCommand(self):
300 format_processor, options = self.GetProcessorScript()
302 print('Could not find the formatter for % files' % self.file_type)
310 def ProcessFiles(self, files):
311 if self.use_cache:
312 cache = FileContentsCache(self.cache_file_path)
317 print('No changes in %s files detected. Skipping check' % self.file_type)
320 files_requiring_changes = self.DetectFilesToChange(files)
323 (self.file_type, len(files_requiring_changes)))
324 if self.use_cache:
332 def DetectFilesToChange(self, files):
333 command = self.GetProcessorCommand()
334 worker = self.GetProcessorWorker()
360 def __init__(self, use_cache=True):
361 super(CppLintProcessor, self).__init__(
364 def IsRelevant(self, name):
367 def IgnoreDir(self, name):
368 return (super(CppLintProcessor, self).IgnoreDir(name)
379 def IgnoreFile(self, name):
380 return (super(CppLintProcessor, self).IgnoreFile(name)
383 def GetPathsToSearch(self):
388 def GetProcessorWorker(self):
391 def GetProcessorScript(self):
404 def __init__(self, use_cache=True):
405 super(TorqueLintProcessor, self).__init__(
409 def IsRelevant(self, name):
412 def GetPathsToSearch(self):
417 def GetProcessorWorker(self):
420 def GetProcessorScript(self):
433 def __init__(self, use_cache=True):
434 super(JSLintProcessor, self).__init__(
438 def IsRelevant(self, name):
441 def GetPathsToSearch(self):
444 def GetProcessorWorker(self):
447 def GetProcessorScript(self):
462 def __init__(self):
463 self.runtime_function_call_pattern = self.CreateRuntimeFunctionCallMatcher()
465 def CreateRuntimeFunctionCallMatcher(self):
482 def FindFilesIn(self, path):
489 if self.IgnoreDir(dir_part):
492 if (self.IsRelevant(file) and os.path.exists(file)
493 and not self.IgnoreFile(file)):
497 return super(SourceProcessor, self).FindFilesIn(path)
499 def IsRelevant(self, name):
505 def GetPathsToSearch(self):
508 def IgnoreDir(self, name):
509 return (super(SourceProcessor, self).IgnoreDir(name) or
551 def EndOfDeclaration(self, line):
554 def StartOfDeclaration(self, line):
559 def ProcessContents(self, name, contents):
609 match = self.runtime_function_call_pattern.search(contents)
615 def ProcessFiles(self, files):
622 if len(contents) > 0 and not self.ProcessContents(file, contents):
676 def IsRelevant(self, name):
681 def GetPathsToSearch(self):
684 def ProcessFiles(self, files):
686 for status_file_path in sorted(self._GetStatusFiles(files)):
691 def _GetStatusFiles(self, files):