mirror of
https://github.com/smyalygames/FiniteVolumeGPU.git
synced 2025-09-14 11:12:17 +02:00
refactor(common): make utils imports local
This commit is contained in:
parent
8783be2d32
commit
0d9d47136d
@ -1,11 +1,9 @@
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def get_project_root() -> Path:
|
||||
"""
|
||||
Gets the root directory of the project.
|
||||
"""
|
||||
from pathlib import Path
|
||||
|
||||
return Path(__file__).parent.parent.parent
|
||||
|
||||
|
||||
@ -21,6 +19,8 @@ def get_includes(file: str, local: bool = False) -> list[str]:
|
||||
Returns:
|
||||
A list of the includes (without ``#include ""``) from the given string.
|
||||
"""
|
||||
import re
|
||||
|
||||
pattern = '^\\W*#include\\W+(.+?)\\W*$'
|
||||
if local:
|
||||
pattern = '^\\W*#include\\s+"(.+?)"\\W*$'
|
||||
|
Loading…
x
Reference in New Issue
Block a user