Skip to content

Commit 3c9d810

Browse files
author
Alexander Smishlajev
committed
print usage and exit if first non-option argument is not a directory
('roundup_mailgw help' produced traceback)
1 parent cde2207 commit 3c9d810

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

roundup/scripts/roundup_mailgw.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
1414
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1515
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
16-
#
17-
# $Id: roundup_mailgw.py,v 1.15 2004-05-06 01:12:24 richard Exp $
16+
#
17+
# $Id: roundup_mailgw.py,v 1.16 2004-05-12 17:50:58 a1s Exp $
1818

1919
"""Command-line script stub that calls the roundup.mailgw.
2020
"""
@@ -44,7 +44,7 @@ def usage(args, message=None):
4444
. with both an instance home and a mail spool file, or
4545
. with both an instance home and a POP/APOP server account.
4646
. with both an instance home and a IMAP/IMAPS server account.
47-
47+
4848
It also supports optional -C and -S arguments that allows you to set a
4949
fields for a class created by the roundup-mailgw. The default class if
5050
not specified is msg, but the other classes: issue, file, user can
@@ -88,12 +88,12 @@ def usage(args, message=None):
8888
It also allows you to specify a specific mailbox other than INBOX using
8989
this format:
9090
imap username:password@server mailbox
91-
91+
9292
IMAPS:
93-
Connect to an IMAP server over ssl.
93+
Connect to an IMAP server over ssl.
9494
This supports the same notation as IMAP.
9595
imaps username:password@server [mailbox]
96-
96+
9797
''')
9898
return 1
9999

@@ -120,7 +120,7 @@ def main(argv):
120120
instance_home = args[0]
121121
else:
122122
instance_home = os.environ.get('ROUNDUP_INSTANCE', '')
123-
if not instance_home:
123+
if not (instance_home and os.path.isdir(instance_home)):
124124
return usage(argv)
125125

126126
# get the instance

0 commit comments

Comments
 (0)