~savoy/ade

49a1255673d1f2dc3bfda5df75b626f7138bbd45 — savoy 2 months ago d48efcc
bug: won't delete non comp.data sheets if template

Actual fix with the inclusion of separating whether or not the data
structure data should be formatted or not.

Signed-off-by: savoy <git@liberation.red>
1 files changed, 7 insertions(+), 6 deletions(-)

M ade/lib/remote.py
M ade/lib/remote.py => ade/lib/remote.py +7 -6
@@ 2792,7 2792,7 @@ class File:
            rng.value = data_struct.data
            # full.api.AutoFilter(Field=1)

            if not self.is_template or data_struct.structure.formatting:
            if data_struct.structure.formatting:
                if data_struct.pivot:
                    formatting.adhoc_pivot(
                        app, book, sht, rng, data_struct.data, data_struct.pivot


@@ 2800,11 2800,12 @@ class File:
                else:
                    formatting.adhoc_data(sht, rng, data_struct.data)

                for sheet in book.sheets:
                    if sheet.name not in [
                        i.structure.sheet for i in self.data.values()
                    ]:
                        sheet.delete()
                if not self.is_template:
                    for sheet in book.sheets:
                        if sheet.name not in [
                            i.structure.sheet for i in self.data.values()
                        ]:
                            sheet.delete()

            book.save(self.file)