summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MAT/archive.py11
-rwxr-xr-xmat-gui15
2 files changed, 13 insertions, 13 deletions
diff --git a/MAT/archive.py b/MAT/archive.py
index 5b25ba0..e6f9e14 100644
--- a/MAT/archive.py
+++ b/MAT/archive.py
@@ -177,12 +177,13 @@ class TarStripper(GenericArchiveStripper):
177 cfile = mat.create_class_file(complete_name, False, add2archive=self.add2archive) 177 cfile = mat.create_class_file(complete_name, False, add2archive=self.add2archive)
178 if cfile: 178 if cfile:
179 cfile.remove_all() 179 cfile.remove_all()
180 tarout.add(complete_name, item.name, filter=self._remove) 180 elif self.add2archive or os.path.splitext(item.name)[1] in parser.NOMETA:
181 logging.info('%s\' format is either not supported or harmless' % item.name)
182 elif item.name in exclude_list:
183 logging.debug('%s is not supported, but MAt was told to add it anyway.' % item.name)
181 else: 184 else:
182 logging.info('%s\' format is not supported or harmless' % item.name) 185 continue
183 basename, ext = os.path.splitext(item.name) 186 tarout.add(complete_name, item.name, filter=self._remove)
184 if self.add2archive or ext in parser.NOMETA:
185 tarout.add(complete_name, item.name, filter=self._remove)
186 tarin.close() 187 tarin.close()
187 tarout.close() 188 tarout.close()
188 self.do_backup() 189 self.do_backup()
diff --git a/mat-gui b/mat-gui
index b618e8f..a1cb446 100755
--- a/mat-gui
+++ b/mat-gui
@@ -206,8 +206,7 @@ class GUI(object):
206 206
207 def cb_preferences_popup(self, button): 207 def cb_preferences_popup(self, button):
208 ''' Preferences popup ''' 208 ''' Preferences popup '''
209 dialog = Gtk.Dialog(_('Preferences'), self.window, 0, 209 dialog = Gtk.Dialog(_('Preferences'), self.window, 0, (Gtk.STOCK_OK, 0))
210 (Gtk.STOCK_OK, 0))
211 dialog.connect('delete-event', self.cb_hide_widget) 210 dialog.connect('delete-event', self.cb_hide_widget)
212 dialog.set_resizable(False) 211 dialog.set_resizable(False)
213 hbox = Gtk.HBox() 212 hbox = Gtk.HBox()
@@ -226,8 +225,7 @@ class GUI(object):
226 pdf_quality.set_tooltip_text(_('Reduce the produced PDF size and quality')) 225 pdf_quality.set_tooltip_text(_('Reduce the produced PDF size and quality'))
227 table.attach(pdf_quality, 0, 1, 0, 1) 226 table.attach(pdf_quality, 0, 1, 0, 1)
228 227
229 add2archive = Gtk.CheckButton(_('Add unsupported file to archives'), 228 add2archive = Gtk.CheckButton(_('Add unsupported file to archives'), False)
230 False)
231 add2archive.set_active(self.add2archive) 229 add2archive.set_active(self.add2archive)
232 add2archive.connect('toggled', self.__invert, 'add2archive') 230 add2archive.connect('toggled', self.__invert, 'add2archive')
233 add2archive.set_tooltip_text(_('Add non-supported (and so \ 231 add2archive.set_tooltip_text(_('Add non-supported (and so \
@@ -270,8 +268,7 @@ non-anonymised) file to output archive'))
270 ''' Add a file to the list if its format is supported ''' 268 ''' Add a file to the list if its format is supported '''
271 cf = CFile(filename, add2archive=self.add2archive, 269 cf = CFile(filename, add2archive=self.add2archive,
272 low_pdf_quality=self.pdf_quality) 270 low_pdf_quality=self.pdf_quality)
273 # if the file is supported by the mat, 271 # if the file is supported by the mat, and is writable (for usability's sake).
274 # and is writable (for usability's sake).
275 if cf.file and cf.file.is_writable: 272 if cf.file and cf.file.is_writable:
276 self.liststore.append([cf, cf.file.basename, _('Unknown')]) 273 self.liststore.append([cf, cf.file.basename, _('Unknown')])
277 return False 274 return False
@@ -392,6 +389,7 @@ non-anonymised) file to output archive'))
392 dialog.show_all() 389 dialog.show_all()
393 dialog.run() 390 dialog.run()
394 dialog.destroy() 391 dialog.destroy()
392 return [i[1] for i in store if i[0]]
395 393
396 def __mat_check(self, iterator): 394 def __mat_check(self, iterator):
397 ''' Check elements in iterator are clean ''' 395 ''' Check elements in iterator are clean '''
@@ -417,8 +415,9 @@ non-anonymised) file to output archive'))
417 if isinstance(self.liststore[line][0].file, archive.GenericArchiveStripper): 415 if isinstance(self.liststore[line][0].file, archive.GenericArchiveStripper):
418 unsupported_list = self.liststore[line][0].file.list_unsupported() 416 unsupported_list = self.liststore[line][0].file.list_unsupported()
419 if unsupported_list: 417 if unsupported_list:
420 self.__popup_archive(unsupported_list) 418 list_to_add = self.__popup_archive(unsupported_list)
421 yield True 419 if self.liststore[line][0].file.remove_all(list_to_add):
420 self.liststore[line][2] = _('Clean')
422 elif self.liststore[line][0].file.remove_all(): 421 elif self.liststore[line][0].file.remove_all():
423 self.liststore[line][2] = _('Clean') 422 self.liststore[line][2] = _('Clean')
424 yield True 423 yield True