From: Fredrik Tolf Date: Sun, 12 May 2013 02:46:30 +0000 (+0200) Subject: Exit in a well-defined manner upon occurrence of said error. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=462b734307c7fecd6b57d6c61adaf81b62f03c74;p=automanga.git Exit in a well-defined manner upon occurrence of said error. --- diff --git a/automanga b/automanga index 0381786..36bd1cf 100755 --- a/automanga +++ b/automanga @@ -65,10 +65,15 @@ if libname is not None: sys.exit(1) else: libname = "local" - if len(args) > 0: - mng = manga.local.manga(args[0]) - else: - mng = manga.local.manga(".") + try: + if len(args) > 0: + mdir = args[0] + else: + mdir = "." + mng = manga.local.manga(mdir) + except TypeError: + sys.stderr.write("automanga: not a valid manga directory: %s\n" % mdir) + sys.exit(1) mprof = None if profile is None else profile.getmanga(libname, mng.id, True) if profile is not None: