diff --git a/test-coverage/index.html b/test-coverage/index.html index 8861b44d..b5e2165c 100644 --- a/test-coverage/index.html +++ b/test-coverage/index.html @@ -53,10 +53,10 @@

Coverage report: Total - 928 + 931 0 0 - 100% + 100% @@ -90,10 +90,10 @@

Coverage report: src/sync.py - 82 + 85 0 0 - 100% + 100% src/sync_drive.py @@ -126,7 +126,7 @@

Coverage report:

coverage.py v5.4, - created at 2024-07-28 18:07 +0000 + created at 2024-08-07 17:33 +0000

diff --git a/test-coverage/src___init___py.html b/test-coverage/src___init___py.html index 6d0039c3..87be5c15 100644 --- a/test-coverage/src___init___py.html +++ b/test-coverage/src___init___py.html @@ -194,7 +194,7 @@

« index     coverage.py v5.4, - created at 2024-07-28 18:07 +0000 + created at 2024-08-07 17:33 +0000

diff --git a/test-coverage/src_config_parser_py.html b/test-coverage/src_config_parser_py.html index 46196a65..268fe005 100644 --- a/test-coverage/src_config_parser_py.html +++ b/test-coverage/src_config_parser_py.html @@ -509,7 +509,7 @@

« index     coverage.py v5.4, - created at 2024-07-28 18:07 +0000 + created at 2024-08-07 17:33 +0000

diff --git a/test-coverage/src_email_message_py.html b/test-coverage/src_email_message_py.html index d5521e9e..2fd7d26e 100644 --- a/test-coverage/src_email_message_py.html +++ b/test-coverage/src_email_message_py.html @@ -108,7 +108,7 @@

« index     coverage.py v5.4, - created at 2024-07-28 18:07 +0000 + created at 2024-08-07 17:33 +0000

diff --git a/test-coverage/src_notify_py.html b/test-coverage/src_notify_py.html index 027fabc1..c69961a4 100644 --- a/test-coverage/src_notify_py.html +++ b/test-coverage/src_notify_py.html @@ -201,7 +201,7 @@

« index     coverage.py v5.4, - created at 2024-07-28 18:07 +0000 + created at 2024-08-07 17:33 +0000

diff --git a/test-coverage/src_sync_drive_py.html b/test-coverage/src_sync_drive_py.html index 292f3e54..f445bfad 100644 --- a/test-coverage/src_sync_drive_py.html +++ b/test-coverage/src_sync_drive_py.html @@ -408,7 +408,7 @@

« index     coverage.py v5.4, - created at 2024-07-28 18:07 +0000 + created at 2024-08-07 17:33 +0000

diff --git a/test-coverage/src_sync_photos_py.html b/test-coverage/src_sync_photos_py.html index 94e0df98..aaab09f6 100644 --- a/test-coverage/src_sync_photos_py.html +++ b/test-coverage/src_sync_photos_py.html @@ -397,7 +397,7 @@

« index     coverage.py v5.4, - created at 2024-07-28 18:07 +0000 + created at 2024-08-07 17:33 +0000

diff --git a/test-coverage/src_sync_py.html b/test-coverage/src_sync_py.html index 5a6d7437..61fc0d89 100644 --- a/test-coverage/src_sync_py.html +++ b/test-coverage/src_sync_py.html @@ -22,8 +22,8 @@

Coverage for src/sync.py :

Show keyboard shortcuts

- 82 statements   - + 85 statements   +

@@ -154,12 +154,12 @@

100 LOGGER.error("Error: 2FA is required. Please log in.") 

101 # Retry again 

102 sleep_for = config_parser.get_retry_login_interval(config=config) 

-

103 next_sync = ( 

-

104 datetime.datetime.now() + datetime.timedelta(seconds=sleep_for) 

-

105 ).strftime("%c") 

-

106 if sleep_for < 0: 

-

107 LOGGER.info("retry_login_interval is < 0, exiting ...") 

-

108 break 

+

103 if sleep_for < 0: 

+

104 LOGGER.info("retry_login_interval is < 0, exiting ...") 

+

105 break 

+

106 next_sync = ( 

+

107 datetime.datetime.now() + datetime.timedelta(seconds=sleep_for) 

+

108 ).strftime("%c") 

109 LOGGER.info(f"Retrying login at {next_sync} ...") 

110 last_send = notify.send( 

111 config=config, username=username, last_send=last_send 

@@ -171,57 +171,60 @@

117 "Password is not stored in keyring. Please save the password in keyring." 

118 ) 

