# Path: frbpoppy/misc.py
# def pprint(*s, output=True):
#     """Hack to make for more informative print statements."""
#     f = inspect.stack()[1][1].split('/')[-1]
#     m = '{:13.13} |'.format(f)
# 
#     if output:
#         print(m, *s)
#     else:
#         lines = []
#         for e in s:
#             lines.append('\n'.join([f'{m} {f}' for f in e.split('\n')]))
#         return '\n'.join(lines)


import os.path
from frbpoppy.misc import pprint
        self.downloads = os.path.expanduser("~/Downloads")

        self.subfolders = ['data',
                           'frbcat',
                           'populations',
                           'surveys',
                           'models']

        self.config = {s: '' for s in self.subfolders}

    def __str__(self):
        """Define how to print a path object to a console."""
        s = 'Paths:'

        attributes = []
        for e in self.subfolders:
            attr = '\n\t{0:12.11}{1:.60}'.format(e, getattr(self, e)())
            attributes.append(attr)

        s += ''.join(attributes)

        return s

    def check(self, path):
        """Perform checks on path."""
        # Just convient to have files ending in a slash
        if path[-1] != '/':
            path += '/'

        if not os.path.exists(path):

# Path: frbpoppy/misc.py
# def pprint(*s, output=True):
#     """Hack to make for more informative print statements."""
#     f = inspect.stack()[1][1].split('/')[-1]
#     m = '{:13.13} |'.format(f)
# 
#     if output:
#         print(m, *s)
#     else:
#         lines = []
#         for e in s:
#             lines.append('\n'.join([f'{m} {f}' for f in e.split('\n')]))
#         return '\n'.join(lines)


# Path: frbpoppy/paths.py
import os.path
from frbpoppy.misc import pprint

        self.downloads = os.path.expanduser("~/Downloads")

        self.subfolders = ['data',
                           'frbcat',
                           'populations',
                           'surveys',
                           'models']

        self.config = {s: '' for s in self.subfolders}

    def __str__(self):
        """Define how to print a path object to a console."""
        s = 'Paths:'

        attributes = []
        for e in self.subfolders:
            attr = '\n\t{0:12.11}{1:.60}'.format(e, getattr(self, e)())
            attributes.append(attr)

        s += ''.join(attributes)

        return s

    def check(self, path):
        """Perform checks on path."""
        # Just convient to have files ending in a slash
        if path[-1] != '/':
            path += '/'

        if not os.path.exists(path):

            pprint(f"Creating directory {path}")