gir: batch-add user typelib search paths

This commit is contained in:
Peter Eisenmann 2024-03-29 01:31:05 +01:00
parent 07e824d8e7
commit f2d4643bf5
2 changed files with 6 additions and 7 deletions

View file

@ -37,8 +37,9 @@ _xml_cache = {}
_user_search_paths = []
def add_typelib_search_path(path: str):
_user_search_paths.append(path)
def add_user_typelib_paths(paths: list):
global _user_search_paths
_user_search_paths += paths
def get_namespace(namespace: str, version: str) -> "Namespace":

View file

@ -26,7 +26,7 @@ import typing as T
from . import formatter, interactive_port, parser, tokenizer
from .errors import CompileError, CompilerBugError, PrintableError, report_bug
from .gir import add_typelib_search_path
from .gir import add_user_typelib_paths
from .lsp import LanguageServer
from .outputs import XmlOutput
from .utils import Colors
@ -135,8 +135,7 @@ class BlueprintApp:
def cmd_compile(self, opts):
if opts.typelib_path != None:
for typelib_path in opts.typelib_path:
add_typelib_search_path(typelib_path)
add_user_typelib_paths(opts.typelib_path)
data = opts.input.read()
try:
@ -156,8 +155,7 @@ class BlueprintApp:
def cmd_batch_compile(self, opts):
if opts.typelib_path != None:
for typelib_path in opts.typelib_path:
add_typelib_search_path(typelib_path)
add_user_typelib_paths(opts.typelib_path)
for file in opts.inputs:
data = file.read()