You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
368 B

2 years ago
  1. # -*- coding: utf-8 -*-
  2. # This file is under GNU Affero General Public License 3.0
  3. # see LICENSE.txt
  4. from . import constants
  5. import pathlib
  6. def data_file_contents(name) -> str:
  7. """grab the contents of a file in the data folder"""
  8. path = pathlib.Path(__file__).parent / constants.DATADIR / name
  9. with path.open(mode='r') as fid:
  10. return fid.read()