コード例 #1
0
ファイル: lumm.py プロジェクト: pcraster/pcraster
  def __init__(self):
    """
    Constructor.

    Checks whether LUMMDIR environment variable is set.
    """

    self.__configurationFilename = None
    self.__configurationFileParser = None
    self.__tempDirectoryName = None
    self.__outputDirectoryName = None
    self.__logFilename = None
    self.__options = []
    self.__taskRunner = None
    self.__lummDirectoryName = None

    if u"LUMMDIR" in os.environ.keys():
      self.__lummDirectoryName = os.environ[u"LUMMDIR"]
    else:
      utils.showWarning("""\
LUMMDIR environment variable is not set!""")
      utils.showWarning("""\
We assume the directory of the configuration file contains the""")
      utils.showWarning("""\
LUMM software. This might not be the case. Set LUMMDIR to get rid""")
      utils.showWarning("""\
of this message.""")

    if utils.developAccountKor():
      developBinariesPath = u"/home/kor/pcrtree/bin/linux-develop"

      # Expand LD_LIBRARY_PATH.
      if not u"LD_LIBRARY_PATH" in os.environ.keys():
        os.environ[u"LD_LIBRARY_PATH"] = developBinariesPath
      else:
        os.environ[u"LD_LIBRARY_PATH"] = "%s:%s" % \
              (developBinariesPath, os.environ[u"LD_LIBRARY_PATH"])

      # Expand PATH.
      if not u"PATH" in os.environ.keys():
        os.environ[u"PATH"] = developBinariesPath
      else:
        os.environ[u"PATH"] = "%s:%s" % \
              (developBinariesPath, os.environ[u"PATH"])
コード例 #2
0
ファイル: lumm.py プロジェクト: pcraster/pcraster
#!/usr/bin/env python2.4

"""
This module contains the application class and the code for starting lumm.
"""

import ConfigParser, exceptions, optparse, os, random, sys, warnings
import binaryregression, independentvariables, \
         multinomialregression, splitdataset, taskrunner, utils


debug = False

if utils.developAccountKor():
  debug = True

# Filter out this warning.
warnings.filterwarnings(u"ignore",
         u"tempnam is a potential security risk to your program",
         RuntimeWarning)

class Lumm:
  """
  Main application class.
  """

  def __init__(self):
    """
    Constructor.

    Checks whether LUMMDIR environment variable is set.