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

get_fields from template string is impossible with / #960

Open
francoisgfx opened this issue Feb 15, 2024 · 1 comment
Open

get_fields from template string is impossible with / #960

francoisgfx opened this issue Feb 15, 2024 · 1 comment

Comments

@francoisgfx
Copy link

francoisgfx commented Feb 15, 2024

Hello,

Getting fields from a template string is impossible if it contains some "/".

For example if you look at the config here : https://github.com/ue4plugins/tk-config-unrealbasic/blob/0686e53d9d26027507fc45f03d6e7935a9512a4f/env/includes/unreal/templates.yml#L104

The reason is because get_fields, calls TemplatePathParser, which does a os.path.normpath().

so on Windows a string like /Game/Level/ is going to be converted to \\Game\\Level\\

Is there another way to extract fields from a string ?

Cheers

F.

@francoisgfx
Copy link
Author

the issue I see is that TemplatePath are normpath() when doing the split_path(). But TemplateString are not calling the split_path() which seems correct. But get_fields will always try to normpath the input. So if a string contains / it will always fail.

An idea would be to add an arg as get_fields(normpath=True) by default and force it to False when called from TempalteString

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

1 participant