~savoy/ade

f3998ec0431c82faa615f837e477e7d573081969 — savoy 2 years ago 7acf38d
feature: no more manual formatting switch

The sole check for whether or not a report should be put through
automatic formatting is decided if there exists a template for the
report. If there doesn't, it'll be formatted.

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

M ade/ade.py
M ade/lib/arguments.py
M ade/lib/remote.py
M ade/lib/reports.py
M ade/ade.py => ade/ade.py +0 -2
@@ 64,8 64,6 @@ def run(args: argparse.Namespace):
            setattr(report.required, key, value)
        elif key in report.optional.__annotations__:
            setattr(report.optional, key, value)
        elif key in ["formatting"]:
            setattr(report, key, value)

    print_pyinstaller("Constructing query: 2/6")
    construct = remote.Super(report)

M ade/lib/arguments.py => ade/lib/arguments.py +0 -7
@@ 321,13 321,6 @@ def parser(reports: list[rp.Report]) -> argparse.Namespace:
                },
            ),
            Argument(
                ("--formatting",),
                {
                    "action": "store_true",
                    "default": rep.report.formatting,
                },
            ),
            Argument(
                ("--joins",),
                {
                    "nargs": "+",

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

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

M ade/lib/reports.py => ade/lib/reports.py +0 -12
@@ 197,8 197,6 @@ class Report:
        The Human Name of the report.
    key : str
        They report_key used by ade to distinguish the report.
    formatting : bool
        Whether or not to format the output if it's a standard table or a pivot.
    filename : str
        The additional string to use for the filename. This string is used
        for the first half of the name e.g. if Parent.name="equipment_report"


@@ 216,7 214,6 @@ class Report:
    parent: Parent
    name: str
    key: str
    formatting: bool
    filename: str  # filechooser w/ default
    email: Optional[Email]
    required: RequiredArgs


@@ 631,14 628,6 @@ def parse(report_key: str, sub_key: str) -> Report:
    except TypeError:
        pass

    try:
        formatting: bool = sub["formatting"]
    except KeyError:
        if report_key in ("data", "__adhoc__"):
            formatting = True
        else:
            formatting = False

    email = sub["email"] if sub["email"] else report["email"]
    for x in ("subject", "message", "to", "cc"):
        try:


@@ 669,7 658,6 @@ def parse(report_key: str, sub_key: str) -> Report:
        parent=Parent(report["name"], report_key, report["ext"], report["description"]),
        name=sub["name"],
        key=sub_key,
        formatting=formatting,
        filename=filename,
        email=Email(email["to"], email["cc"], email["subject"], email["message"]),
        required=base,