def fileName2xml(filename): """Here we create the XML string to be passed to the EDNA plugin from the input filename This can / should be modified by the final user @param filename: full path of the input file @type filename: python string representing the path @rtype: XML string @return: python string """ if not filename.endswith(".edf"): return xsdIn = XSDataInputID11() xsdFile = XSDataFile() xsdFile.setPath(XSDataString(filename)) xsdIn.setDataFile([xsdFile]) xsdIn.setParameterFile(xsdParam) xsdIn.setCorrectMask(xsdCorrectMask) if xsdOutputDir is not None: xsdIn.setOutputdir(xsdOutputDir) return xsdIn.marshal()
one_arg = oneArg.lower() if one_arg.find("-online") in [0, 1]: mode = "dirwatch" elif one_arg.find("-all") in [0, 1]: newerOnly = False elif one_arg.find("-debug") in [0, 1]: debug = True elif one_arg.find("-ncpu") in [0, 1]: iNbCPU = int(oneArg.split("=", 1)[1]) elif one_arg.find("-o=") in [0, 1]: strOutDir = os.path.abspath(oneArg.split("=", 1)[1]) if not os.path.isdir(strOutDir): os.makedirs(strOutDir) xsdOutputDir = XSDataFile() xsdOutputDir.setPath(XSDataString(strOutDir)) elif one_arg.find("-p=") in [0, 1]: strParamFile = oneArg.split("=", 1)[1] if os.path.isfile(strParamFile): xsdParam.setPath(XSDataString(os.path.abspath(strParamFile))) else: EDVerbose.ERROR("The parameter file you provided %s is not valid !!!" % strParamFile) elif one_arg.find("-nocorrectmask") in [0, 1]: xsdCorrectMask = XSDataBoolean(0) elif os.path.exists(oneArg): paths.append(os.path.abspath(oneArg)) if len(paths) == 0: if mode == "OffLine": print "This is the ID11 application of EDNA, \nplease give a path to process offline or the option:\n\ --online to process online incoming data in the given directory.\n\