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


Python HTTPClient.getCookie方法代码示例

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


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

示例1: __init__

# 需要导入模块: from pandac.PandaModules import HTTPClient [as 别名]
# 或者: from pandac.PandaModules.HTTPClient import getCookie [as 别名]

#.........这里部分代码省略.........
        try:
            while thedata:
                temp = thedata.pop()
                temp = temp.split('\t')
                domain = temp[0]
                loc = temp[1]
                variable = temp[2]
                value = temp[3]
                if variable == 'CTG':
                    self.pandaHTTPClientVarCTG = [domain,
                     loc,
                     variable,
                     value]
                    self.setTheHTTPCookie(self.pandaHTTPClientVarCTG)
                if variable == self.hitboxAcct + 'V6':
                    self.pandaHTTPClientVarDM = [domain,
                     loc,
                     variable,
                     value]
                    self.setTheHTTPCookie(self.pandaHTTPClientVarDM)
                if variable == 'WSS_GW':
                    self.pandaHTTPClientVarWSS = [domain,
                     loc,
                     variable,
                     value]
                    self.setTheHTTPCookie(self.pandaHTTPClientVarWSS)

        except IndexError:
            print 'UserFunnel(Warning): Cookie Data file bad'

        del thedata

    def updateInstanceCookieValues(self):
        a = self.httpSession.getCookie(HTTPCookie('WSS_GW', '/', '.hitbox.com'))
        if a.getName():
            self.pandaHTTPClientVarWSS = ['.hitbox.com',
             '/',
             'WSS_GW',
             a.getValue()]
        b = self.httpSession.getCookie(HTTPCookie('CTG', '/', '.hitbox.com'))
        if b.getName():
            self.pandaHTTPClientVarCTG = ['.hitbox.com',
             '/',
             'CTG',
             b.getValue()]
        c = self.httpSession.getCookie(HTTPCookie(self.hitboxAcct + 'V6', '/', 'ehg-dig.hitbox.com'))
        if c.getName():
            self.pandaHTTPClientVarDM = ['ehg-dig.hitbox.com',
             '/',
             self.hitboxAcct + 'V6',
             c.getValue()]
        del a
        del b
        del c

    def setTheHTTPCookie(self, cookieParams):
        c = HTTPCookie(cookieParams[2], cookieParams[1], cookieParams[0])
        c.setValue(cookieParams[3])
        self.httpSession.setCookie(c)

    def writeOutPandaCookie(self):
        try:
            thefile = open(self.cfCookieFile, 'w')
            if len(self.pandaHTTPClientVarWSS) == 4:
                thefile.write(self.pandaHTTPClientVarWSS[0] + '\t' + self.pandaHTTPClientVarWSS[1] + '\t' + self.pandaHTTPClientVarWSS[2] + '\t' + self.pandaHTTPClientVarWSS[3] + '\n')
            if len(self.pandaHTTPClientVarCTG) == 4:
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:70,代码来源:UserFunnel.py

示例2: __init__

# 需要导入模块: from pandac.PandaModules import HTTPClient [as 别名]
# 或者: from pandac.PandaModules.HTTPClient import getCookie [as 别名]

#.........这里部分代码省略.........
    def readInPandaCookieOmniture(self):
        thefile = open(self.cfCookieFileOmniture, 'r')
        thedata = thefile.read().split('\n')
        thefile.close()
        del thefile
        if thedata[0].find('Netscape HTTP Cookie File') != -1:
            return None

        thedata.pop()

        try:
            while thedata:
                temp = thedata.pop()
                temp = temp.split('\t')
                domain = temp[0]
                loc = temp[1]
                variable = temp[2]
                value = temp[3]
                if variable == 's_vi':
                    self.pandaHTTPClientVarSVI = [
                        domain,
                        loc,
                        variable,
                        value]
                    self.setTheHTTPCookie(self.pandaHTTPClientVarSVI)
                    continue
        except IndexError:
            print 'UserFunnel(Warning): Omniture Cookie Data file bad'

        del thedata


    def updateInstanceCookieValues(self):
        a = self.httpSession.getCookie(HTTPCookie('WSS_GW', '/', '.hitbox.com'))
        if a.getName():
            self.pandaHTTPClientVarWSS = [
                '.hitbox.com',
                '/',
                'WSS_GW',
                a.getValue()]

        b = self.httpSession.getCookie(HTTPCookie('CTG', '/', '.hitbox.com'))
        if b.getName():
            self.pandaHTTPClientVarCTG = [
                '.hitbox.com',
                '/',
                'CTG',
                b.getValue()]

        c = self.httpSession.getCookie(HTTPCookie(self.hitboxAcct + 'V6', '/', '.ehg-dig.hitbox.com'))
        if c.getName():
            self.pandaHTTPClientVarDM = [
                '.ehg-dig.hitbox.com',
                '/',
                self.hitboxAcct + 'V6',
                c.getValue()]

        del a
        del b
        del c


    def updateInstanceCookieValuesOmniture(self):
        a = self.httpSession.getCookie(HTTPCookie('s_vi', '/', '.go.com'))
        if a.getName():
            self.pandaHTTPClientVarSVI = [
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:70,代码来源:UserFunnel.py


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