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
def parse(self, section): url = section.readString('url') if not url: LOG_ERROR('WGNC show_in_browser item has no URL') return size = parseSize(section.readString('size')) title = section.readString('title') titleKey = section.readString('title_key') showRefresh = section.readBool('show_refresh') webClientHandler = section.readString('web_client_handler') isSolidBorder = section.readBool('is_solid_border') return proxy_data.ShowInBrowserItem(url, size, title, showRefresh, webClientHandler, titleKey=titleKey, isSolidBorder=isSolidBorder)