summaryrefslogtreecommitdiff
path: root/src/poezio.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-09-07 23:36:57 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-09-07 23:36:57 +0000
commitf8ab739a36f7599f4f84590694c02ff3e0f2dd71 (patch)
tree87ec4c833900da6f9c95b9a135be761de9d98e36 /src/poezio.py
parent7d7f585ed6640d73de9cfcfbe84a56e2ec4d6a5f (diff)
downloadpoezio-f8ab739a36f7599f4f84590694c02ff3e0f2dd71.tar.gz
poezio-f8ab739a36f7599f4f84590694c02ff3e0f2dd71.tar.bz2
poezio-f8ab739a36f7599f4f84590694c02ff3e0f2dd71.tar.xz
poezio-f8ab739a36f7599f4f84590694c02ff3e0f2dd71.zip
do not require argparse anymore, chmod in the directory in the python process directly, fix a little bit the Mafile
Diffstat (limited to 'src/poezio.py')
-rw-r--r--src/poezio.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/poezio.py b/src/poezio.py
index 23978055..542c9196 100644
--- a/src/poezio.py
+++ b/src/poezio.py
@@ -20,6 +20,12 @@
Starting point of poezio. Launches both the Connection and Gui
"""
+import os
+# chdir in the source directory, so that import are never failed
+# also, no need to use a sh script to "cd" in this directoy
+# before launching poezio.
+os.chdir(os.path.dirname(os.path.abspath(__file__)))
+
import curses
import sys
import traceback
@@ -49,16 +55,18 @@ def exception_handler(type_, value, trace):
then exit the program
"""
my_stderr.restaure()
- curses.endwin()
- curses.echo()
+ try:
+ curses.endwin()
+ curses.echo()
+ except: # if an exception is raised but initscr has never been called yet
+ pass
traceback.print_exception(type_, value, trace, None, sys.stderr)
- import os # used to quit the program even from a thread
- os.abort()
+ # import os # used to quit the program even from a thread
+ # os.abort()
sys.excepthook = exception_handler
import signal
-import os
from connection import Connection
from config import config