def parse(self, section):
     name = self._readString('name', section)
     url = self._readString('href', section)
     target = section.readString('target', 'internal')
     if target == 'internal':
         size = parseSize(section.readString('size'))
         showRefresh = section.readBool('show_refresh')
         webClientHandler = section.readString('web_client_handler')
         isSolidBorder = section.readBool('is_solid_border')
         action = actions.OpenInternalBrowser(name, url, size, showRefresh,
                                              webClientHandler,
                                              isSolidBorder)
     elif target == 'external':
         action = actions.OpenExternalBrowser(name, url)
     elif target == 'promo':
         action = actions.OpenPromoBrowser(name, url)
     elif target == 'stronghold':
         action = actions.OpenStrongholdBrowser(name, url)
     elif target == 'ranked':
         action = actions.OpenRankedBrowser(name, url)
     else:
         raise ParseError(
             'The target of action "{0}" is not valid: {1}.'.format(
                 self.getTagName(), target))
     return action
Ejemplo n.º 2
0
 def parse(self, section):
     name = self._readString('name', section)
     url = self._readString('href', section)
     target = section.readString('target', 'internal')
     if target == 'internal':
         action = actions.OpenInternalBrowser(name, url)
     elif target == 'external':
         action = actions.OpenExternalBrowser(name, url)
     else:
         raise ParseError('The target of action "{0}" is not valid: {1}.'.format(self.getTagName(), target))
     return action