Changeset - f56d89462a86
[Not reviewed]
0 5 0
Brett Smith - 4 years ago 2020-07-29 21:30:07
brettcsmith@brettcsmith.org
reports: Add common properties to all ODS reports.
5 files changed with 8 insertions and 2 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/reports/accrual.py
Show inline comments
...
 
@@ -756,13 +756,14 @@ def main(arglist: Optional[Sequence[str]]=None,
 
        if rt_wrapper is None:
 
            logger.error("unable to generate aging report: RT client is required")
 
        else:
 
            now = datetime.datetime.now()
 
            if args.output_file is None:
 
                now = datetime.datetime.now()
 
                out_dir_path = config.repository_path() or Path()
 
                args.output_file = out_dir_path / now.strftime('AgingReport_%Y-%m-%d_%H:%M.ods')
 
                logger.info("Writing report to %s", args.output_file)
 
            out_bin = cliutil.bytes_output(args.output_file, stdout)
 
            report = AgingReport(rt_wrapper, out_bin)
 
            report.ods.set_common_properties(config.books_repo())
 
    elif args.report_type is ReportType.OUTGOING:
 
        rt_wrapper = config.rt_wrapper()
 
        if rt_wrapper is None:
conservancy_beancount/reports/fund.py
Show inline comments
...
 
@@ -394,6 +394,7 @@ def main(arglist: Optional[Sequence[str]]=None,
 
        report.write(fund_map.items())
 
    else:
 
        ods_report = ODSReport(args.start_date, args.stop_date)
 
        ods_report.set_common_properties(config.books_repo())
 
        ods_report.write(fund_map.items())
 
        if args.output_file is None:
 
            out_dir_path = config.repository_path() or Path()
conservancy_beancount/reports/ledger.py
Show inline comments
...
 
@@ -809,6 +809,7 @@ def main(arglist: Optional[Sequence[str]]=None,
 
    except ValueError as error:
 
        logger.error("%s: %r", *error.args)
 
        return 2
 
    report.set_common_properties(config.books_repo())
 
    report.write(postings)
 
    if not any(report.account_groups.values()):
 
        logger.warning("no matching postings found to report")
setup.py
Show inline comments
...
 
@@ -5,7 +5,7 @@ from setuptools import setup
 
setup(
 
    name='conservancy_beancount',
 
    description="Plugin, library, and reports for reading Conservancy's books",
 
    version='1.6.2',
 
    version='1.6.3',
 
    author='Software Freedom Conservancy',
 
    author_email='info@sfconservancy.org',
 
    license='GNU AGPLv3+',
tests/testutil.py
Show inline comments
...
 
@@ -271,6 +271,9 @@ class TestConfig:
 
    def books_loader(self):
 
        return self._books_loader
 

	
 
    def books_repo(self):
 
        return None
 

	
 
    def config_file_path(self):
 
        return test_path('userconfig/conservancy_beancount/config.ini')
 

	
0 comments (0 inline, 0 general)