#!/usr/bin/python
#
# Format a spec
#

import jsontemplate
import pscheduler
import sys

try:
   format = sys.argv[1]
except IndexError:
   format = 'text/plain'

json = pscheduler.json_load(exit_on_error=True, max_schema=3)

if format == 'text/plain':

   template = """
Sender   ......... {.section source}{source}{.or}Not Specified{.end}
Receiver ......... {.section dest}{dest}{.or}Not Specified{.end}
   """
else:

   pscheduler.fail("Unsupported format '%s'" % format)


print jsontemplate.expand(template, json).strip()
