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

fix wrong conditional for build custom_rules.tmpl.xml #1544

Merged
merged 1 commit into from
Dec 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pythonforandroid/bootstraps/common/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def make_package(args):
join(res_dir, 'values/strings.xml'),
**render_args)

if exists("custom_rules.tmpl.xml"):
if exists(join("templates", "custom_rules.tmpl.xml")):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how this works if you fixed the first path in the exists condition, but not the render one which I would have expected to be the same 🤔

Copy link
Contributor Author

@bit4bit bit4bit Dec 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, because os.path.exists check on filesystem and not use jinja2.Environment, render it's a local function that use the jinja2.Environment.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AndreMiras it works because of this line:

(which sets up the environment to be located inside templates, so jinja2 naturally looks in there)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you guys, clear!

render(
'custom_rules.tmpl.xml',
'custom_rules.xml',
Expand Down