亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? libgmail.py

?? 一個用Python的gmail功能庫
?? PY
?? 第 1 頁 / 共 4 頁
字號:
                try:                    threads = items[D_THREAD]                except KeyError:                    break                else:                    for th in threads:                        if not type(th[0]) is types.ListType:                            th = [th]                        threadsInfo.append(th)                    # TODO: Check if the total or per-page values have changed?                    threadListSummary = items[D_THREADLIST_SUMMARY][0]                    threadsPerPage = threadListSummary[TS_NUM]                        start += threadsPerPage                # TODO: Record whether or not we retrieved all pages..?        return GmailSearchResult(self, (searchType, kwargs), threadsInfo)    def _retrieveJavascript(self, version = ""):        """        Note: `version` seems to be ignored.        """        return self._retrievePage(_buildURL(view = U_PAGE_VIEW,                                            name = "js",                                            ver = version))                    def getMessagesByFolder(self, folderName, allPages = False):        """        Folders contain conversation/message threads.          `folderName` -- As set in Gmail interface.        Returns a `GmailSearchResult` instance.        *** TODO: Change all "getMessagesByX" to "getThreadsByX"? ***        """        return self._parseThreadSearch(folderName, allPages = allPages)    def getMessagesByQuery(self, query,  allPages = False):        """        Returns a `GmailSearchResult` instance.        """        return self._parseThreadSearch(U_QUERY_SEARCH, q = query,                                       allPages = allPages)        def getQuotaInfo(self, refresh = False):        """        Return MB used, Total MB and percentage used.        """        # TODO: Change this to a property.        if not self._cachedQuotaInfo or refresh:            # TODO: Handle this better...            self.getMessagesByFolder(U_INBOX_SEARCH)        return self._cachedQuotaInfo[0][:3]    def getLabelNames(self, refresh = False):        """        """        # TODO: Change this to a property?        if not self._cachedLabelNames or refresh:            # TODO: Handle this better...            self.getMessagesByFolder(U_INBOX_SEARCH)        return self._cachedLabelNames    def getMessagesByLabel(self, label, allPages = False):        """        """        return self._parseThreadSearch(U_CATEGORY_SEARCH,                                       cat=label, allPages = allPages)        def getRawMessage(self, msgId):        """        """        # U_ORIGINAL_MESSAGE_VIEW seems the only one that returns a page.        # All the other U_* results in a 404 exception. Stas        PageView = U_ORIGINAL_MESSAGE_VIEW          return self._retrievePage(            _buildURL(view=PageView, th=msgId))    def getUnreadMessages(self):        """        """        return self._parseThreadSearch(U_QUERY_SEARCH,                                        q = "is:" + U_AS_SUBSET_UNREAD)                    def getUnreadMsgCount(self):        """        """        items = self._parseSearchResult(U_QUERY_SEARCH,                                        q = "is:" + U_AS_SUBSET_UNREAD)        try:            result = items[D_THREADLIST_SUMMARY][0][TS_TOTAL_MSGS]        except KeyError:            result = 0        return result    def _getActionToken(self):        """        """        try:            at = self.getCookie(ACTION_TOKEN_COOKIE)        except KeyError:            self.getLabelNames(True)             at = self.getCookie(ACTION_TOKEN_COOKIE)        return at    def sendMessage(self, msg, asDraft = False, _extraParams = None):        """          `msg` -- `GmailComposedMessage` instance.          `_extraParams` -- Dictionary containing additional parameters                            to put into POST message. (Not officially                            for external use, more to make feature                            additional a little easier to play with.)                Note: Now returns `GmailMessageStub` instance with populated              `id` (and `_account`) fields on success or None on failure.        """        # TODO: Handle drafts separately?        params = {U_VIEW: [U_SENDMAIL_VIEW, U_SAVEDRAFT_VIEW][asDraft],                  U_REFERENCED_MSG: "",                  U_THREAD: "",                  U_DRAFT_MSG: "",                  U_COMPOSEID: "1",                  U_ACTION_TOKEN: self._getActionToken(),                  U_COMPOSE_TO: msg.to,                  U_COMPOSE_CC: msg.cc,                  U_COMPOSE_BCC: msg.bcc,                  "subject": msg.subject,                  "msgbody": msg.body,                  }        if _extraParams:            params.update(_extraParams)        # Amongst other things, I used the following post to work out this:        # <http://groups.google.com/groups?        #  selm=mailman.1047080233.20095.python-list%40python.org>        mimeMessage = _paramsToMime(params, msg.filenames, msg.files)        #### TODO: Ughh, tidy all this up & do it better...        ## This horrible mess is here for two main reasons:        ##  1. The `Content-Type` header (which also contains the boundary        ##     marker) needs to be extracted from the MIME message so        ##     we can send it as the request `Content-Type` header instead.        ##  2. It seems the form submission needs to use "\r\n" for new        ##     lines instead of the "\n" returned by `as_string()`.        ##     I tried changing the value of `NL` used by the `Generator` class        ##     but it didn't work so I'm doing it this way until I figure        ##     out how to do it properly. Of course, first try, if the payloads        ##     contained "\n" sequences they got replaced too, which corrupted        ##     the attachments. I could probably encode the submission,        ##     which would probably be nicer, but in the meantime I'm kludging        ##     this workaround that replaces all non-text payloads with a        ##     marker, changes all "\n" to "\r\n" and finally replaces the        ##     markers with the original payloads.        ## Yeah, I know, it's horrible, but hey it works doesn't it? If you've        ## got a problem with it, fix it yourself & give me the patch!        ##        origPayloads = {}        FMT_MARKER = "&&&&&&%s&&&&&&"        for i, m in enumerate(mimeMessage.get_payload()):            if not isinstance(m, MIMEText): #Do we care if we change text ones?                origPayloads[i] = m.get_payload()                m.set_payload(FMT_MARKER % i)        mimeMessage.epilogue = ""        msgStr = mimeMessage.as_string()        contentTypeHeader, data = msgStr.split("\n\n", 1)        contentTypeHeader = contentTypeHeader.split(":", 1)        data = data.replace("\n", "\r\n")        for k,v in origPayloads.iteritems():            data = data.replace(FMT_MARKER % k, v)        ####                req = ClientCookie.Request(_buildURL(), data = data)        req.add_header(*contentTypeHeader)        items = self._parsePage(req)        # TODO: Check composeid?        # Sometimes we get the success message        # but the id is 0 and no message is sent        result = None        resultInfo = items[D_SENDMAIL_RESULT][0]                if resultInfo[SM_SUCCESS]:            result = GmailMessageStub(id = resultInfo[SM_NEWTHREADID],                                      _account = self)        else:            raise GmailSendError, resultInfo[SM_MSG]        return result    def trashMessage(self, msg):        """        """        # TODO: Decide if we should make this a method of `GmailMessage`.        # TODO: Should we check we have been given a `GmailMessage` instance?        params = {            U_ACTION: U_DELETEMESSAGE_ACTION,            U_ACTION_MESSAGE: msg.id,            U_ACTION_TOKEN: self._getActionToken(),            }        items = self._parsePage(_buildURL(**params))        # TODO: Mark as trashed on success?        return (items[D_ACTION_RESULT][0][AR_SUCCESS] == 1)    def _doThreadAction(self, actionId, thread):        """        """        # TODO: Decide if we should make this a method of `GmailThread`.        # TODO: Should we check we have been given a `GmailThread` instance?        params = {            U_SEARCH: U_ALL_SEARCH, #TODO:Check this search value always works.            U_VIEW: U_UPDATE_VIEW,            U_ACTION: actionId,            U_ACTION_THREAD: thread.id,            U_ACTION_TOKEN: self._getActionToken(),            }        items = self._parsePage(_buildURL(**params))        return (items[D_ACTION_RESULT][0][AR_SUCCESS] == 1)                    def trashThread(self, thread):        """        """        # TODO: Decide if we should make this a method of `GmailThread`.        # TODO: Should we check we have been given a `GmailThread` instance?        result = self._doThreadAction(U_MARKTRASH_ACTION, thread)                # TODO: Mark as trashed on success?        return result    def _createUpdateRequest(self, actionId): #extraData):        """        Helper method to create a Request instance for an update (view)        action.        Returns populated `Request` instance.        """        params = {            U_VIEW: U_UPDATE_VIEW,            }        data = {            U_ACTION: actionId,            U_ACTION_TOKEN: self._getActionToken(),            }        #data.update(extraData)        req = ClientCookie.Request(_buildURL(**params),                              data = urllib.urlencode(data))        return req    # TODO: Extract additional common code from handling of labels?    def createLabel(self, labelName):        """        """        req = self._createUpdateRequest(U_CREATECATEGORY_ACTION + labelName)        # Note: Label name cache is updated by this call as well. (Handy!)        items = self._parsePage(req)        print items        return (items[D_ACTION_RESULT][0][AR_SUCCESS] == 1)    def deleteLabel(self, labelName):        """        """        # TODO: Check labelName exits?        req = self._createUpdateRequest(U_DELETECATEGORY_ACTION + labelName)        # Note: Label name cache is updated by this call as well. (Handy!)        items = self._parsePage(req)        return (items[D_ACTION_RESULT][0][AR_SUCCESS] == 1)    def renameLabel(self, oldLabelName, newLabelName):        """        """        # TODO: Check oldLabelName exits?        req = self._createUpdateRequest("%s%s^%s" % (U_RENAMECATEGORY_ACTION,                                                   oldLabelName, newLabelName))        # Note: Label name cache is updated by this call as well. (Handy!)        items = self._parsePage(req)        return (items[D_ACTION_RESULT][0][AR_SUCCESS] == 1)    def storeFile(self, filename, label = None):        """        """        # TODO: Handle files larger than single attachment size.        # TODO: Allow file data objects to be supplied?        FILE_STORE_VERSION = "FSV_01"        FILE_STORE_SUBJECT_TEMPLATE = "%s %s" % (FILE_STORE_VERSION, "%s")        subject = FILE_STORE_SUBJECT_TEMPLATE % os.path.basename(filename)        msg = GmailComposedMessage(to="", subject=subject, body="",                                   filenames=[filename])        draftMsg = self.sendMessage(msg, asDraft = True)        if draftMsg and label:            draftMsg.addLabel(label)        return draftMsg    ## CONTACTS SUPPORT    def getContacts(self):        """        Returns a GmailContactList object        that has all the contacts in it as        GmailContacts        """        contactList = []        # pnl = a is necessary to get *all* contacts        myUrl = _buildURL(view='cl',search='contacts', pnl='a')        myData = self._parsePage(myUrl)        # This comes back with a dictionary        # with entry 'cl'        addresses = myData['cl']        for entry in addresses:            if len(entry) >= 6 and entry[0]=='ce':                newGmailContact = GmailContact(entry[1], entry[2], entry[4], entry[5])                #### new code used to get all the notes                 #### not used yet due to lockdown problems                ##rawnotes = self._getSpecInfo(entry[1])                ##print rawnotes                ##newGmailContact = GmailContact(entry[1], entry[2], entry[4],rawnotes)                contactList.append(newGmailContact)        return GmailContactList(contactList)    def addContact(self, myContact, *extra_args):        """        Attempts to add a GmailContact to the gmail        address book. Returns true if successful,        false otherwise        Please note that after version 0.1.3.3,        addContact takes one argument of type        GmailContact, the contact to add.        The old signature of:        addContact(name, email, notes='') is still        supported, but deprecated.         """        if len(extra_args) > 0:            # The user has passed in extra arguments            # He/she is probably trying to invoke addContact            # using the old, deprecated signature of:            # addContact(self, name, email, notes='')                    # Build a GmailContact object and use that instead            (name, email) = (myContact, extra_args[0])            if len(extra_args) > 1:                notes = extra_args[1]            else:                notes = ''            myContact = GmailContact(-1, name, email, notes)        # TODO: In the ideal world, we'd extract these specific        # constants into a nice constants file                # This mostly comes from the Johnvey Gmail API,        # but also from the gmail.py cited earlier        myURL = _buildURL(view='up')                myDataList =  [ ('act','ec'),                        ('at', self.getCookie(ACTION_TOKEN_COOKIE)),                        ('ct_nm', myContact.getName()),                        ('ct_em', myContact.getEmail()),                        ('ct_id', -1 )                       ]        notes = myContact.getNotes()        if notes != '':

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区美女| 欧美精品一区二区在线观看| 91麻豆精品国产91久久久| 国产无一区二区| 亚洲成av人片在线| 成人av电影在线| 欧美变态tickle挠乳网站| 亚洲妇熟xx妇色黄| 99精品欧美一区二区蜜桃免费 | 日韩av一区二| 91麻豆免费看| 国产精品久久久久久久久晋中| 日韩高清一区在线| 色噜噜狠狠成人网p站| 欧美激情一区二区三区不卡 | 不卡区在线中文字幕| 日韩欧美一区二区不卡| 亚洲成人av中文| 91精品1区2区| 亚洲视频中文字幕| 成人福利在线看| 久久久国产精品不卡| 国产一区二区在线观看免费| 欧美一区二区视频网站| 亚洲福利视频一区二区| 欧美主播一区二区三区| 夜夜揉揉日日人人青青一国产精品| 波多野结衣欧美| 国产精品人成在线观看免费| 丰满放荡岳乱妇91ww| 国产精品美女久久福利网站| jiyouzz国产精品久久| 国产精品午夜在线观看| 丁香一区二区三区| 国产精品丝袜久久久久久app| 处破女av一区二区| 欧美国产乱子伦| 成人蜜臀av电影| 国产精品盗摄一区二区三区| 国产1区2区3区精品美女| 国产精品伦一区二区三级视频| 成人黄色免费短视频| 亚洲欧洲成人av每日更新| 97精品超碰一区二区三区| 亚洲丝袜自拍清纯另类| 欧美色成人综合| 免费在线一区观看| 久久亚洲精品小早川怜子| 成人午夜免费电影| 亚洲免费色视频| 欧美丰满美乳xxx高潮www| 秋霞电影一区二区| 国产日韩精品一区| 一本色道久久加勒比精品| 五月天丁香久久| 精品国产一区二区三区忘忧草| 国产精品影视在线| 亚洲免费在线观看视频| 91精品一区二区三区在线观看| 久久精品噜噜噜成人av农村| 国产亚洲成av人在线观看导航| 成人18视频日本| 午夜精品福利一区二区蜜股av | 一区二区三区中文在线观看| 欧美亚洲国产一区二区三区va| 日本成人中文字幕在线视频| 久久久久久免费| 91久久精品日日躁夜夜躁欧美| 久久99久久99| 亚洲自拍另类综合| 久久日韩粉嫩一区二区三区| 欧美性猛片xxxx免费看久爱| 激情国产一区二区| 一二三区精品视频| 国产日韩欧美综合一区| 在线播放/欧美激情| 成+人+亚洲+综合天堂| 蜜臀av性久久久久蜜臀av麻豆| 综合在线观看色| 精品少妇一区二区三区免费观看| 色先锋aa成人| 国模娜娜一区二区三区| 视频一区二区三区中文字幕| 国产精品白丝在线| 精品国产一区二区三区久久久蜜月| 在线观看日韩高清av| 成人一区二区视频| 久久99精品网久久| 日韩精品免费专区| 尤物在线观看一区| 国产精品入口麻豆原神| 欧美成人女星排行榜| 欧美精品电影在线播放| 色婷婷久久久亚洲一区二区三区 | 久久精品国产**网站演员| 亚洲日本va午夜在线影院| 精品精品欲导航| 欧美日韩国产综合草草| 91浏览器打开| 福利一区福利二区| 国产在线精品一区二区 | 一区二区三区免费在线观看| 日本一区二区免费在线观看视频| 精品少妇一区二区三区| 欧美一激情一区二区三区| 欧美日韩国产精品自在自线| 欧美无人高清视频在线观看| av动漫一区二区| 国产91清纯白嫩初高中在线观看 | 一本色道久久综合精品竹菊| 成人精品电影在线观看| 成人免费av资源| 成人不卡免费av| 99热99精品| 91在线视频免费91| 99精品欧美一区二区三区小说| 成人18精品视频| 色综合久久久久综合| 在线视频中文字幕一区二区| 91久久线看在观草草青青| 色婷婷av一区二区| 欧美撒尿777hd撒尿| 91精品国产综合久久蜜臀| 日韩欧美中文一区| 亚洲精品一区二区三区香蕉| 欧美xxxx老人做受| 国产日韩精品视频一区| 中文字幕在线一区免费| 亚洲狼人国产精品| 五月婷婷综合激情| 国内精品久久久久影院色| 国产91精品一区二区麻豆亚洲| 国产精品亚洲午夜一区二区三区| 成人午夜私人影院| 91久久精品一区二区三| 91精品国产综合久久小美女| 久久一区二区视频| 中文字幕一区二区视频| 亚洲国产aⅴ天堂久久| 石原莉奈在线亚洲三区| 精品一区二区三区蜜桃| 成人性生交大合| 欧美色综合天天久久综合精品| 欧美另类变人与禽xxxxx| 精品久久久久久久人人人人传媒| 国产亚洲精品aa| 亚洲最大色网站| 久久er99精品| aaa亚洲精品一二三区| 3d动漫精品啪啪一区二区竹菊| 26uuu色噜噜精品一区| 亚洲欧美日本在线| 精品写真视频在线观看| av电影天堂一区二区在线观看| 欧美精品在线一区二区三区| 久久久综合激的五月天| 一区二区三区精品在线观看| 久久99久久99小草精品免视看| 99久久精品免费观看| 日韩一区和二区| 亚洲人午夜精品天堂一二香蕉| 午夜激情一区二区三区| 99久久久久免费精品国产| 欧美美女喷水视频| 国产精品高清亚洲| 国模大尺度一区二区三区| 欧美日韩国产综合一区二区| 国产精品夫妻自拍| 韩国中文字幕2020精品| 欧美日本视频在线| 综合久久久久久| 国产一区二区在线视频| 69堂精品视频| 亚洲免费视频中文字幕| 国产成人亚洲精品青草天美| 91精品久久久久久久99蜜桃| 亚洲精品网站在线观看| 国产精品99久久久久久有的能看 | 亚洲精品欧美专区| 国产精品66部| 日韩手机在线导航| 亚洲第四色夜色| 色素色在线综合| 综合欧美一区二区三区| 国产v日产∨综合v精品视频| 日韩精品一区二| 麻豆精品久久久| 欧美日韩日日骚| 亚洲永久免费视频| 波多野结衣在线aⅴ中文字幕不卡 波多野结衣在线一区 | 韩国一区二区三区| 欧美一区二区三区在| 一区二区三区蜜桃网| 91在线码无精品| 中文字幕一区二区三区色视频| 成人激情开心网| 亚洲欧美日韩在线| 91黄视频在线观看| 亚洲大片免费看| 欧美一级黄色片|