From 302f5fb7fa45477c69cd227ebf6fbdd542bd5db9 Mon Sep 17 00:00:00 2001
From: oysteini <oysteini@PVV.NTNU.NO>
Date: Wed, 12 May 2010 16:49:37 +0000
Subject: [PATCH] Fanger TSTP-signalet (^Z) hvis konfigurasjonen ber om det.

---
 conf.py       | 1 +
 text_based.py | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/conf.py b/conf.py
index 1830813..d55c10c 100644
--- a/conf.py
+++ b/conf.py
@@ -1,3 +1,4 @@
 db_url = 'sqlite:///data'
 quit_allowed = True
+stop_allowed = False
 show_tracebacks = True
diff --git a/text_based.py b/text_based.py
index c085cb6..0ed5d9c 100755
--- a/text_based.py
+++ b/text_based.py
@@ -4,6 +4,7 @@ import sqlalchemy
 import re
 import sys
 import traceback
+import signal
 from helpers import *
 
 exit_commands = ['exit', 'abort', 'quit', 'bye', 'eat flaming death']
@@ -682,7 +683,8 @@ def retrieve_product(search_str, session):
 	return search_ui(search_product, search_str, 'product', session)
 
 
-#main = MainMenu()
+if not conf.stop_allowed:
+	signal.signal(signal.SIGTSTP, signal.SIG_IGN)
 main = Menu('Dibbler main menu',
 	    items=[BuyMenu(), ProductListMenu(), ShowUserMenu(),
 		   AdjustCreditMenu(), TransferMenu(),