119 sleep_for = config_parser.get_retry_login_interval(config=config) 

-

120 next_sync = ( 

-

121 datetime.datetime.now() + datetime.timedelta(seconds=sleep_for) 

-

122 ).strftime("%c") 

-

123 LOGGER.info(f"Retrying login at {next_sync} ...") 

-

124 last_send = notify.send( 

-

125 config=config, username=username, last_send=last_send 

-

126 ) 

-

127 sleep(sleep_for) 

-

128 continue 

-

129 

-

130 if "drive" not in config and "photos" in config: 

-

131 sleep_for = photos_sync_interval 

-

132 enable_sync_drive = False 

-

133 enable_sync_photos = True 

-

134 elif "drive" in config and "photos" not in config: 

-

135 sleep_for = drive_sync_interval 

-

136 enable_sync_drive = True 

-

137 enable_sync_photos = False 

-

138 elif ( 

-

139 "drive" in config 

-

140 and "photos" in config 

-

141 and drive_sync_interval <= photos_sync_interval 

-

142 ): 

-

143 sleep_for = photos_sync_interval - drive_sync_interval 

-

144 photos_sync_interval -= drive_sync_interval 

-

145 enable_sync_drive = True 

-

146 enable_sync_photos = False 

-

147 else: 

-

148 sleep_for = drive_sync_interval - photos_sync_interval 

-

149 drive_sync_interval -= photos_sync_interval 

-

150 enable_sync_drive = False 

-

151 enable_sync_photos = True 

-

152 next_sync = ( 

-

153 datetime.datetime.now() + datetime.timedelta(seconds=sleep_for) 

-

154 ).strftime("%c") 

-

155 LOGGER.info(f"Resyncing at {next_sync} ...") 

-

156 if ( 

-

157 config_parser.get_drive_sync_interval(config=config) < 0 

-

158 if "drive" in config 

-

159 else True and config_parser.get_photos_sync_interval(config=config) < 0 

-

160 if "photos" in config 

-

161 else True 

-

162 ): 

-

163 break 

-

164 sleep(sleep_for) 

+

120 if sleep_for < 0: 

+

121 LOGGER.info("retry_login_interval is < 0, exiting ...") 

+

122 break 

+

123 next_sync = ( 

+

124 datetime.datetime.now() + datetime.timedelta(seconds=sleep_for) 

+

125 ).strftime("%c") 

+

126 LOGGER.info(f"Retrying login at {next_sync} ...") 

+

127 last_send = notify.send( 

+

128 config=config, username=username, last_send=last_send 

+

129 ) 

+

130 sleep(sleep_for) 

+

131 continue 

+

132 

+

133 if "drive" not in config and "photos" in config: 

+

134 sleep_for = photos_sync_interval 

+

135 enable_sync_drive = False 

+

136 enable_sync_photos = True 

+

137 elif "drive" in config and "photos" not in config: 

+

138 sleep_for = drive_sync_interval 

+

139 enable_sync_drive = True 

+

140 enable_sync_photos = False 

+

141 elif ( 

+

142 "drive" in config 

+

143 and "photos" in config 

+

144 and drive_sync_interval <= photos_sync_interval 

+

145 ): 

+

146 sleep_for = photos_sync_interval - drive_sync_interval 

+

147 photos_sync_interval -= drive_sync_interval 

+

148 enable_sync_drive = True 

+

149 enable_sync_photos = False 

+

150 else: 

+

151 sleep_for = drive_sync_interval - photos_sync_interval 

+

152 drive_sync_interval -= photos_sync_interval 

+

153 enable_sync_drive = False 

+

154 enable_sync_photos = True 

+

155 next_sync = ( 

+

156 datetime.datetime.now() + datetime.timedelta(seconds=sleep_for) 

+

157 ).strftime("%c") 

+

158 LOGGER.info(f"Resyncing at {next_sync} ...") 

+

159 if ( 

+

160 config_parser.get_drive_sync_interval(config=config) < 0 

+

161 if "drive" in config 

+

162 else True and config_parser.get_photos_sync_interval(config=config) < 0 

+

163 if "photos" in config 

+

164 else True 

+

165 ): 

+

166 break 

+

167 sleep(sleep_for) 

diff --git a/test-coverage/src_usage_py.html b/test-coverage/src_usage_py.html index 41a5d394..cce239c4 100644 --- a/test-coverage/src_usage_py.html +++ b/test-coverage/src_usage_py.html @@ -189,7 +189,7 @@

