#! /usr/bin/env python
#
# A script that reads a .sol file and prints the solution in it
#
#   readsol <model.sol>
#  _________________________________________________________________________
#
#  Coopr: A COmmon Optimization Python Repository
#  Copyright (c) 2008 Sandia Corporation.
#  This software is distributed under the BSD License.
#  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
#  the U.S. Government retains certain rights in this software.
#  For more information, see the FAST README.txt file.
#  _________________________________________________________________________

import sys
if sys.version_info[0:2] < (2,4):
   print ""
   print "ERROR: Pyomo requires Python 2.4 or newer"
   sys.exit(1)
from os.path import abspath, dirname
sys.path.insert(0, dirname(dirname(abspath(__file__))))
sys.path.append(".")
import os

import coopr.opt

##
## NOTE: the logic for the sol reader is in coopr/opt/base/sol.py
##
reader = coopr.opt.ReaderFactory("sol")
soln = reader(sys.argv[1])
soln.write()
