當前位置: 首頁>>代碼示例>>Python>>正文


Python Io.str方法代碼示例

本文整理匯總了Python中psr.sys.Io.str方法的典型用法代碼示例。如果您正苦於以下問題:Python Io.str方法的具體用法?Python Io.str怎麽用?Python Io.str使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在psr.sys.Io的用法示例。


在下文中一共展示了Io.str方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _getIdsList

# 需要導入模塊: from psr.sys import Io [as 別名]
# 或者: from psr.sys.Io import str [as 別名]
 def _getIdsList(ids):
     idslist = None
     if isinstance(ids,list):
         if len(ids) > 0 and ids[0]!='' and ids[0]!=None:
             li = len(ids)-1
             if int(ids[0])+li == int(ids[li]):
                 idslist = Io.str(ids[0]+b':'+ids[li]) if isinstance(ids[0],bytes) else str(ids[0])+':'+str(ids[li])
             else :
                 idslist = Io.str(b','.join(ids)) if isinstance(ids[0],bytes) else ','.join(ids)
     elif isinstance(ids, int) and ids > 0:
         idslist = Io.str(ids)
     return idslist
開發者ID:pluie-org,項目名稱:imprastorage,代碼行數:14,代碼來源:imap.py

示例2: _ids

# 需要導入模塊: from psr.sys import Io [as 別名]
# 或者: from psr.sys.Io import str [as 別名]
 def _ids(self, box='INBOX', search='ALL', charset=None, byUid=False):
     """"""
     status, resp = self.cnx.select(box)
     if status == self.KO :
         self.createBox(box)
         self.cnx.select(box)
     status, resp = self.cnx.search(charset, '(%s)' % search)
     return resplit(' ',Io.str(resp[self.K_HEAD]))
開發者ID:pluie-org,項目名稱:imprastorage,代碼行數:10,代碼來源:imap.py

示例3: headerField

# 需要導入模塊: from psr.sys import Io [as 別名]
# 或者: from psr.sys.Io import str [as 別名]
 def headerField(self, mid, field, byUid=False):
     """"""
     value = ''
     field = field.upper()
     query = '(UID BODY[HEADER' + ('])' if field=='*' or field=='ALL' else '.FIELDS (%s)])' % field)
     status, resp = self.fetch(mid, query, byUid)
     if status==self.OK and resp[0]!=None:
         value = Io.str(resp[0][1][len(field)+2:-4])
     return value
開發者ID:pluie-org,項目名稱:imprastorage,代碼行數:11,代碼來源:imap.py

示例4: listBox

# 需要導入模塊: from psr.sys import Io [as 別名]
# 或者: from psr.sys.Io import str [as 別名]
 def listBox(self, box='INBOX', pattern='*'):
     """"""
     status, resp = self.cnx.list(box,pattern)
     l = []
     for r in resp :
         if  r is not None :
             name = Io.str(r).split(' "/" ')
             l.append((name[0][1:-1].split(' '),name[1][1:-1]))
     return l
開發者ID:pluie-org,項目名稱:imprastorage,代碼行數:11,代碼來源:imap.py

示例5: initBoxNames

# 需要導入模塊: from psr.sys import Io [as 別名]
# 或者: from psr.sys.Io import str [as 別名]
 def initBoxNames(self):
     """"""
     status, resp = self.cnx.xlist()
     if status == self.OK :
         bdef, bname, c = None, None, None
         for c in resp :
             bdef, bname = c[1:-1].split(b') "/" "')
             if bdef == Io.bytes(self.NO_SELECT+' '+self.CHILDREN) :
                 self.BOXS['/'] = Io.str(bname)
             elif bdef == Io.bytes(self.NO_CHILDREN+' '+self.INBOX) :
                 self.BOXS[self.INBOX] = self.INBOX[1:].upper()
             elif bdef == Io.bytes(self.NO_CHILDREN+' '+self.DRAFTS) :
                 self.BOXS[self.DRAFTS] = Io.str(bname)
             elif bdef == Io.bytes(self.NO_CHILDREN+' '+self.TRASH) :
                 self.BOXS[self.TRASH] = Io.str(bname)
             elif bdef == Io.bytes(self.NO_CHILDREN+' '+self.SENT) :
                 self.BOXS[self.SENT] = Io.str(bname)
     else :
         self.BOXS = { '/' : '/', self.INBOX : self.INBOX[1:].upper(), self.DRAFTS : self.DRAFTS[1:], self.TRASH : self.TRASH[1:], self.SENT : self.SENT[1:] }
開發者ID:pluie-org,項目名稱:imprastorage,代碼行數:21,代碼來源:imap.py

示例6: buildIndex

# 需要導入模塊: from psr.sys import Io [as 別名]
# 或者: from psr.sys.Io import str [as 別名]
 def buildIndex(self, fromPath):
     """Build mail for ImpraIndex
     :Returns: 'email.message.Message'
     """
     msg = MIMEText(Io.str(b2a_base64(Io.get_data(fromPath, True))), 'plain', 'utf-8')
     msg['From']    = self.getHashName('system')+'@'+self.DOMAIN_NAME
     msg['To']      = self.getHashName('all')+'@'+self.DOMAIN_NAME
     msg['Date']    = formatdate(localtime=True)
     msg['Subject'] = Header(self.getHashName('index'),'utf-8')      
     return msg
開發者ID:pluie-org,項目名稱:imprastorage,代碼行數:12,代碼來源:mail.py

示例7: status

# 需要導入模塊: from psr.sys import Io [as 別名]
# 或者: from psr.sys.Io import str [as 別名]
 def status(self, box='INBOX'):
     """"""
     status, resp = self.cnx.status(box, '(MESSAGES RECENT UIDNEXT UIDVALIDITY UNSEEN)')
     if status == self.OK :
         data = research(self.REG_SATUS, Io.str(resp[self.K_HEAD]))
         l    = resplit(' ',data.group(2))
         dic  = {'BOX' : box}
         for i in range(len(l)):
             if i%2 == 0 : dic[l[i]] = int(l[i+1])
     else : dic = {}
     return dic
開發者ID:pluie-org,項目名稱:imprastorage,代碼行數:13,代碼來源:imap.py


注:本文中的psr.sys.Io.str方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。