gaubert / gmvault

gmail backup software
http://www.gmvault.org
GNU Affero General Public License v3.0
3.58k stars 288 forks source link

Begining move to python3 #342

Open brechmos opened 5 years ago

brechmos commented 5 years ago

This is the beginnings of a switch to Python3. I am not an expert in moving code to Python3 :). One thing for someone to check is to make sure the conversion of StringIO makes sense.

brechmos commented 5 years ago

The part that isn't working currently is in imap_utils.py:

class GIMAPFetcher(object): #pylint:disable=R0902,R0904
    '''
    IMAP Class reading the information
    '''
    GMAIL_EXTENSION     = b'X-GM-EXT-1'  # GMAIL capability
    GMAIL_ALL           = '[Gmail]/All Mail' #GMAIL All Mail mailbox

    GENERIC_GMAIL_ALL   = '\\AllMail' # unlocalised GMAIL ALL
    GENERIC_DRAFTS      = '\\Drafts' # unlocalised DRAFTS
    GENERIC_GMAIL_CHATS = gmvault_const.GMAIL_UNLOCAL_CHATS   # unlocalised Chats names

    FOLDER_NAMES        = ['ALLMAIL', 'CHATS', 'DRAFTS']

    GMAIL_ID            = 'X-GM-MSGID' #GMAIL ID attribute
    GMAIL_THREAD_ID     = 'X-GM-THRID'
    GMAIL_LABELS        = 'X-GM-LABELS'

    IMAP_INTERNALDATE = 'INTERNALDATE'
    IMAP_FLAGS        = 'FLAGS'
    IMAP_ALL          = {'type':'imap', 'req':'ALL'}

    EMAIL_BODY        = 'BODY[]'

    GMAIL_SPECIAL_DIRS = ['\\Inbox', '\\Starred', '\\Sent', '\\Draft', '\\Important']

    #GMAIL_SPECIAL_DIRS_LOWER = ['\\inbox', '\\starred', '\\sent', '\\draft', '\\important']
    GMAIL_SPECIAL_DIRS_LOWER = ['\\inbox', '\\starred', '\\sent', '\\draft', '\\important', '\\trash']

I believe there are issues with the representation of the names of the folders. Not sure if it should be b'Mail All' etc etc. I think there is an encoding issue (which should be easy to fix).

txtsd commented 3 years ago

Is this still being worked on?

gene1wood commented 2 years ago

How does this relate to #284 which also seeks to make gmvault work in Python 3?