Commits

Antonio Alvarado Hernández  committed 5bbfd20

minor changes before convert to python3

* added additional exception treatment in the bootstrap module
* removed `__future__`s from the `wa.shell` module

  • Participants
  • Parent commits e3603a6

Comments (0)

Files changed (2)

 TODO
 """
 
-from __future__ import print_function
-
 __all__ = ['main']
 
 
 
         # initializes the argument parser
         parser = ArgumentParser(prog=self._program,
-            description="A shell for web analysts 8-7")
+            description="A shell for lazy web analysts")
 
         parser.add_argument('-f', '--config-file', type=FileType('r+', 0),
             dest='config_file', default=config_file,
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 #
 # Copyright 2012,2013 Antonio Alvarado Hernández
 # under the License.
 #
 
-from wa import shell
+from logging import basicConfig, info, critical, INFO
 
-shell.main()
+import sys
+
+basicConfig(level=INFO, datefmt="%Y-%m-%d %H:%M:%S",
+    format="%(asctime)s [%(levelname)s]: %(message)s")
+
+try:
+    from wa import shell
+
+    shell.main()
+
+except KeyboardInterrupt:
+    info("exiting on user cancel")
+    sys.exit(0)
+
+except ImportError:
+    critical("unable to load the washell's main module: {0}". \
+        format(sys.exc_info()[1]))
+    sys.exit(1)
 
 # EOF