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
Added support for load_map_from_string in BaseWMSFactory.loadXML method (2) #27
Conversation
Hi Piotr, Having this would be great for testing. I'd prefer to have this as a different parameter, as both are strings and current one is named xmlfile. Would you mind modifying it to be something like:
And then xmlstring != None will use it and ignore xmlfile. What do you think? |
I doesn't want to adding new parameter in loadXML definition because I want to interfere in the code as little as possible but I'm OK with your suggestion. What do you think to modified it like this: def loadXML(self, xmlfile=None, strict=False, xmlstring=None): so user don't need to set xmlfile if he use only xmlstring? It shouldn't also break any earlier compatibility. |
looks good, can you also create a test so the new code gets covered? |
Add test for load_map_from_string
Hi |
Hi, looks good. One final petition before merge. We should check xmlfile and xmlstring are not both empty, in that case we should raise and Exception explaining one of the two options is mandatory (since we changed xmlfile from mandatory to optional). |
Is this should rise OGCException, ServerConfigurationError or I should add new exception type? |
I'd say this is a configuration error.
|
I've added checking xmlfile and xmlstring variables, test for checking exception and I've clear some unnecessary imports in previous test. |
Added support for load_map_from_string in BaseWMSFactory.loadXML method (2)
Perfect! Thanks! |
Hi,
This pull request adds possibility to load mapnik XML configuration from string using load_map_from_string function. There is a check if 'xmlfile' is existing file (os.path.isfile) - if not 'load_map_from_string' will be used.
This is second pull request after #26 - earlier I've add wrong checkig - sorry for that.
Regards
Piotr Pociask