OPM / opm-reference-manual

Other
1 stars 5 forks source link

Possible python scripst improvements? #209

Open blattms opened 6 months ago

blattms commented 6 months ago
hakonhagland commented 6 months ago

Would be cool to have a working default for --maindir if the scripts are called from the root directory of the git repo

@blattms Maybe.. I always called the scripts like this:

$ cd scripts/python
$ poetry shell
$ fodt-remove-span-tags --filename=main.fodt

then --maindir is not needed since the default value is ../../parts. If we call the script from the root of the git repo instead we need to specify --maindir like this:

$ fodt-remove-span-tags --filename=main.fodt --maindir=parts

since now the maindir is in parts relative to the root.

blattms commented 6 months ago

Why a user should cd into a subirectory to call a script? So the filename is a path relative to maindir?

hakonhagland commented 6 months ago

Good point. The idea was that these scripts might not be something that you want to install globally on your system since they are only useful inside the opm-reference-manual repository. So then the user should rather activate the poetry virtual environment before running the scripts.

hakonhagland commented 6 months ago

I agree that the scripts behave strangely/unexpectedly if installed globally. I will try to fix it.