Browse Source

clean code

PYADPT-55 imap
David 6 years ago
parent
commit
aa39990b3b
  1. 6
      test/miniimap.py
  2. 6
      test/sync_handshake.py
  3. 7
      test/sync_test.py

6
test/miniimap.py

@ -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")

6
test/sync_handshake.py

@ -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

7
test/sync_test.py

@ -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