예제 #1
0
    def scan_and_index(self):
        project_files = self.compilation_db
        for file_name, compile_command in project_files.items():
            try:
                mod_time = get_file_modtime(file_name)
            except OSError:
                continue
            indexer.add_file_to_parse(file_name, compile_command, mod_time)

        cpp_files_to_reparse = set()
        for header_file_key, origin_file_name in search.leveldb_range_iter(self.leveldb_connection, "h%%%"):
            header_file_name = search.extract_part(header_file_key, 1)
            saved_mod_time = int(self.leveldb_connection.Get("f%%%" + header_file_name))

            try:
                real_mod_time = get_file_modtime(header_file_name)
            except OSError:
                indexer.remove_file_symbols(header_file_name)
                continue

            if real_mod_time <= saved_mod_time:
                continue

            compile_command = project_files[origin_file_name]
            if origin_file_name not in cpp_files_to_reparse:
                cpp_files_to_reparse.add(origin_file_name)
                indexer.add_file_to_parse(origin_file_name, compile_command, real_mod_time)
예제 #2
0
    def scan_and_index(self):
        project_files = self.compilation_db
        for file_name, compile_command in project_files.items():
            try:
                mod_time = get_file_modtime(file_name)
            except OSError:
                continue
            indexer.add_file_to_parse(file_name, compile_command, mod_time)

        cpp_files_to_reparse = set()
        for header_file_key, origin_file_name in search.leveldb_range_iter(
                self.leveldb_connection, "h%%%"):
            header_file_name = search.extract_part(header_file_key, 1)
            saved_mod_time = int(
                self.leveldb_connection.Get("f%%%" + header_file_name))

            try:
                real_mod_time = get_file_modtime(header_file_name)
            except OSError:
                indexer.remove_file_symbols(header_file_name)
                continue

            if real_mod_time <= saved_mod_time:
                continue

            compile_command = project_files[origin_file_name]
            if origin_file_name not in cpp_files_to_reparse:
                cpp_files_to_reparse.add(origin_file_name)
                indexer.add_file_to_parse(origin_file_name, compile_command,
                                          real_mod_time)
예제 #3
0
 def get(self):
     starts_with = self.get_argument('starts_with')
     ret = [
         x for x in search.leveldb_range_iter(
             self.get_project().leveldb_connection, starts_with)
     ]
     self.write(json.dumps(ret))
예제 #4
0
 def get(self):
     starts_with = self.get_argument('starts_with')
     ret = [x for x in search.leveldb_range_iter(g_project.leveldb_connection, starts_with)]
     self.write(json.dumps(ret))