apparently bool is just for coercion, not parsing...
authorAndrew Sutherland <asutherland@asutherland.org>
Wed, 14 Jan 2009 10:30:23 -0800
changeset 29 8cb39d751bd8f4178ec57c155ddd2e100372a8e0
parent 28 9e25dd58c4371ff6c6bad1705f440900d6be62f2
child 30 810cdf745855f0a2387594c92ec0626d1757f778
push id1
push userroot
push dateWed, 08 Apr 2009 01:46:05 +0000
apparently bool is just for coercion, not parsing...
server/python/junius/bootstrap.py
--- a/server/python/junius/bootstrap.py
+++ b/server/python/junius/bootstrap.py
@@ -19,19 +19,20 @@ def setup_account(dbs):
     # example:
     #  mail.example.com,993,bob@example.com,sekret,True
     import os, os.path
     configPath = os.path.join(os.environ['HOME'], ".junius")
     f = open(configPath, 'r')
     data = f.read()
     f.close()
     host, portstr, username, password, sslstr = data.split(',')
+    ssl = not (sslstr.lower() in ['false', 'f', 'no', '0'])
     
     account = model.Account(
-        kind='imap', host=host, port=int(portstr), ssl=bool(sslstr),
+        kind='imap', host=host, port=int(portstr), ssl=ssl,
         username=username, password=password,
     )
     account.store(dbs.accounts)
 
 def path_part_nuke(path, count):
     for i in range(count):
         path = os.path.dirname(path)
     return path