Riverscapes / QRAVEPlugin

QGIS Plugin for viewing Riverscapes projects
0 stars 0 forks source link

V2 Compatibility #74

Closed kunztr closed 1 year ago

kunztr commented 2 years ago

Added functionality to handle V2 businesslogic (syncing V2 files, determining when to use V2 files, ensuring old projects still work)

MattReimer commented 2 years 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'