当前位置: 首页>>代码示例>>Python>>正文


Python HTTPClient.getGlobalPtr方法代码示例

本文整理汇总了Python中pandac.PandaModules.HTTPClient.getGlobalPtr方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPClient.getGlobalPtr方法的具体用法?Python HTTPClient.getGlobalPtr怎么用?Python HTTPClient.getGlobalPtr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pandac.PandaModules.HTTPClient的用法示例。


在下文中一共展示了HTTPClient.getGlobalPtr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: redownloadNews

# 需要导入模块: from pandac.PandaModules import HTTPClient [as 别名]
# 或者: from pandac.PandaModules.HTTPClient import getGlobalPtr [as 别名]
    def redownloadNews(self):
        if self.redownloadingNews:
            self.notify.warning("averting potential crash redownloadNews called twice, just returning")
            return
        self.percentDownloaded = 0.0
        self.notify.info("starting redownloadNews")
        self.startRedownload = datetime.datetime.now()
        self.redownloadingNews = True
        self.addDownloadingTextTask()
        for issue in self.issues:
            issue.destroy()

        self.issues = []
        self.curIssueIndex = 0
        self.strFilenames = None
        self.needsParseNews = True
        self.newsUrl = self.getInGameNewsUrl()
        self.newsDir = Filename(self.findNewsDir())
        Filename(self.newsDir + "/.").makeDir()
        http = HTTPClient.getGlobalPtr()
        self.url = self.newsUrl + self.NewsIndexFilename
        self.ch = http.makeChannel(True)
        self.ch.beginGetDocument(self.url)
        self.rf = Ramfile()
        self.ch.downloadToRam(self.rf)
        taskMgr.remove(self.RedownloadTaskName)
        taskMgr.add(self.downloadIndexTask, self.RedownloadTaskName)
        return
开发者ID:TLOTT-PS,项目名称:ttr-src,代码行数:30,代码来源:DirectNewsFrame.py

示例2: ban

# 需要导入模块: from pandac.PandaModules import HTTPClient [as 别名]
# 或者: from pandac.PandaModules.HTTPClient import getGlobalPtr [as 别名]
 def ban(self, avatarId, dislid, comment):
     parameters = ''
     parameters += 'app=%s' % self.App
     parameters += '&product=%s' % self.Product
     parameters += '&user_id=%s' % dislid
     parameters += '&event_name=%s' % self.EventName
     commentWithAvatarId = 'avId-%s ' % avatarId
     commentWithAvatarId += comment
     parameters += '&comments=%s' % urllib.quote(str(commentWithAvatarId))
     baseUrlToUse = self.BanUrl
     osBaseUrl = os.getenv('BAN_URL')
     if osBaseUrl:
         baseUrlToUse = osBaseUrl
     
     fullUrl = baseUrlToUse + '?' + parameters
     self.notify.info('ban request %s dislid=%s comment=%s fullUrl=%s' % (self.curBanRequestNum, dislid, comment, fullUrl))
     simbase.air.writeServerEvent('ban_request', avatarId, '%s|%s|%s' % (dislid, comment, fullUrl))
     if simbase.config.GetBool('do-actual-ban', True):
         newTaskName = 'ban-task-%d' % self.curBanRequestNum
         newTask = taskMgr.add(self.doBanUrlTask, newTaskName)
         newTask.banRequestNum = self.curBanRequestNum
         http = HTTPClient.getGlobalPtr()
         channel = http.makeChannel(False)
         self.channels[self.curBanRequestNum] = channel
         rf = Ramfile()
         self.ramFiles[self.curBanRequestNum] = rf
         channel.beginGetDocument(fullUrl)
         channel.downloadToRam(rf)
     
     self.curBanRequestNum += 1
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:32,代码来源:BanManagerAI.py

示例3: __init__

# 需要导入模块: from pandac.PandaModules import HTTPClient [as 别名]
# 或者: from pandac.PandaModules.HTTPClient import getGlobalPtr [as 别名]
 def __init__(self, platform, hostDir, hostUrl):
     self.platform = platform
     self.hosts = {}
     self.packages = {}
     self.hostUrl = hostUrl
     self.hostDir = Filename(hostDir)
     self.hostDir.makeDir()
     self.http = HTTPClient.getGlobalPtr()
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:10,代码来源:DeploymentTools.py


注:本文中的pandac.PandaModules.HTTPClient.getGlobalPtr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。