Esempio n. 1
0
 def __readBasicConfig(self, xmlCtx, section):
     self.itemTypeName = 'equipment'
     self.name = section.name
     self.id = (nations.NONE_INDEX,
                _xml.readInt(xmlCtx, section, 'id', 0, 65535))
     self.compactDescr = vehicles.makeIntCompactDescrByID(
         'equipment', *self.id)
     if not section.has_key('tags'):
         self.tags = frozenset()
     else:
         self.tags = _readTags(xmlCtx, section, 'tags', 'equipment')
     if IS_CLIENT or IS_WEB:
         self.userString = i18n.makeString(section.readString('userString'))
         self.description = i18n.makeString(
             section.readString('description'))
         self.icon = _xml.readIcon(xmlCtx, section, 'icon')
     if IS_CELLAPP or not section.has_key('vehicleFilter'):
         self.__vehicleFilter = None
     else:
         self.__vehicleFilter = _VehicleFilter((xmlCtx, 'vehicleFilter'),
                                               section['vehicleFilter'])
     if not section.has_key('incompatibleTags'):
         self.__equipmentFilter = None
     else:
         self.__equipmentFilter = _EquipmentFilter(
             (xmlCtx, 'incompatibleTags'), section['incompatibleTags'])
     return
Esempio n. 2
0
 def _readBasicConfig(self, xmlCtx, section):
     self.name = section.name
     self.id = (nations.NONE_INDEX,
                _xml.readInt(xmlCtx, section, 'id', 0, 65535))
     self.compactDescr = vehicles.makeIntCompactDescrByID(
         self.itemTypeName, *self.id)
     if not section.has_key('tags'):
         self.tags = frozenset()
     else:
         self.tags = _readTags(xmlCtx, section, 'tags', self.itemTypeName)
     if IS_CLIENT or IS_WEB:
         self.i18n = shared_components.I18nComponent(
             section.readString('userString'),
             section.readString('description'))
         self.icon = _xml.readIcon(xmlCtx, section, 'icon')
     if IS_CELLAPP or not section.has_key('vehicleFilter'):
         self.__vehicleFilter = None
     else:
         self.__vehicleFilter = _VehicleFilter((xmlCtx, 'vehicleFilter'),
                                               section['vehicleFilter'])
     if not section.has_key('incompatibleTags'):
         self.__artefactFilter = None
     else:
         self.__artefactFilter = _ArtefactFilter(
             (xmlCtx, 'incompatibleTags'), section['incompatibleTags'],
             self.itemTypeName)
     self.removable = section.readBool('removable', False)
     return
Esempio n. 3
0
 def __readBasicConfig(self, xmlCtx, section):
     self.itemTypeName = 'optionalDevice'
     self.name = section.name
     self.id = (nations.NONE_INDEX, _xml.readInt(xmlCtx, section, 'id', 0, 65535))
     self.compactDescr = vehicles.makeIntCompactDescrByID('optionalDevice', *self.id)
     if IS_CLIENT or IS_WEB:
         self.userString = i18n.makeString(section.readString('userString'))
         self.description = i18n.makeString(section.readString('description'))
         self.icon = _xml.readIcon(xmlCtx, section, 'icon')
     if IS_CELLAPP or not section.has_key('vehicleFilter'):
         self.__filter = None
     else:
         self.__filter = _VehicleFilter((xmlCtx, 'vehicleFilter'), section['vehicleFilter'])
     self.removable = section.readBool('removable', False)
Esempio n. 4
0
 def __readBasicConfig(self, xmlCtx, section):
     self.itemTypeName = 'optionalDevice'
     self.name = section.name
     self.id = (nations.NONE_INDEX,
                _xml.readInt(xmlCtx, section, 'id', 0, 65535))
     self.compactDescr = vehicles.makeIntCompactDescrByID(
         'optionalDevice', *self.id)
     if IS_CLIENT or IS_WEB:
         self.userString = i18n.makeString(section.readString('userString'))
         self.description = i18n.makeString(
             section.readString('description'))
         self.icon = _xml.readIcon(xmlCtx, section, 'icon')
     if IS_CELLAPP or not section.has_key('vehicleFilter'):
         self.__filter = None
     else:
         self.__filter = _VehicleFilter((xmlCtx, 'vehicleFilter'),
                                        section['vehicleFilter'])
     self.removable = section.readBool('removable', False)
     return
Esempio n. 5
0
 def __readBasicConfig(self, xmlCtx, section):
     self.itemTypeName = 'equipment'
     self.name = section.name
     self.id = (nations.NONE_INDEX, _xml.readInt(xmlCtx, section, 'id', 0, 65535))
     self.compactDescr = vehicles.makeIntCompactDescrByID('equipment', *self.id)
     if not section.has_key('tags'):
         self.tags = frozenset()
     else:
         self.tags = _readTags(xmlCtx, section, 'tags', 'equipment')
     if IS_CLIENT or IS_WEB:
         self.userString = i18n.makeString(section.readString('userString'))
         self.description = i18n.makeString(section.readString('description'))
         self.icon = _xml.readIcon(xmlCtx, section, 'icon')
     if IS_CELLAPP or not section.has_key('vehicleFilter'):
         self.__vehicleFilter = None
     else:
         self.__vehicleFilter = _VehicleFilter((xmlCtx, 'vehicleFilter'), section['vehicleFilter'])
     if not section.has_key('incompatibleTags'):
         self.__equipmentFilter = None
     else:
         self.__equipmentFilter = _EquipmentFilter((xmlCtx, 'incompatibleTags'), section['incompatibleTags'])