old_contents: #
  # Copyright (c) 2005-2006 rPath, Inc.
  #
  # All Rights Reserved
  #
  
  WAITING, RUNNING, FINISHED, DELETED, ERROR, NOJOB = range(0, 6)
  
  STATUSES = range(0, 6)
  statusNames = {
      WAITING: "Waiting",
      RUNNING: "Running",
      FINISHED: "Finished",
      DELETED: "Deleted",
      ERROR: "Error",
      NOJOB: "No Job",
  
  }
  
  statusCodeNames = {
      WAITING: "STATUS_WAITING",
      RUNNING: "STATUS_RUNNING",
      FINISHED: "STATUS_FINISHED",
      DELETED: "STATUS_DELETED",
      ERROR: "STATUS_ERROR",
      NOJOB: "STATUS_NOJOB",
      9999:  "STATUS_UNKNOWN",
  }
  
  # code generator run by make to generate javascript constants
  # should only be run by the makefile in mint/web/content/javascript
  def codegen():
      s = "// this Javascript was generated by mint/jobstatus.py\n"
      s += "// do not edit or check into source control\n"
  
      s += "var statusNames = { \n"
      i = []
      for k, v in statusNames.items():
          i.append("    '%d':  '%s'" % (k, v,))
      s += ",\n".join(i)
      s += "\n};\n"
  
      for k, v in statusCodeNames.items():
          s += "var %s = %d;\n" % (v, k,)
      return s
  
  
  if __name__ == "__main__":
      import sys
      if len(sys.argv) > 1 and sys.argv[1] == "--genjs":
          print codegen()
          sys.exit(0)
      else:
          sys.exit(1)
  
new_contents: #
  # Copyright (c) 2005-2006 rPath, Inc.
  #
  # All Rights Reserved
  #
  
  UNKNOWN, WAITING, RUNNING, FINISHED, DELETED, ERROR, NOJOB = range(-1, 6)
  
  STATUSES = range(-1, 6)
  statusNames = {
      UNKNOWN: "Unknown",
      WAITING: "Waiting",
      RUNNING: "Running",
      FINISHED: "Finished",
      DELETED: "Deleted",
      ERROR: "Error",
      NOJOB: "No Job"
  }
  
  statusCodeNames = {
      UNKNOWN:  "STATUS_UNKNOWN",
      WAITING: "STATUS_WAITING",
      RUNNING: "STATUS_RUNNING",
      FINISHED: "STATUS_FINISHED",
      DELETED: "STATUS_DELETED",
      ERROR: "STATUS_ERROR",
      NOJOB: "STATUS_NOJOB",
  }
  
  # code generator run by make to generate javascript constants
  # should only be run by the makefile in mint/web/content/javascript
  def codegen():
      s = "// this Javascript was generated by mint/jobstatus.py\n"
      s += "// do not edit or check into source control\n"
  
      s += "var statusNames = { \n"
      i = []
      for k, v in statusNames.items():
          i.append("    '%d':  '%s'" % (k, v,))
      s += ",\n".join(i)
      s += "\n};\n"
  
      for k, v in statusCodeNames.items():
          s += "var %s = %d;\n" % (v, k,)
      return s
  
  
  if __name__ == "__main__":
      import sys
      if len(sys.argv) > 1 and sys.argv[1] == "--genjs":
          print codegen()
          sys.exit(0)
      else:
          sys.exit(1)
  
subject: make STATUS_UNKNOWN -1