# HG changeset patch # User Tom Hayward tom@tomh.us # Date 1360128738 28800 # Node ID 161d031e2eb610e34ae1824251d04c259d0e52b9 # Parent 8acf7f0440e42453cd920cb4397bec207da1db97 Refactor import so import logic is performed before validation. #185
diff -r 8acf7f0440e4 -r 161d031e2eb6 chirpui/importdialog.py --- a/chirpui/importdialog.py Tue Feb 05 20:59:51 2013 -0800 +++ b/chirpui/importdialog.py Tue Feb 05 21:32:18 2013 -0800 @@ -541,7 +541,13 @@ continue
self.ww.set(float(i) / end) - msgs = self.dst_radio.validate_memory(mem) + try: + msgs = self.dst_radio.validate_memory( + import_logic.import_mem(self.dst_radio, + self.src_radio.get_features(), + mem)) + except import_logic.DestNotCompatible: + msgs = self.dst_radio.validate_memory(mem) errs = [x for x in msgs if isinstance(x, chirp_common.ValidationError)] if errs: msg = _("Cannot be imported because") + ":\r\n"