From bccdf8c233718162fda9d9398f1bcb7c364e1bd8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 3 Apr 2008 19:16:42 +0000 Subject: [PATCH] More helpful error message when XML database on reader gets corrupted. --- src/libprs500/gui2/main.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libprs500/gui2/main.py b/src/libprs500/gui2/main.py index 82129c09ca..613793256b 100644 --- a/src/libprs500/gui2/main.py +++ b/src/libprs500/gui2/main.py @@ -256,7 +256,17 @@ class Main(MainWindow, Ui_MainWindow): Called once metadata has been read for all books on the device. ''' if exception: - self.device_job_exception(id, description, exception, formatted_traceback) + if 'ExpatError' in str(exception): + error_dialog(self, _('Device database corrupted'), + _(''' +

The database of books on the reader is corrupted. Try the following: +

    +
  1. Unplug the reader. Wait for it to finish regenerating the database (i.e. wait till it is ready to be used). Plug it back in. Now it should work with %(app)s. If not try the next step.
  2. +
  3. Quit %(app)s. Find the file media.xml in the reader's main memory. Delete it. Unplug the reader. Wait for it to regenrate the file. Re-connect it and start %(app)s.
  4. +
+ ''')%dict(app=__appname__)).exec_() + else: + self.device_job_exception(id, description, exception, formatted_traceback) return mainlist, cardlist = result self.memory_view.set_database(mainlist)