Example #1
0
    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
Example #2
0
    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
Example #3
0
 def get_location(self, project):
     return expand(self._get_project(project)['location'])
Example #4
0
 def _expand(self, string):
     return expand(string)
Example #5
0
 def from_file(cls, filename):
     return cls(BuilderConfig(load_yaml(expand(filename))))
Example #6
0
 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))
Example #7
0
 def get_location(self, project):
     return expand(self._get_project(project)['location'])
Example #8
0
 def _expand(self, string):
     return expand(string)
Example #9
0
 def from_file(cls, filename):
     return cls(BuilderConfig(load_yaml(expand(filename))))
Example #10
0
 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)
     )