Source code for openalea.sconsx.tools.gnuplot
# -*-python-*-
#--------------------------------------------------------------------------------
#
# OpenAlea.SConsX: SCons extension package for building platform
# independant packages.
#
# Copyright 2006-2009 INRIA - CIRAD - INRA
#
# File author(s): Christophe Pradal <christophe.prada@cirad.fr>
#
# Distributed under the Cecill-C License.
# See accompanying file LICENSE.txt or copy at
# http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html
#
# OpenAlea WebSite : http://openalea.gforge.inria.fr
#
#--------------------------------------------------------------------------------
""" Gnuplot configure environment. """
__license__ = "Cecill-C"
__revision__ = "$Id$"
import os, sys
from openalea.sconsx.config import *
[docs]
class Gnuplot:
def __init__(self, config):
self.name = 'gnuplot'
self.config = config
self._default = {}
[docs]
def default(self):
if CONDA_ENV:
self._default['bin'] = pj(CONDA_PREFIX,'bin')
elif isinstance(platform, Posix):
self._default['bin'] = pj('/usr','bin')
elif isinstance(platform, Win32):
self._default['bin'] = 'C:\\'
[docs]
def option( self, opts):
self.default()
opts.Add(PathVariable('gnuplot_bin',
'Gnuplot binary path',
self._default['bin']))
[docs]
def update(self, env):
""" Update the environment with specific flags """
pass
[docs]
def create(config):
" Create gnuplot tool "
gnuplot = Gnuplot(config)
return gnuplot