From 2a41ab98fd1e914da9ae457bdd271fd005f8631e Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sat, 17 Dec 2016 20:33:14 +0100 Subject: [PATCH] remove the global variable screen this breaks other scripts otherwise --- borg_interface/interface_functions.py | 6 +++++- borg_interface/test.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/borg_interface/interface_functions.py b/borg_interface/interface_functions.py index 69ce82e..e856bdb 100644 --- a/borg_interface/interface_functions.py +++ b/borg_interface/interface_functions.py @@ -6,10 +6,10 @@ import interface_variables import curses int_vars = interface_variables -screen = curses.initscr() def get_param(prompt_string): + screen = curses.initscr() screen.clear() screen.border(0) screen.addstr(2, 2, prompt_string) @@ -19,6 +19,7 @@ def get_param(prompt_string): def draw_menu(): + screen = curses.initscr() screen.clear() screen.border(0) screen.addstr(2, 2, "Please enter a number...") @@ -33,6 +34,7 @@ def draw_menu(): def draw_screen(r, c, message): + screen = curses.initscr() screen.clear() screen.border(0) screen.addstr(r, c, message) @@ -57,6 +59,7 @@ def show_info(): def mount_archive(): + screen = curses.initscr() archive_name = get_param("Please enter the archive name: ").decode('utf-8') int_vars.mount_point = os.path.join('/tmp', archive_name) if not os.path.exists(int_vars.mount_point): @@ -156,6 +159,7 @@ def exit(): def ncurses_pause(c): + screen = curses.initscr() screen.border(0) screen.addstr(c, 2, "Press Enter to continue...") screen.refresh() diff --git a/borg_interface/test.py b/borg_interface/test.py index 236bdd3..e8ae83c 100755 --- a/borg_interface/test.py +++ b/borg_interface/test.py @@ -3,6 +3,7 @@ import subprocess import sys import time import socket +import pdb import interface_functions def take_backup():