# 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
# class Paths():
#     def __init__(self):
#     def __str__(self):
#     def check(self, path):
#     def store(self, name, default, *args):
#     def data(self, *args):
#     def populations(self, *args):
#     def surveys(self, *args):
#     def models(self, *args):
#     def frbcat(self, *args):


import os
import subprocess
import sys
from frbpoppy.misc import pprint
from frbpoppy.paths import paths
    else:
        command.append('python3')

    # Command for changing port
    if port != 5006:
        command.append(f'--port={port}')

    # Add script path
    script = 'plot.py'
    out = os.path.join(os.path.dirname(__file__), script)
    command.append(out)

    # For the arguments
    command.append('--args')

    # Add tns
    command.append('-tns')
    if tns is False:
        command.append('False')
    if tns is True:
        command.append('True')
    elif type(tns) == str and len(tns) > 0:
        command.append(f'{tns}')

    # Add in populations
    for f in files:
        command.append(f'"{f}"')

    # Check whether plotting is needed
    if len(files) == 0 and tns is False:

# 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
# class Paths():
#     def __init__(self):
#     def __str__(self):
#     def check(self, path):
#     def store(self, name, default, *args):
#     def data(self, *args):
#     def populations(self, *args):
#     def surveys(self, *args):
#     def models(self, *args):
#     def frbcat(self, *args):


# Path: frbpoppy/do_plot.py
import os
import subprocess
import sys
from frbpoppy.misc import pprint
from frbpoppy.paths import paths

    else:
        command.append('python3')

    # Command for changing port
    if port != 5006:
        command.append(f'--port={port}')

    # Add script path
    script = 'plot.py'
    out = os.path.join(os.path.dirname(__file__), script)
    command.append(out)

    # For the arguments
    command.append('--args')

    # Add tns
    command.append('-tns')
    if tns is False:
        command.append('False')
    if tns is True:
        command.append('True')
    elif type(tns) == str and len(tns) > 0:
        command.append(f'{tns}')

    # Add in populations
    for f in files:
        command.append(f'"{f}"')

    # Check whether plotting is needed
    if len(files) == 0 and tns is False:

        pprint('No populations to plot')