def get_files(self, project): ignored = self.get_ignored(project) print 'ignored:', ignored location = expand(self.get_location(project)) all_files = [] for root, dirs, files in os.walk(location): for f in files: filepath = os.path.join(root, f) relative_path = filepath[len(location) + 1:] if relative_path in ignored: continue s = os.stat(filepath) mimetype, encoding = mimetypes.guess_type(f, strict=False) all_files.append({ 'name': os.path.basename(filepath), 'path': relative_path, 'size': s.st_size, 'modified_time': s.st_mtime, 'kind': '', 'mimetype': mimetype or '', }) return all_files
def get_location(self, project): return expand(self._get_project(project)['location'])
def _expand(self, string): return expand(string)
def from_file(cls, filename): return cls(BuilderConfig(load_yaml(expand(filename))))
def _create_shell(self): "Creates a ShellProxy from the config." return ShellProxy(executable=expand(self.config.get_shell(self.name)), sources=self.config.get_sources(self.name))
def _create_shell(self): "Creates a ShellProxy from the config." return ShellProxy( executable=expand(self.config.get_shell(self.name)), sources=self.config.get_sources(self.name) )