Give error if a file is missing instead of saying 0 messages
authorMagnus Hagander <magnus@hagander.net>
Thu, 21 Jun 2012 12:51:29 +0000 (14:51 +0200)
committerMagnus Hagander <magnus@hagander.net>
Thu, 21 Jun 2012 12:51:29 +0000 (14:51 +0200)
loader/load_message.py

index e0fef30a86eb52530de86b54c6e4c7a219b94a0c..cfa56f3cc00813ae9b2eb682fe4a1354bc041bb4 100755 (executable)
@@ -83,6 +83,9 @@ if __name__ == "__main__":
                                        break
                                print "---------------------------------"
        elif opt.mbox:
+               if not os.path.isfile(opt.mbox):
+                       print "File %s does not exist" % opt.mbox
+                       sys.exit(1)
                mboxparser = MailboxBreakupParser(opt.mbox)
                while not mboxparser.EOF:
                        ap = ArchivesParserStorage()