From 2f80cd90f0e0b28100b4f12a526f377fce3440c9 Mon Sep 17 00:00:00 2001 From: Peng Zhihui Date: Mon, 16 Jun 2014 14:46:10 +0800 Subject: [PATCH] Fix problems when configure mountpoint: 1. focus on no item and press "Edit" button ,errors occur. 2. configure root mountpoint ok and and just press Enter when the focus on no button, errors occur. modified: text/ri_main.py modified: text/ri_newt.py --- text/ri_main.py | 12 +++++++----- text/ri_newt.py | 5 ++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/text/ri_main.py b/text/ri_main.py index 0684e7f..63fad0a 100644 --- a/text/ri_main.py +++ b/text/ri_main.py @@ -54,11 +54,13 @@ while True : elif list[count] == 'information': ri_newt.Prepar_installation() s = ri_newt.Screen.dict[list[count]].set_data() - - if int(s) == 0: - count = count + 1 - else: - count = count - 1 + try: + if int(s) == 0: + count = count + 1 + else: + count = count - 1 + except: + pass if count < 0 or count > len(list) - 1: ri_newt.Screen.screen.finish() diff --git a/text/ri_newt.py b/text/ri_newt.py index 89e46ea..8c3d2be 100644 --- a/text/ri_newt.py +++ b/text/ri_newt.py @@ -620,7 +620,10 @@ class MountPoint(Screen): s = Screen.yesno(self.title, 1, 6, 'TextboxReflowed', 'CListbox', 'eLabel', 'ButtonBar') if s == 0: - self.set_mountpoint(Screen.clistbox.current()) + try: + self.set_mountpoint(Screen.clistbox.current()) + except: + pass # edit mountpoint elif s == -1: break