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

Remove quotes in mappyfile.findall() #61

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

Remove quotes in mappyfile.findall() #61

kdeininger opened this issue Jul 13, 2018 · 2 comments

Comments

@kdeininger
Copy link

@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
Copy link
Owner

@geographika 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
Copy link
Owner

@geographika 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.