Mercurial > p > roundup > code
comparison scripts/imapServer.py @ 5376:64b05e24dbd8
Python 3 preparation: convert print to a function.
Tool-assisted patch. It is possible that some "from __future__ import
print_function" are not in fact needed, if a file only uses print()
with a single string as an argument and so would work fine in Python 2
without that import.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Tue, 24 Jul 2018 09:54:52 +0000 |
| parents | 939dce88cfc2 |
| children | 35ea9b1efc14 |
comparison
equal
deleted
inserted
replaced
| 5375:1ad46057ae4a | 5376:64b05e24dbd8 |
|---|---|
| 28 | 28 |
| 29 *TODO*: | 29 *TODO*: |
| 30 Add an option for changing the uid/gid of the running process. | 30 Add an option for changing the uid/gid of the running process. |
| 31 """ | 31 """ |
| 32 | 32 |
| 33 from __future__ import print_function | |
| 33 import getpass | 34 import getpass |
| 34 import logging | 35 import logging |
| 35 import imaplib | 36 import imaplib |
| 36 import optparse | 37 import optparse |
| 37 import os | 38 import os |
| 74 self.username = raw_input('Username: ') | 75 self.username = raw_input('Username: ') |
| 75 if not self.username: | 76 if not self.username: |
| 76 raise ValueError, 'Invalid Username' | 77 raise ValueError, 'Invalid Username' |
| 77 | 78 |
| 78 if not self.password: | 79 if not self.password: |
| 79 print 'For server %s, user %s' % (self.server, self.username) | 80 print('For server %s, user %s' % (self.server, self.username)) |
| 80 self.password = getpass.getpass() | 81 self.password = getpass.getpass() |
| 81 # password can be empty because it could be superceeded | 82 # password can be empty because it could be superceeded |
| 82 # by a later entry | 83 # by a later entry |
| 83 | 84 |
| 84 #if self.mailbox is None: | 85 #if self.mailbox is None: |
