summaryrefslogtreecommitdiff
path: root/src/poezio.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2015-01-20 20:35:25 +0100
committermathieui <mathieui@mathieui.net>2015-01-20 20:35:25 +0100
commit1c5589bbd3f7f5a5b30fe9235a484ba040e4b159 (patch)
treedcaf7f66bababbd9e3f942353e87f68c3cfa60c5 /src/poezio.py
parenta2678b02d95fc82755018c95ed5e006dca235caf (diff)
downloadpoezio-1c5589bbd3f7f5a5b30fe9235a484ba040e4b159.tar.gz
poezio-1c5589bbd3f7f5a5b30fe9235a484ba040e4b159.tar.bz2
poezio-1c5589bbd3f7f5a5b30fe9235a484ba040e4b159.tar.xz
poezio-1c5589bbd3f7f5a5b30fe9235a484ba040e4b159.zip
Make the ncurses unicode check earlier
and improve the message.
Diffstat (limited to 'src/poezio.py')
-rw-r--r--src/poezio.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/poezio.py b/src/poezio.py
index 9a26e135..1a5a257e 100644
--- a/src/poezio.py
+++ b/src/poezio.py
@@ -19,6 +19,29 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import singleton
+def test_curses():
+ """
+ Check if the system ncurses linked with python has unicode capabilities.
+ """
+ import curses
+ if hasattr(curses, 'unget_wch'):
+ return True
+ print("""\
+ERROR: The current python executable is linked with a ncurses version that \
+has no unicode capabilities.
+
+This could mean that:
+ - python was built on a system where readline is linked against \
+libncurses and not libncursesw
+ - python was built without ncursesw headers available
+
+Please file a bug for your distribution or fix that on your system and then \
+recompile python.
+Poezio is currently unable to read your input or draw its interface properly,\
+ so it will now exit.""")
+ return False
+
+
def main():
"""
Enter point
@@ -75,4 +98,7 @@ def main():
pass
if __name__ == '__main__':
- main()
+ if test_curses():
+ main()
+ else:
+ sys.exit(1)