コード例 #1
0
ファイル: project.py プロジェクト: SkidanovAlex/py-ctrlk
    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
ファイル: project.py プロジェクト: SkidanovAlex/py-ctrlk
    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
ファイル: project.py プロジェクト: SkidanovAlex/py-ctrlk
    def parse_file(self, file_name):
        try:
            origin_file, compile_command, mod_time = self.get_file_args(file_name)
        except OSError as e:
            if e.errno != 2:
                raise
            else:
                print >>sys.stderr, "Unable to stat() %s: %s" % (file_name, e)
                return

        indexer.add_file_to_parse(origin_file, compile_command, mod_time)
コード例 #4
0
ファイル: project.py プロジェクト: SkidanovAlex/py-ctrlk
    def parse_file(self, file_name):
        try:
            origin_file, compile_command, mod_time = self.get_file_args(
                file_name)
        except OSError as e:
            if e.errno != 2:
                raise
            else:
                print >> sys.stderr, "Unable to stat() %s: %s" % (file_name, e)
                return

        indexer.add_file_to_parse(origin_file, compile_command, mod_time)
コード例 #5
0
ファイル: project.py プロジェクト: pombredanne/py-ctrlk
 def parse_file(self, file_name):
     origin_file, compile_command, mod_time = self.get_file_args(file_name)
     indexer.add_file_to_parse(origin_file, compile_command, mod_time)