Esempio n. 1
0
File: main.py Progetto: cb22/immoral
 def __prepare_model(self, internal_name, internal_folder):
     mails = []
     if internal_name == "virtual":
         for account in configdb.accounts:
             mails = list_listing(self.db[account], account, internal_folder)
     else:
         mails = list_listing(self.db[internal_name], internal_name, internal_folder)
         
     return mails
Esempio n. 2
0
File: main.py Progetto: cb22/immoral
 def load_more(self, wrapper):
     if not self._at_bottom:
         offset = self.msgmodel[wrapper.internal_account][wrapper.internal_folder].msg_count()
         new_mails = list_listing(self.db[wrapper.internal_account], wrapper.internal_account, wrapper.internal_folder, limit=30, offset=offset, raw=True)
         
         try:
             offset = 1 if self.msgmodel[wrapper.internal_account][wrapper.internal_folder]._emails[-1].date == new_mails[0].date else 0
         except IndexError:
             self._at_bottom = True
             return
             
         for msg in new_mails[offset:]:
                 self.msgmodel[wrapper.internal_account][wrapper.internal_folder].insert(msg)