Closed kunztr closed 1 year ago
@kunztr we talked about a few ideas
use regexes and move bespoke strings up into a GLOBAL variable at the top of the file
VERSIONS = {
"V1": "\/V1\/[a-zA-Z]+.xsd",
"V2": "\/V2\/RiverscapesProject.xsd",
}
SCHEMALOCATION_ATTRIB = '{http://www.w3.org/2001/XMLSchema-instance}noNamespaceSchemaLocation'
# Then you can match it with regexesx
if(re.match(VERSIONS["V1"], <address here>)):
self.version == 'V1'
Added functionality to handle V2 businesslogic (syncing V2 files, determining when to use V2 files, ensuring old projects still work)