Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible python scripst improvements? #209

Open
blattms opened this issue Mar 14, 2024 · 4 comments
Open

Possible python scripst improvements? #209

blattms opened this issue Mar 14, 2024 · 4 comments

Comments

@blattms
Copy link
Member

blattms commented Mar 14, 2024

  • Would be cool to have a working default for --maindir if the scripts are called from the root directory of the git repo checkout
  • --filename option is misleading as it actually needs a path. Maybe it is better to skip name and just use --file?
@hakonhagland
Copy link
Collaborator

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
Copy link
Member Author

blattms commented Mar 15, 2024

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

@hakonhagland
Copy link
Collaborator

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
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants