Exemplo n.º 1
0
 def finished(self):
     """
     Returns the finished datetime from the timer.
     """
     finished = self.timer.finished if isinstance(
         self.timer, Timer) else self.timer['finished']
     return epochptime(finished)
Exemplo n.º 2
0
def details(results):
    """
    Returns a string with text formated details about the report.
    """

    if isinstance(results, (list, tuple)):
        raise BadValue(
            "This report function works only on a single results object"
        )

    banner = (
        "Simulation: {} (Cloudscope v{})\n"
        "{}\n\n"
        "Ran on: {} ({})\n\n"
        "Settings\n"
        "========\n"
    ).format(
        results.simulation, results.version, results.topology['meta']['description'],
        epochptime(results.timer['started']).strftime('%b %d, %Y at %H:%M %Z'),
        results.timer['elapsed'],
        results.randseed,
    )

    longest = max(len(key) for key in results.settings)
    frmt = "{{: <{0}}} {{: >12}}".format(longest)


    return banner + "\n".join([
        frmt.format(title_snaked(key), value)
        for key, value in results.settings.items()
    ])
Exemplo n.º 3
0
 def finished(self):
     """
     Returns the finished datetime from the timer.
     """
     finished = self.timer.finished if isinstance(self.timer, Timer) else self.timer['finished']
     return epochptime(finished)