def __init__(self, log: Log, xmlElement: ET.Element) -> None: super().__init__(log, xmlElement, "EnvironmentVariable", BuildRecipeValidateCommand.EnvironmentVariable) self.Name = self._ReadAttrib(xmlElement, 'Name') # type: str method = self._ReadAttrib(xmlElement, 'Method') self.AllowEndSlash = self._ReadBoolAttrib(xmlElement, 'AllowEndSlash', False) # type: bool self.Method = BuildRecipeValidateMethod.FromString(method) # type: int
def __init__(self, log: Log, xmlElement: ET.Element) -> None: super().__init__(log, xmlElement, "Path", BuildRecipeValidateCommand.Path) self.Name = self._ReadAttrib(xmlElement, 'Name') method = self._ReadAttrib(xmlElement, 'Method') self.Method = BuildRecipeValidateMethod.FromString(method) if '\\' in self.Name: raise Exception("A path can not contain backslash '\\': '{0}'".format(self.Name)) if self.Name.endswith('/'): raise Exception("A path can not end with a slash '/': '{0}'".format(self.Name)) self.Name = IOUtil.NormalizePath(self.Name)