def get_file_type(self, path): full_path = FileUtils.get_full_path(path) relative_path = FileUtils.get_rid_of_prefix_path(full_path, self.root) root = relative_path.split(os.path.sep)[0] if root == 'test': return 'test_file' elif root == 'include': return 'header_file' elif root == 'src': return 'src_file' else: return None
def get_relative_path(self, path): relative_path = FileUtils.get_rid_of_prefix_path(path, self.root) if relative_path.split(os.path.sep)[0] == 'include': relative_path = FileUtils.get_rid_of_top_path(relative_path) return FileUtils.get_rid_of_top_path(relative_path)