Exemplo n.º 1
0
 def __init__(self, executable, logger=None):
     if executable:
         os.environ['OCTAVE_EXECUTABLE'] = executable
     if 'OCTAVE_EXECUTABLE' not in os.environ and 'OCTAVE' in os.environ:
         os.environ['OCTAVE_EXECUTABLE'] = os.environ['OCTAVE']
     self.engine = OctaveEngine(stdin_handler=input)
     self.proc = self.engine.repl.child
     self.logger = logger or get_log()
     self._lines = []
     atexit.register(self.close)
Exemplo n.º 2
0
    def __init__(self, executable=None, logger=None, timeout=None,
                 oned_as='row', temp_dir=None):
        """Start Octave and set up the session.
        """
        self._oned_as = oned_as
        self._temp_dir = temp_dir or gettempdir()
        self._executable = executable
        atexit.register(lambda: _remove_temp_files(self._temp_dir))

        self.timeout = timeout
        if not logger is None:
            self.logger = logger
        else:
            self.logger = get_log()
        self._session = None
        self.restart()
Exemplo n.º 3
0
    def __init__(self, executable=None, logger=None, timeout=None,
                 oned_as='row', temp_dir=None, convert_to_float=True):
        """Start Octave and set up the session.
        """
        self._oned_as = oned_as
        self._executable = executable

        self.timeout = timeout
        if logger is not None:
            self.logger = logger
        else:
            self.logger = get_log()
        # self.logger.setLevel(logging.DEBUG)
        self._session = None
        self.temp_dir = temp_dir
        self._convert_to_float = convert_to_float
        self.restart()
Exemplo n.º 4
0
    def __init__(self, executable=None, logger=None, timeout=None,
                 oned_as='row', temp_dir=None, convert_to_float=True):
        """Start Octave and set up the session.
        """
        self._oned_as = oned_as
        self._executable = executable

        self.timeout = timeout
        if logger is not None:
            self.logger = logger
        else:
            self.logger = get_log()
        # self.logger.setLevel(logging.DEBUG)
        self._session = None
        self.temp_dir = temp_dir
        self._convert_to_float = convert_to_float
        self.restart()