diff --git a/PKG-INFO b/PKG-INFO index 9dc9000d..a4c68ffe 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -7,6 +7,6 @@ Author: Guillaume Aubert Author-email: guillaume.aubert@gmail.com License: GPL v3.0 Description: Gmvault is a tool allowing users to backup and restore their gmail account. This tool allows one shot backups or regular backups. - Gmvault will restore your gmail account as it was. Don't let that part of your life disapear. + Gmvault will restore your gmail account as it was. Don't let that part of your life disappear. Platform: UNKNOWN diff --git a/RELEASE-NOTE.txt b/RELEASE-NOTE.txt index b42ea26d..7808aa5d 100644 --- a/RELEASE-NOTE.txt +++ b/RELEASE-NOTE.txt @@ -161,7 +161,7 @@ New Features: - GTalk chats can be restored in any accounts in the label gmvault-chats as the official Gmail Chats label in read-only. - Add the check command for cleaning your Gmvault db. With check, Gmvault-db will reflect your Gmail account and emails that have been trashed on Gmail will be deleted from the Gmvault-db. - The check option used to keep in sync the Gmvault-db with your Gmail account is now by default activated in the sync mode. Use option "--check-db" no to deactivate it. - Beware if you have a Gmvault db containg emails from multiple accounts: You will have to resync in quick mode with --db-cleaning no with both accounts to no have part of it deleted. + Beware if you have a Gmvault db containing emails from multiple accounts: You will have to resync in quick mode with --db-cleaning no with both accounts to no have part of it deleted. - Add options --chats-only and --emails-only to synchronise only emails or chats. - Create default configuration file $HOME/.gmvault/gmvault_defaults.conf in order to make some options customisable. - Change quick sync time to 7 days and restore time to one month to speed-up the quick modes. It can be configured in $HOME/.gmvault/gmvault_defaults.conf. diff --git a/src/gmv/blowfish.py b/src/gmv/blowfish.py index 34602089..bc85de32 100644 --- a/src/gmv/blowfish.py +++ b/src/gmv/blowfish.py @@ -434,7 +434,7 @@ def encrypt(self, data): 'len': len(data), }) - # Use big endianess since that's what everyone else uses + # Use big endianness since that's what everyone else uses xl = (ord(data[3])) | (ord(data[2]) << 8) | (ord(data[1]) << 16) | (ord(data[0]) << 24) xr = (ord(data[7])) | (ord(data[6]) << 8) | (ord(data[5]) << 16) | (ord(data[4]) << 24) @@ -457,7 +457,7 @@ def decrypt(self, data): 'len': len(data), }) - # Use big endianess since that's what everyone else uses + # Use big endianness since that's what everyone else uses cl = (ord(data[3])) | (ord(data[2]) << 8) | (ord(data[1]) << 16) | (ord(data[0]) << 24) cr = (ord(data[7])) | (ord(data[6]) << 8) | (ord(data[5]) << 16) | (ord(data[4]) << 24) @@ -551,17 +551,17 @@ def _demo(heading, source, encrypted, decrypted): # Block processing text = 'testtest' - crypted = cipher.encrypt(text) - decrypted = cipher.decrypt(crypted) - _demo("Testing block encrypt", text, repr(crypted), decrypted) + encrypted = cipher.encrypt(text) + decrypted = cipher.decrypt(encrypted) + _demo("Testing block encrypt", text, repr(encrypted), decrypted) # CTR ptocessing cipher.initCTR() text = "The quick brown fox jumps over the lazy dog" - crypted = cipher.encryptCTR(text) + encrypted = cipher.encryptCTR(text) cipher.initCTR() - decrypted = cipher.decryptCTR(crypted) - _demo("Testing CTR logic", text, repr(crypted), decrypted) + decrypted = cipher.decryptCTR(encrypted) + _demo("Testing CTR logic", text, repr(encrypted), decrypted) # Test speed print "Testing speed" diff --git a/src/gmv/cmdline_utils.py b/src/gmv/cmdline_utils.py index e195cd76..7e995fa3 100755 --- a/src/gmv/cmdline_utils.py +++ b/src/gmv/cmdline_utils.py @@ -31,7 +31,7 @@ class CmdLineParser(argparse.ArgumentParser): #pylint: disable=R0904 Comments regarding usability of the lib. By default you want to print the default in the help if you had them so the default formatter should print them Also new lines are eaten in the epilogue strings. You would use an epilogue to show examples most of the time so you - want to have the possiblity to go to a new line. There should be a way to format the epilogue differently from the rest + want to have the possibility to go to a new line. There should be a way to format the epilogue differently from the rest """ diff --git a/src/gmv/conf/conf_helper.py b/src/gmv/conf/conf_helper.py index 7efc79a2..9169d200 100755 --- a/src/gmv/conf/conf_helper.py +++ b/src/gmv/conf/conf_helper.py @@ -26,7 +26,7 @@ class ResourceError(Exception): """ - Base class for ressource exceptions + Base class for resource exceptions """ def __init__(self, a_msg): @@ -35,19 +35,19 @@ def __init__(self, a_msg): class Resource(object): """ - Class read a ressource. + Class read a resource. It can be read first from the Command Line, then from the ENV as an env variable and finally from a conf file """ def __init__(self, a_cli_argument=None, a_env_variable=None, a_conf_property=None): """ Default Constructor. - It is important to understand that there is precedence between the different ways to set the ressource: + It is important to understand that there is precedence between the different ways to set the resource: - get from the command line if defined otherwise get from the Env variable if defined otherwise get from the conf file otherwise error Args: a_cli_argument : The command line argument name - a_env_variable : The env variable name used for this ressource + a_env_variable : The env variable name used for this resource a_conf_property: It should be a tuple containing two elements (group,property) """ @@ -83,7 +83,7 @@ def _get_srandardized_cli_argument(cls, a_tostrip): def _get_value_from_command_line(self): """ internal method for extracting the value from the command line. - All command line agruments must be lower case (unix style). + All command line arguments must be lower case (unix style). To Do support short and long cli args. Returns: @@ -331,7 +331,7 @@ class Conf(object): * support for variables in configuration file * support for default values in all accessors * integrated with the resources object offering to get the configuration from an env var, a commandline option or the conf - * to be done : support for blocs, list comprehension and dict comprehension, json + * to be done : support for blocks, list comprehension and dict comprehension, json * to be done : define resources in the conf using the [Resource] group with A= { ENV:TESTVAR, CLI:--testvar, VAL:1.234 } """ diff --git a/src/gmv/conf/tests/test.config b/src/gmv/conf/tests/test.config index ae87fc41..525eefd5 100644 --- a/src/gmv/conf/tests/test.config +++ b/src/gmv/conf/tests/test.config @@ -3,7 +3,7 @@ # author: guillaume.aubert@gmail.com #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # use the resources to get ENV Variables. Use of a special group ENV : %(ENV[HOME]) -# use the resources to get CLI Values. Use fo a special group CLI: %(CLI[Longname] or CLI[--Longname] or CLI[-longname] +# use the resources to get CLI Values. Use of a special group CLI: %(CLI[Longname] or CLI[--Longname] or CLI[-longname] #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Name : GroupTest1 diff --git a/src/gmv/conf/utils/struct_parser.py b/src/gmv/conf/utils/struct_parser.py index 6b174147..fcc85860 100755 --- a/src/gmv/conf/utils/struct_parser.py +++ b/src/gmv/conf/utils/struct_parser.py @@ -431,7 +431,7 @@ def _compile_litteral(self, a_tokenizer): dummy = the_token.value[1:-1] elif the_token.type == 'NAME': - # intepret all non quoted names as a string + # interpret all non quoted names as a string dummy = the_token.value elif the_token.type == 'NUMBER': diff --git a/src/gmv/credential_utils.py b/src/gmv/credential_utils.py index dc08c7ed..e4af0409 100755 --- a/src/gmv/credential_utils.py +++ b/src/gmv/credential_utils.py @@ -370,7 +370,7 @@ def get_oauth2_credential(cls, email, renew_cred = False): """ Used once the connection has been lost. Return an auth_str obtained from a refresh token or with the current access token if it is still valid - :param email: user email used to load refresh token from peristent file + :param email: user email used to load refresh token from persistent file :return: credential { 'type' : 'oauth2', 'value' : auth_str, 'option':None } """ oauth2_creds = cls.read_oauth2_tok_sec(email) diff --git a/src/gmv/gmv_cmd.py b/src/gmv/gmv_cmd.py index f245aada..5916e0c9 100755 --- a/src/gmv/gmv_cmd.py +++ b/src/gmv/gmv_cmd.py @@ -121,7 +121,7 @@ class NotSeenAction(argparse.Action): #pylint:disable=R0903,w0232 """ - to differenciate between a seen and non seen command + to differentiate between a seen and non seen command """ def __call__(self, parser, namespace, values, option_string=None): if values: @@ -835,7 +835,7 @@ def setup_default_conf(): """ set the environment GMVAULT_CONF_FILE which is necessary for Conf object """ - gmvault_utils.get_conf_defaults() # force instanciation of conf to load the defaults + gmvault_utils.get_conf_defaults() # force instantiation of conf to load the defaults def bootstrap_run(): """ temporary bootstrap """ @@ -856,7 +856,7 @@ def bootstrap_run(): LOG.critical("Activate debugging information.") activate_debug_mode() - # force instanciation of conf to load the defaults + # force instantiation of conf to load the defaults gmvault_utils.get_conf_defaults() gmvlt.run(args) diff --git a/src/gmv/gmvault.py b/src/gmv/gmvault.py index c127698e..a5848321 100755 --- a/src/gmv/gmvault.py +++ b/src/gmv/gmvault.py @@ -55,7 +55,7 @@ def handle_restore_imap_error(the_exception, gm_id, db_gmail_ids_info, gmvaulter gmvaulter.src.reconnect() #reconnect elif isinstance(the_exception, imaplib.IMAP4.error): - LOG.error("Catched IMAP Error %s" % (str(the_exception))) + LOG.error("Caught IMAP Error %s" % (str(the_exception))) LOG.exception(the_exception) #When the email cannot be read from Database because it was empty when returned by gmail imap @@ -271,7 +271,7 @@ def __init__(self, db_root_dir, host, port, login, \ #instantiate gstorer self.gstorer = gmvault_db.GmailStorer(self.db_root_dir, self.use_encryption) - #timer used to mesure time spent in the different values + #timer used to measure time spent in the different values self.timer = gmvault_utils.Timer() @classmethod @@ -289,7 +289,8 @@ def get_operation_report(self): """ the_str = "\n================================================================\n"\ "%s operation performed in %s.\n" \ - "Number of reconnections: %d.\nNumber of emails quarantined: %d.\n" \ + "Number of reconnections: %d.\n" \ + "Number of emails quarantined: %d.\n" \ "Number of emails that could not be fetched: %d.\n" \ "Number of emails that were returned empty by gmail: %d.\n"\ "Number of emails without label information returned by gmail: %d.\n"\ @@ -634,7 +635,7 @@ def sync(self, imap_req, compress_on_disk = True, \ else: LOG.critical("\nSkip chats synchronization.\n") - #delete supress emails from DB since last sync + #delete suppress emails from DB since last sync self.check_clean_db(db_cleaning) LOG.debug("Sync operation performed in %s.\n" \ @@ -775,7 +776,7 @@ def check_clean_db(self, db_cleaning): LOG.debug("Got %s emails imap_id(s) from the Gmail Server." % (len(imap_ids))) - #delete supress emails from DB since last sync + #delete suppress emails from DB since last sync self._delete_sync(imap_ids, db_gmail_ids, db_gmail_ids_info, 'email') # get all chats ids @@ -792,7 +793,7 @@ def check_clean_db(self, db_cleaning): LOG.debug("Got %s chat imap_ids from the Gmail Server." % (len(chat_ids))) - #delete supress emails from DB since last sync + #delete suppress emails from DB since last sync self._delete_sync(chat_ids, db_chat_ids, db_gmail_ids_info , 'chat') else: LOG.critical("Chats IMAP Directory not visible on Gmail. Ignore deletion of chats.") @@ -1055,7 +1056,7 @@ def restore_emails(self, pivot_dir = None, extra_labels = [], restart = False): restore emails in a gmail account using batching to group restore If you are not in "All Mail" Folder, it is extremely fast to push emails. But it is not possible to reapply labels if you are not in All Mail because the uid which is returned - is dependant on the folder. On the other hand, you can restore labels in batch which would help gaining lots of time. + is dependent on the folder. On the other hand, you can restore labels in batch which would help gaining lots of time. The idea is to get a batch of 50 emails and push them all in the mailbox one by one and get the uid for each of them. Then create a dict of labels => uid_list and for each label send a unique store command after having changed dir """ diff --git a/src/gmv/gmvault_export.py b/src/gmv/gmvault_export.py index 488387aa..8fdade9a 100644 --- a/src/gmv/gmvault_export.py +++ b/src/gmv/gmvault_export.py @@ -34,7 +34,7 @@ class GMVaultExporter(object): """ - Class hanlding the creation of exports in standard formats + Class handling the creation of exports in standard formats such as maildir, mbox """ PROGRESS_INTERVAL = 200 diff --git a/src/gmv/gmvault_utils.py b/src/gmv/gmvault_utils.py index 9503f98a..16c125fa 100755 --- a/src/gmv/gmvault_utils.py +++ b/src/gmv/gmvault_utils.py @@ -69,8 +69,8 @@ def __get__(self, obj, objtype): return functools.partial(self.__call__, obj) class Curry: - """ Class used to implement the currification (functional programming technic) : - Create a function from another one by instanciating some of its parameters. + """ Class used to implement the currification (functional programming technique) : + Create a function from another one by instantiating some of its parameters. For example double = curry(operator.mul,2), res = double(4) = 8 """ def __init__(self, fun, *args, **kwargs): @@ -126,7 +126,7 @@ def get_exception_traceback(): def remove_consecutive_spaces_and_strip(a_str): """ - Supress consecutive spaces to replace them with a unique one. + Suppress consecutive spaces to replace them with a unique one. e.g "two spaces" = "two spaces" """ #return re.sub("\s{2,}", " ", a_str, flags=re.U).strip() @@ -137,7 +137,7 @@ def remove_consecutive_spaces_and_strip(a_str): class Timer(object): """ - Timer Class to mesure time. + Timer Class to measure time. Possess also few time utilities """ @@ -347,7 +347,7 @@ def get_all_dirs_under(root_dir, ignored_dirs = []):#pylint:disable=W0102 def datetime2imapdate(a_datetime): """ - Transfrom in date format for IMAP Request + Transform in date format for IMAP Request """ if a_datetime: @@ -589,7 +589,7 @@ def convert_argv_to_unicode(a_str): except Exception, err: LOG.error(err) get_exception_traceback() - LOG.info("Convertion of %s from %s to a unicode failed. Will now convert to unicode using utf-8 encoding and ignoring errors (non utf-8 characters will be eaten)." % (a_str, terminal_encoding)) + LOG.info("Conversion of %s from %s to a unicode failed. Will now convert to unicode using utf-8 encoding and ignoring errors (non utf-8 characters will be eaten)." % (a_str, terminal_encoding)) LOG.info("Please set properly the Terminal encoding or use the [Localisation]:terminal_encoding property to set it.") u_str = unicode(a_str, encoding='utf-8', errors='ignore') @@ -633,7 +633,7 @@ def get_conf_defaults(): return the_cf else: - return gmv.conf.conf_helper.MockConf() #retrun MockObject that will play defaults + return gmv.conf.conf_helper.MockConf() #return MockObject that will play defaults #VERSION DETECTION PATTERN VERSION_PATTERN = r'\s*conf_version=\s*(?P\S*)\s*' diff --git a/src/gmv/imap_utils.py b/src/gmv/imap_utils.py index f30be16c..832fad82 100755 --- a/src/gmv/imap_utils.py +++ b/src/gmv/imap_utils.py @@ -481,7 +481,7 @@ def select_folder(self, a_folder_name, use_predef_names = True): @retry(3,1,2) # try 3 times to reconnect with a sleep time of 1 sec and a backoff of 2. The fourth time will wait 4 sec def list_all_folders(self): """ - Return all folders mainly for debuging purposes + Return all folders mainly for debugging purposes """ return self.server.xlist_folders() diff --git a/src/gmv/test_utils.py b/src/gmv/test_utils.py index 274579e8..89b64815 100755 --- a/src/gmv/test_utils.py +++ b/src/gmv/test_utils.py @@ -326,7 +326,7 @@ def diff_online_mailboxes(gmvaulter_a, gmvaulter_b): #pylint: disable=R0912, R09 #dumb search not optimisation #iterate over imap_ids_a and flag emails only in a but not in b - #remove emails from imap_ids_b everytime they are found + #remove emails from imap_ids_b every time they are found for data_infos in batch_fetcher_a: for gm_info in data_infos: gm_id = data_infos[gm_info]['X-GM-MSGID'] @@ -376,7 +376,7 @@ def print_diff_result(diff_result): def assert_login_is_protected(login): """ - Insure that the login is not my personnal mailbox + Insure that the login is not my personal mailbox """ if login != 'gsync.mtester@gmail.com': raise Exception("Beware login should be gsync.mtester@gmail.com and it is %s" % (login)) diff --git a/src/gmvault_essential_tests.py b/src/gmvault_essential_tests.py index 2b3ff4d4..beaffc0d 100755 --- a/src/gmvault_essential_tests.py +++ b/src/gmvault_essential_tests.py @@ -41,7 +41,7 @@ def setUp(self): #pylint:disable-msg=C0103 self.gmvault_test_login, self.gmvault_test_passwd = test_utils.read_password_file('/homespace/gaubert/.ssh/gmvault_test_passwd') self.ba_login, self.ba_passwd = test_utils.read_password_file('/homespace/gaubert/.ssh/ba_passwd') - #xoauth hanlding + #xoauth handling self.ga_login = 'guillaume.aubert@gmail.com' self.ga_cred = test_utils.get_oauth_cred(self.ga_login, '/homespace/gaubert/.ssh/ga_oauth') diff --git a/src/perf_tests.py b/src/perf_tests.py index d65c1ef3..8d60ba83 100755 --- a/src/perf_tests.py +++ b/src/perf_tests.py @@ -61,7 +61,7 @@ def _create_dirs(self, working_dir, nb_dirs, nb_files_per_dir): def test_read_lots_of_files(self): """ - Test to mesure how long it takes to list over 100 000 files + Test to measure how long it takes to list over 100 000 files On server: 250 000 meta files in 50 dirs (50,5000) => 9.74 sec to list them 100 000 meta files in 20 dirs (20,5000) => 3.068 sec to list them 60 000 meta files in 60 dirs (60,1000) => 1.826 sec to list them diff --git a/src/sandbox/common_gmvault.py b/src/sandbox/common_gmvault.py index b5db3c1d..66779dbc 100755 --- a/src/sandbox/common_gmvault.py +++ b/src/sandbox/common_gmvault.py @@ -48,7 +48,7 @@ def handle_restore_imap_error(the_exception, gm_id, db_gmail_ids_info, gmvaulter raise the_exception elif isinstance(the_exception, imaplib.IMAP4.error): - LOG.error("Catched IMAP Error %s" % (str(the_exception))) + LOG.error("Caught IMAP Error %s" % (str(the_exception))) LOG.exception(the_exception) #When the email cannot be read from Database because it was empty when returned by gmail imap @@ -209,7 +209,7 @@ def reset(self): """ self.to_fetch = self.imap_ids -#Client to support imap serch with non ascii char (not working because of imaplibs limitations) +#Client to support imap search with non ascii char (not working because of imaplibs limitations) '''class MonkeyIMAPClient(imapclient.IMAPClient): #pylint:disable=R0903,R0904 """ Need to extend the IMAPClient to do more things such as compression @@ -403,7 +403,7 @@ def __init__(self, db_root_dir, host, port, login, \ #instantiate gstorer self.gstorer = gmvault_db.GmailStorer(self.db_root_dir, self.use_encryption) - #timer used to mesure time spent in the different values + #timer used to measure time spent in the different values self.timer = gmvault_utils.Timer() @classmethod @@ -420,7 +420,8 @@ def get_operation_report(self): Return the error report """ the_str = "\n================================================================\n"\ - "Number of reconnections: %d.\nNumber of emails quarantined: %d.\n" \ + "Number of reconnections: %d.\n" \ + "Number of emails quarantined: %d.\n" \ "Number of emails that could not be fetched: %d.\n" \ "Number of emails that were returned empty by gmail: %d\n"\ "================================================================" \ @@ -803,7 +804,7 @@ def sync(self, imap_req = imap_utils.GIMAPFetcher.IMAP_ALL, compress_on_disk = T else: LOG.critical("\nSkip chats synchronization.\n") - #delete supress emails from DB since last sync + #delete suppress emails from DB since last sync if len(self.gstorer.get_db_owners()) <= 1: self.check_clean_db(db_cleaning) else: @@ -929,7 +930,7 @@ def check_clean_db(self, db_cleaning): LOG.debug("Got %s emails imap_id(s) from the Gmail Server." % (len(imap_ids))) - #delete supress emails from DB since last sync + #delete suppress emails from DB since last sync self._delete_sync(imap_ids, db_gmail_ids, db_gmail_ids_info, 'email') # get all chats ids @@ -946,7 +947,7 @@ def check_clean_db(self, db_cleaning): LOG.debug("Got %s chat imap_ids from the Gmail Server." % (len(chat_ids))) - #delete supress emails from DB since last sync + #delete suppress emails from DB since last sync self._delete_sync(chat_ids, db_chat_ids, db_gmail_ids_info , 'chat') else: LOG.critical("Chats IMAP Directory not visible on Gmail. Ignore deletion of chats.") @@ -1179,7 +1180,7 @@ def restore_emails(self, pivot_dir = None, extra_labels = [], restart = False): restore emails in a gmail account using batching to group restore If you are not in "All Mail" Folder, it is extremely fast to push emails. But it is not possible to reapply labels if you are not in All Mail because the uid which is returned - is dependant on the folder. On the other hand, you can restore labels in batch which would help gaining lots of time. + is dependent on the folder. On the other hand, you can restore labels in batch which would help gaining lots of time. The idea is to get a batch of 50 emails and push them all in the mailbox one by one and get the uid for each of them. Then create a dict of labels => uid_list and for each label send a unique store command after having changed dir """ diff --git a/src/sandbox/gmvault_multiprocess.py b/src/sandbox/gmvault_multiprocess.py index 34c38bf4..7d29e3b4 100755 --- a/src/sandbox/gmvault_multiprocess.py +++ b/src/sandbox/gmvault_multiprocess.py @@ -50,7 +50,7 @@ def handle_restore_imap_error(the_exception, gm_id, db_gmail_ids_info, gmvaulter raise the_exception elif isinstance(the_exception, imaplib.IMAP4.error): - LOG.error("Catched IMAP Error %s" % (str(the_exception))) + LOG.error("Caught IMAP Error %s" % (str(the_exception))) LOG.exception(the_exception) #When the email cannot be read from Database because it was empty when returned by gmail imap @@ -263,7 +263,7 @@ def __init__(self, db_root_dir, host, port, login, credential, read_only_access #instantiate gstorer self.gstorer = gmvault_db.GmailStorer(self.db_root_dir, self.use_encryption) - #timer used to mesure time spent in the different values + #timer used to measure time spent in the different values self.timer = gmvault_utils.Timer() @classmethod @@ -280,7 +280,8 @@ def get_operation_report(self): Return the error report """ the_str = "\n================================================================\n"\ - "Number of reconnections: %d.\nNumber of emails quarantined: %d.\n" \ + "Number of reconnections: %d.\n" \ + "Number of emails quarantined: %d.\n" \ "Number of emails that could not be fetched: %d.\n" \ "Number of emails that were returned empty by gmail: %d\n================================================================" \ % (self.error_report['reconnections'], \ @@ -673,7 +674,7 @@ def sync(self, imap_req = imap_utils.GIMAPFetcher.IMAP_ALL, compress_on_disk = T else: LOG.critical("\nSkip chats synchronization.\n") - #delete supress emails from DB since last sync + #delete suppress emails from DB since last sync if len(self.gstorer.get_db_owners()) <= 1: self.check_clean_db(db_cleaning) else: @@ -798,7 +799,7 @@ def check_clean_db(self, db_cleaning): LOG.debug("Got %s emails imap_id(s) from the Gmail Server." % (len(imap_ids))) - #delete supress emails from DB since last sync + #delete suppress emails from DB since last sync self._delete_sync(imap_ids, db_gmail_ids, db_gmail_ids_info, 'email') # get all chats ids @@ -815,7 +816,7 @@ def check_clean_db(self, db_cleaning): LOG.debug("Got %s chat imap_ids from the Gmail Server." % (len(chat_ids))) - #delete supress emails from DB since last sync + #delete suppress emails from DB since last sync self._delete_sync(chat_ids, db_chat_ids, db_gmail_ids_info , 'chat') else: LOG.critical("Chats IMAP Directory not visible on Gmail. Ignore deletion of chats.") @@ -1008,7 +1009,7 @@ def common_restore(self, the_type, db_gmail_ids_info, extra_labels = [], restart except imaplib.IMAP4.error, err: - LOG.error("Catched IMAP Error %s" % (str(err))) + LOG.error("Caught IMAP Error %s" % (str(err))) LOG.exception(err) #When the email cannot be read from Database because it was empty when returned by gmail imap @@ -1124,7 +1125,7 @@ def old_restore_chats(self, extra_labels = [], restart = False): #pylint:disable except imaplib.IMAP4.error, err: - LOG.error("Catched IMAP Error %s" % (str(err))) + LOG.error("Caught IMAP Error %s" % (str(err))) LOG.exception(err) #When the email cannot be read from Database because it was empty when returned by gmail imap @@ -1281,7 +1282,7 @@ def restore_emails(self, pivot_dir = None, extra_labels = [], restart = False): restore emails in a gmail account using batching to group restore If you are not in "All Mail" Folder, it is extremely fast to push emails. But it is not possible to reapply labels if you are not in All Mail because the uid which is returned - is dependant on the folder. On the other hand, you can restore labels in batch which would help gaining lots of time. + is dependent on the folder. On the other hand, you can restore labels in batch which would help gaining lots of time. The idea is to get a batch of 50 emails and push them all in the mailbox one by one and get the uid for each of them. Then create a dict of labels => uid_list and for each label send a unique store command after having changed dir """ @@ -1408,7 +1409,7 @@ def old_restore_emails(self, pivot_dir = None, extra_labels = [], restart = Fals restore emails in a gmail account using batching to group restore If you are not in "All Mail" Folder, it is extremely fast to push emails. But it is not possible to reapply labels if you are not in All Mail because the uid which is returned - is dependant on the folder. On the other hand, you can restore labels in batch which would help gaining lots of time. + is dependent on the folder. On the other hand, you can restore labels in batch which would help gaining lots of time. The idea is to get a batch of 50 emails and push them all in the mailbox one by one and get the uid for each of them. Then create a dict of labels => uid_list and for each label send a unique store command after having changed dir """ diff --git a/src/sandbox_tests.py b/src/sandbox_tests.py index f959205a..35d28d33 100755 --- a/src/sandbox_tests.py +++ b/src/sandbox_tests.py @@ -123,10 +123,10 @@ def ztest_encrypt_blowfish(self): content = gz_fd.read() cipher.initCTR() - crypted = cipher.encryptCTR(content) + encrypted = cipher.encryptCTR(content) cipher.initCTR() - decrypted = cipher.decryptCTR(crypted) + decrypted = cipher.decryptCTR(encrypted) self.assertEquals(decrypted, content) @@ -183,7 +183,7 @@ def ztest_memory_error_bug(self): def ztest_retry_mode(self): """ - Test that the decorators are functionning properly + Test that the decorators are functioning properly """ class MonkeyIMAPFetcher(imap_utils.GIMAPFetcher):