Ejemplo n.º 1
0
 def __ValidateVariantName(self) -> None:
     if self.Type == VariantType.Normal:
         if not Util.IsValidName(self.Name):
             raise XmlUnsupportedVariantNameException(
                 self.XMLElement, self.Name)
     elif self.Type == VariantType.Virtual:
         if not Util.IsValidVirtualVariantName(self.Name):
             raise XmlUnsupportedVirtualVariantNameException(
                 self.XMLElement, self.Name)
     else:
         raise XmlException(self.XMLElement, "Unknown variant type")
Ejemplo n.º 2
0
 def __ValidateOptionNames(self) -> None:
     if self.Type == VariantType.Normal:
         for option in self.Options:
             if not Util.IsValidName(option.Name):
                 raise XmlUnsupportedVariantOptionNameException(
                     option.XMLElement, option.Name)
     elif self.Type == VariantType.Virtual:
         if len(self.Options) != 1:
             raise XmlInvalidVirtualVariantOptionException(
                 self.XMLElement, self.Name)
         if not self.Options[0].Name == self.Name:
             raise XmlUnsupportedVirtualVariantOptionNameException(
                 self.Options[0].XMLElement, self.Options[0].Name,
                 self.Name)
     else:
         raise XmlException(self.XMLElement, "Unknown variant type")
Ejemplo n.º 3
0
 def __ValidateOptionNames(self) -> None:
     for option in self.Options:
         if not Util.IsValidName(option.Name):
             raise XmlUnsupportedFlavorOptionNameException(
                 option.XMLElement, option.Name)
Ejemplo n.º 4
0
 def __ValidateFlavorName(self) -> None:
     if not Util.IsValidName(self.Name):
         raise XmlUnsupportedFlavorNameException(self.XMLElement, self.Name)