def valid_input_file(self, filename): """ Function to validate input file if requested""" if not self.validate: #not asked to validate logging.debug("Not validating %s" % (filename) ) return True else: #Validate TCXv1, note are validating against gpsbabels 'broken' result... xslfile = os.path.realpath(self.pytrainer_main.data_path)+ "/schemas/GarminTrainingCenterDatabase_v1-gpsbabel.xsd" from lib.xmlValidation import xmlValidator validator = xmlValidator() return validator.validateXSL(filename, xslfile)
def valid_input_file(self, filename): """ Function to validate input file if requested""" if not self.validate: #not asked to validate logging.debug("Not validating %s" % (filename) ) return True else: #To validate GPX as used for pytrainer must test against both Topograpfix and Cluetrust topografixXSLfile = os.path.realpath(self.pytrainer_main.data_path)+ "/schemas/Topografix_gpx11.xsd" cluetrustXSLfile = os.path.realpath(self.pytrainer_main.data_path)+ "/schemas/Cluetrust_gpxdata10.xsd" from lib.xmlValidation import xmlValidator validator = xmlValidator() return validator.validateXSL(filename, topografixXSLfile) and validator.validateXSL(filename, cluetrustXSLfile)
def valid_input_file(self, filename): """ Function to validate input file if requested""" if not self.validate: #not asked to validate logging.debug("Not validating %s" % (filename)) return True else: #To validate GPX as used for pytrainer must test against both Topograpfix and Cluetrust topografixXSLfile = os.path.realpath( self.pytrainer_main.data_path ) + "/schemas/Topografix_gpx11.xsd" cluetrustXSLfile = os.path.realpath( self.pytrainer_main.data_path ) + "/schemas/Cluetrust_gpxdata10.xsd" from lib.xmlValidation import xmlValidator validator = xmlValidator() return validator.validateXSL( filename, topografixXSLfile) and validator.validateXSL( filename, cluetrustXSLfile)