Browse Source

clean code

PYADPT-55
David 3 years ago
parent
commit
aa39990b3b
3 changed files with 10 additions and 9 deletions
  1. +3
    -3
      test/miniimap.py
  2. +3
    -3
      test/sync_handshake.py
  3. +4
    -3
      test/sync_test.py

+ 3
- 3
test/miniimap.py View File

@ -7,7 +7,7 @@ from secrets import token_urlsafe
try:
import imap_settings as settings
except:
raise ValueError("Imap settings file not found, please check the readme - miniimap")
raise ValueError("Imap settings file not found, please check the readme")
def connect():
@ -16,8 +16,8 @@ def connect():
server.login(settings.IMAP_USER, settings.IMAP_PWD)
tmp, data = server.select('Inbox')
#When you connect to the inbox one of the parameters returned is the current
#number of messages in it
# When you connect to the inbox one of the parameters returned is the
# current number of messages in it
if os.environ.get('NUMMESSAGES') is None:
os.environ["NUMMESSAGES"] = data[0].decode("UTF-8")


+ 3
- 3
test/sync_handshake.py View File

@ -142,9 +142,6 @@ def shutdown_sync():
def run(name, color=None, imap=False, own_ident=1):
if imap:
import miniimap
import imap_settings
global device_name
device_name = name
@ -160,6 +157,9 @@ def run(name, color=None, imap=False, own_ident=1):
pEp.debug_color(36)
if imap:
import miniimap
import imap_settings
me = pEp.Identity(imap_settings.IMAP_EMAIL, name + " of " + imap_settings.IMAP_USER, name)
pEp.myself(me)
pEp.messageToSend = messageImapToSend


+ 4
- 3
test/sync_test.py View File

@ -21,8 +21,6 @@ import pathlib
def test_for(path, color=None, end_on=None, mt=False, imap=False):
if imap:
import miniimap
cwd = os.getcwd();
os.chdir(path)
@ -106,6 +104,9 @@ if __name__ == "__main__":
help="use imap instead of minimail")
options, args = optParser.parse_args()
if options.imap:
import miniimap
if options.cleanall:
options.clean = True
@ -133,7 +134,6 @@ if __name__ == "__main__":
if options.third:
setup("Pad")
elif options.backup:
rmrf("Backup")
@ -147,6 +147,7 @@ if __name__ == "__main__":
os.mkdir("Backup/TestInbox")
except FileExistsError:
pass
miniimap.backup_inbox()
else:
shutil.copytree("Phone", "Backup/Phone", symlinks=True, copy_function=shutil.copy2)


Loading…
Cancel
Save