« index     coverage.py v5.4, - created at 2024-07-28 18:07 +0000 + created at 2024-08-07 17:33 +0000

diff --git a/test-coverage/status.json b/test-coverage/status.json index a86790fc..2fad007d 100644 --- a/test-coverage/status.json +++ b/test-coverage/status.json @@ -1 +1 @@ -{"format":2,"version":"5.4","globals":"39d500336f42ed1e3d49ba0d1ecd0eea","files":{"src___init___py":{"hash":"1d1b33a887b47c72a76e55e77d2640aa","index":{"nums":[1,76,0,0,0,0,0],"html_filename":"src___init___py.html","relative_filename":"src/__init__.py"}},"src_config_parser_py":{"hash":"9823a492516d2ff9f2b8781b8f3edda9","index":{"nums":[1,228,0,0,0,0,0],"html_filename":"src_config_parser_py.html","relative_filename":"src/config_parser.py"}},"src_email_message_py":{"hash":"f1cd58e66273dace4abeac30f6057ce9","index":{"nums":[1,33,0,0,0,0,0],"html_filename":"src_email_message_py.html","relative_filename":"src/email_message.py"}},"src_notify_py":{"hash":"e5facbcf8c88387297fb2dc89ced6c0b","index":{"nums":[1,93,0,0,0,0,0],"html_filename":"src_notify_py.html","relative_filename":"src/notify.py"}},"src_sync_py":{"hash":"3684eb10665383a8585eb752bf9183bd","index":{"nums":[1,82,0,0,0,0,0],"html_filename":"src_sync_py.html","relative_filename":"src/sync.py"}},"src_sync_drive_py":{"hash":"0607f935f2fb395c4a36d2664abd60a2","index":{"nums":[1,202,0,0,0,0,0],"html_filename":"src_sync_drive_py.html","relative_filename":"src/sync_drive.py"}},"src_sync_photos_py":{"hash":"77be06319edac0cbe1335eb8ae45840a","index":{"nums":[1,128,0,0,0,0,0],"html_filename":"src_sync_photos_py.html","relative_filename":"src/sync_photos.py"}},"src_usage_py":{"hash":"f58f06fab14d89ea48e218a01eb0ff42","index":{"nums":[1,86,0,0,0,0,0],"html_filename":"src_usage_py.html","relative_filename":"src/usage.py"}}}} \ No newline at end of file +{"format":2,"version":"5.4","globals":"39d500336f42ed1e3d49ba0d1ecd0eea","files":{"src___init___py":{"hash":"1d1b33a887b47c72a76e55e77d2640aa","index":{"nums":[1,76,0,0,0,0,0],"html_filename":"src___init___py.html","relative_filename":"src/__init__.py"}},"src_config_parser_py":{"hash":"9823a492516d2ff9f2b8781b8f3edda9","index":{"nums":[1,228,0,0,0,0,0],"html_filename":"src_config_parser_py.html","relative_filename":"src/config_parser.py"}},"src_email_message_py":{"hash":"f1cd58e66273dace4abeac30f6057ce9","index":{"nums":[1,33,0,0,0,0,0],"html_filename":"src_email_message_py.html","relative_filename":"src/email_message.py"}},"src_notify_py":{"hash":"e5facbcf8c88387297fb2dc89ced6c0b","index":{"nums":[1,93,0,0,0,0,0],"html_filename":"src_notify_py.html","relative_filename":"src/notify.py"}},"src_sync_py":{"hash":"9bef2d7c40cfa01b813881c966377afb","index":{"nums":[1,85,0,0,0,0,0],"html_filename":"src_sync_py.html","relative_filename":"src/sync.py"}},"src_sync_drive_py":{"hash":"0607f935f2fb395c4a36d2664abd60a2","index":{"nums":[1,202,0,0,0,0,0],"html_filename":"src_sync_drive_py.html","relative_filename":"src/sync_drive.py"}},"src_sync_photos_py":{"hash":"77be06319edac0cbe1335eb8ae45840a","index":{"nums":[1,128,0,0,0,0,0],"html_filename":"src_sync_photos_py.html","relative_filename":"src/sync_photos.py"}},"src_usage_py":{"hash":"f58f06fab14d89ea48e218a01eb0ff42","index":{"nums":[1,86,0,0,0,0,0],"html_filename":"src_usage_py.html","relative_filename":"src/usage.py"}}}} \ No newline at end of file