def getUrlParams(proxy, args, params, callback): result = args or '' params = params or {} if result: url = yield proxy.parse(result, params) result = addParamsToUrlQuery(url, params) callback(result)
def handle(self, url): platform = self._getPlatform() if platform: urls = _getUrlsMapFromLinkArgs(url) if urls: urls = {arg:[self._addPlatformParamToUrl(url, platform)] for arg, url in urls.iteritems() if AddPlatformTagLinksHandler._hasWotPlatformTags(self, url)} url = addParamsToUrlQuery(url, urls, keepBlankValues=True) return OpenBrowserHandler.handle(self, url) return False
def buildUrl(self, callback): if self.__baseUrl is None: LOG_ERROR('Requesting URL for encyclopedia when base URL is not specified') yield lambda clb: clb(False) else: queryParams = {'id': self.getRecommendations()} url = yield self.__urlMacros.parse(self.__baseUrl) callback(addParamsToUrlQuery(url, queryParams)) return
def buildUrl(self, callback): if self.__baseUrl is None: LOG_ERROR('Requesting URL for encyclopedia when base URL is not specified') yield lambda clb: clb(False) else: queryParams = {'id': self.getRecommendations()} url = yield self.__urlMacros.parse(self.__baseUrl) callback(addParamsToUrlQuery(url, queryParams)) return
def __addAuthParams(self, url, callback): if not url or not self.__webController: callback(url) accessTokenData = yield self.__webController.getAccessTokenData( force=True) params = { 'access_token': str(accessTokenData.accessToken), 'spa_id': BigWorld.player().databaseID } callback(url_formatters.addParamsToUrlQuery(url, params))
def getExtrasVideoPageURL(): battlePassController = dependency.instance(IBattlePassController) url = GUI_SETTINGS.battlePass.get('extrasVideoPage').replace( '$SEASON_ID', str(battlePassController.getSeasonID())) params = { 'level': battlePassController.getCurrentLevel(), 'has_bp': int(battlePassController.isBought()) } if battlePassController.isPlayerVoted(): params['vote'] = battlePassController.getVoteOption() return addParamsToUrlQuery(url, params)
def getUrlParams(proxy, args, params, callback): """ Gets url GET parameters from external params dict. @return: url-encoded params. """ result = args or '' params = params or {} if result: url = yield proxy.parse(result, params) result = addParamsToUrlQuery(url, params) callback(result)
def _addPlatformParamToUrl(self, url, param): return addParamsToUrlQuery(url, {_PLATFORM_PARAM: [param]}, keepBlankValues=True)
def getSplitPageUrl(params): url = _getUrl('splitUrl') return addParamsToUrlQuery(url, params, True)