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

Remove quotes in mappyfile.findall() #61

Closed
kdeininger opened this Issue Jul 13, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@kdeininger

kdeininger commented Jul 13, 2018

The function mappyfile.findall() takes the specified value and adds single and double quotes as possible values to search for:

possible_values = ("'%s'" % value, '"%s"' % value)
return (item for item in lst if item[key.lower()] in possible_values)

But the result of the parsed mapfile contains the values (e.g. group or layer names) without any quotes and mappyfile.findall() always returns an empty generator object.

In my case, I could fix it by passing the specified value directly:

return (item for item in lst if item[key.lower()] == value)

Is there something wrong with my parsed content or needs this function to be fixed? mappyfile.find() works fine.

@geographika

This comment has been minimized.

Show comment
Hide comment
@geographika

geographika Jul 14, 2018

Owner

@kdeininger - thanks for reporting this. The addition of quotes are left over from early versions of mappyfile which didn't strip them automatically from the parse tree.
I'll add the fix and a test for this shortly.

Owner

geographika commented Jul 14, 2018

@kdeininger - thanks for reporting this. The addition of quotes are left over from early versions of mappyfile which didn't strip them automatically from the parse tree.
I'll add the fix and a test for this shortly.

geographika added a commit that referenced this issue Jul 17, 2018

@geographika

This comment has been minimized.

Show comment
Hide comment
@geographika

geographika Jul 24, 2018

Owner

Fixed in 0.7.2 release

Owner

geographika commented Jul 24, 2018

Fixed in 0.7.2 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment