Exemple #1
0
    def get(self, *args, **kwargs):
        path = self.get_argument('path', '')
        include_files = self.get_argument('includeFiles', None)
        file_types = self.get_argument('fileTypes', '')

        return json_encode(
            foldersAtPath(path, True,
                          bool(int(include_files) if include_files else False),
                          file_types.split(',')))
    def get(self, *args, **kwargs):
        term = self.get_argument('term')
        include_files = self.get_argument('includeFiles', None)
        file_types = self.get_argument('fileTypes', '')

        return self.write(json_encode([entry['path'] for entry in foldersAtPath(
            os.path.dirname(term),
            includeFiles=bool(int(include_files) if include_files else False),
            fileTypes=file_types.split(',')
        ) if 'path' in entry]))
    def handle_get(self):
        path = self.get_argument('path', '')
        include_files = self.get_argument('includeFiles', None)
        file_types = self.get_argument('fileTypes', '')

        return self.write(
            json_encode(
                foldersAtPath(
                    path, True,
                    bool(int(include_files) if include_files else False),
                    file_types.split(','))))