本文整理匯總了Python中psr.sys.Io.bytes方法的典型用法代碼示例。如果您正苦於以下問題:Python Io.bytes方法的具體用法?Python Io.bytes怎麽用?Python Io.bytes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類psr.sys.Io
的用法示例。
在下文中一共展示了Io.bytes方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: update
# 需要導入模塊: from psr.sys import Io [as 別名]
# 或者: from psr.sys.Io import bytes [as 別名]
def update(self):
""""""
self.switchFileAccount(self.conf.profile)
try:
if self.idx != None :
if not isinstance(self.idx,bytes):
self.idx = Io.bytes(self.idx)
self.delids.append(self.idx)
except Exception as e :
Sys.dprint('error : ')
Sys.dprint(e)
self.index.fixDuplicateIds()
#~ self.index.fixAccount('gmail5')
self.index.encrypt()
msgIndex = self.mb.buildIndex(self.pathIdx)
_, self.idx = self.ih.send(msgIndex.as_string(), self.rootBox)
date = self.ih.headerField(self.idx, 'date', True)
self.conf.sets((['uid' , self.idx , 'index'],
['date' , date , 'index'],
['time' , str(Sys.datetime.now()), 'index']))
Sys.pwlog([(' Index updated (' , Const.CLZ_0),
(str(int(self.idx)) , Const.CLZ_2),
(') ' , Const.CLZ_0),
(str(date) , Const.CLZ_7, True)])
try :
self.ih.delete(self.delids, True)
except :
Sys.dprint('error : ')
Sys.dprint(e)
self.ih.clearTrash()
return True
示例2: initBoxNames
# 需要導入模塊: from psr.sys import Io [as 別名]
# 或者: from psr.sys.Io import bytes [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:] }
示例3: remove
# 需要導入模塊: from psr.sys import Io [as 別名]
# 或者: from psr.sys.Io import bytes [as 別名]
def remove(self):
""""""
self._getId()
try:
if self.idx!= None : self.delids.append(Io.bytes(self.idx))
self.ih.delete(self.delids, True)
self.idx = None
except Exception as e :
Sys.dprint('error : ')
Sys.dprint(e)
self.ih.clearTrash()
self.removeLocal()
示例4: checkSendIds
# 需要導入模塊: from psr.sys import Io [as 別名]
# 或者: from psr.sys.Io import bytes [as 別名]
def checkSendIds(self, sendIds, subject):
""""""
lloc = [Io.bytes(str(data[0])) for mid, data in enumerate(sendIds)]
lsrv = self.idxu.ih.searchBySubject(subject, True)
return [int(i) for i in set(lloc).difference(set(lsrv))]