mirror of
https://github.com/smyalygames/FiniteVolumeGPU.git
synced 2025-09-15 11:42:18 +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:
|
def get_project_root() -> Path:
|
||||||
"""
|
"""
|
||||||
Gets the root directory of the project.
|
Gets the root directory of the project.
|
||||||
"""
|
"""
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
return Path(__file__).parent.parent.parent
|
return Path(__file__).parent.parent.parent
|
||||||
|
|
||||||
|
|
||||||
@ -21,6 +19,8 @@ def get_includes(file: str, local: bool = False) -> list[str]:
|
|||||||
Returns:
|
Returns:
|
||||||
A list of the includes (without ``#include ""``) from the given string.
|
A list of the includes (without ``#include ""``) from the given string.
|
||||||
"""
|
"""
|
||||||
|
import re
|
||||||
|
|
||||||
pattern = '^\\W*#include\\W+(.+?)\\W*$'
|
pattern = '^\\W*#include\\W+(.+?)\\W*$'
|
||||||
if local:
|
if local:
|
||||||
pattern = '^\\W*#include\\s+"(.+?)"\\W*$'
|
pattern = '^\\W*#include\\s+"(.+?)"\\W*$'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user