コード例 #1
0
ファイル: maxima.py プロジェクト: sensen1/sage
    def _start(self):
        """
        Starts the Maxima interpreter.

        EXAMPLES::

            sage: m = Maxima()
            sage: m.is_running()
            False
            sage: m._start()
            sage: m.is_running()
            True

        Test that we can use more than 256MB RAM (see :trac:`6772`)::

            sage: a = maxima(10)^(10^5)
            sage: b = a^600              # long time -- about 10-15 seconds

        """
        Expect._start(self)
        self._sendline(r":lisp (defun tex-derivative (x l r) (tex (if $derivabbrev (tex-dabbrev x) (tex-d x '\\partial)) l r lop rop ))")

        # Don't use ! for factorials (#11539)
        self._sendline(":lisp (remprop 'mfactorial 'grind)")

        # Remove limit on the max heapsize (since otherwise it defaults
        # to 256MB with ECL).
        self._sendline(":lisp (ext:set-limit 'ext:heap-size 0)")
        self._eval_line('0;')

        # set random seed
        self.set_seed(self._seed)
コード例 #2
0
ファイル: gap.py プロジェクト: bgxcpku/sagelib
 def _start(self):
     """
     EXAMPLES::
     
         sage: g = Gap()
         sage: g.is_running()
         False
         sage: g._start()
         sage: g.is_running()
         True
         sage: g.quit()
     """
     if self.__use_workspace_cache and not os.path.exists(WORKSPACE):
         gap_reset_workspace()
     global first_try
     n = self._session_number
     try:
         Expect._start(self, "Failed to start GAP.")
     except Exception, msg:
         if self.__use_workspace_cache and first_try:
             print "A workspace appears to have been corrupted... automatically rebuilding (this is harmless)."
             first_try = False
             self._expect = None
             expect.failed_to_start.remove(self.name())
             gap_reset_workspace(verbose=False)
             Expect._start(self, "Failed to start GAP.")
             self._session_number = n 
             return
         raise RuntimeError, msg
コード例 #3
0
    def _start(self):
        """
        Starts the Maxima interpreter.

        EXAMPLES::

            sage: m = Maxima()
            sage: m.is_running()
            False
            sage: m._start()
            sage: m.is_running()
            True

        Test that we can use more than 256MB RAM (see trac 6722):

            sage: a = maxima(10)^(10^5)
            sage: b = a^600              # long time -- about 10-15 seconds

        """
        Expect._start(self)
        self._sendline(r":lisp (defun tex-derivative (x l r) (tex (if $derivabbrev (tex-dabbrev x) (tex-d x '\\partial)) l r lop rop ))")

        # Don't use ! for factorials (#11539)
        self._sendline(":lisp (remprop 'mfactorial 'grind)")

        # Remove limit on the max heapsize (since otherwise it defaults
        # to 256MB with ECL).
        self._sendline(":lisp (ext:set-limit 'ext:heap-size 0)")
        self._eval_line('0;')
コード例 #4
0
 def _start(self):
     try:
         Expect._start(self)
     except RuntimeError:
         raise RuntimeError, "You must install the optional Kash package to use Kash from SAGE."
     # Turn off the annoying timer.
     self.eval('Time(false);')
コード例 #5
0
ファイル: kash.py プロジェクト: bgxcpku/sagelib
 def _start(self):
     try:
         Expect._start(self)
     except RuntimeError:
         raise RuntimeError, "You must install the optional Kash package to use Kash from Sage."
     # Turn off the annoying timer.
     self.eval('Time(false);')
コード例 #6
0
ファイル: gap.py プロジェクト: thalespaiva/sagelib
 def _start(self):
     """
     EXAMPLES::
     
         sage: g = Gap()
         sage: g.is_running()
         False
         sage: g._start()
         sage: g.is_running()
         True
         sage: g.quit()
     """
     if self.__use_workspace_cache and not os.path.exists(WORKSPACE):
         gap_reset_workspace()
     global first_try
     n = self._session_number
     try:
         Expect._start(self, "Failed to start GAP.")
     except Exception, msg:
         if self.__use_workspace_cache and first_try:
             print "A workspace appears to have been corrupted... automatically rebuilding (this is harmless)."
             first_try = False
             self._expect = None
             expect.failed_to_start.remove(self.name())
             gap_reset_workspace(verbose=False)
             Expect._start(self, "Failed to start GAP.")
             self._session_number = n
             return
         raise RuntimeError, msg
コード例 #7
0
ファイル: gp.py プロジェクト: robertzk/lmfdb
    def _start(self, alt_message=None, block_during_init=True):
        r"""
        Restart the underlying process.

        .. note:: This is handled by the Expect class, except that we
           need to reset the breakloop configuration parameter.
        """
        Expect._start(self, alt_message=alt_message, block_during_init=block_during_init)
        self.set_default('breakloop',0)
コード例 #8
0
    def _start(self):
        """
        Starts Scilab and sets some options.

        EXAMPLES:
            sage: scilab._start()                       # optional - scilab
        """
        Expect._start(self)
        self.eval("mode(0)")
コード例 #9
0
ファイル: lisp.py プロジェクト: bopopescu/spd_notebook
 def _start(self, *args, **kwds):
     """
     EXAMPLES:
         sage: l = Lisp()
         sage: l.is_running()
         False
         sage: l._start()
         sage: l.is_running()
         True
     """
     Expect._start(self, *args, **kwds)
     self.__in_seq = 1
コード例 #10
0
ファイル: lisp.py プロジェクト: pombredanne/spd_notebook
 def _start(self, *args, **kwds):
     """
     EXAMPLES:
         sage: l = Lisp()
         sage: l.is_running()
         False
         sage: l._start()
         sage: l.is_running()
         True
     """
     Expect._start(self, *args, **kwds)
     self.__in_seq = 1
コード例 #11
0
ファイル: gp.py プロジェクト: BlairArchibald/sage
 def _start(self, alt_message=None, block_during_init=True):
     Expect._start(self, alt_message, block_during_init)
     # disable timer
     self._eval_line('default(timer,0);')
     # disable the break loop, otherwise gp will seem to hang on errors
     self._eval_line('default(breakloop,0);')
     # list of directories where gp will look for scripts (only current working directory)
     self._eval_line('default(path,".");')
     # location of elldata, seadata, galdata
     self._eval_line('default(datadir, "$SAGE_LOCAL/share/pari");')
     # executable for gp ?? help
     self._eval_line('default(help, "$SAGE_LOCAL/bin/gphelp -detex");')
     # logfile disabled since Expect already logs
     self._eval_line('default(log,0);')
コード例 #12
0
 def _start(self, alt_message=None, block_during_init=True):
     Expect._start(self, alt_message, block_during_init)
     # disable timer
     self._eval_line('default(timer,0);')
     # disable the break loop, otherwise gp will seem to hang on errors
     self._eval_line('default(breakloop,0);')
     # list of directories where gp will look for scripts (only current working directory)
     self._eval_line('default(path,".");')
     # location of elldata, seadata, galdata
     self._eval_line('default(datadir, "$SAGE_LOCAL/share/pari");')
     # executable for gp ?? help
     self._eval_line('default(help, "$SAGE_LOCAL/bin/gphelp -detex");')
     # logfile disabled since Expect already logs
     self._eval_line('default(log,0);')
コード例 #13
0
ファイル: octave.py プロジェクト: sajedel/testsage
    def _start(self):
        """
        Starts the Octave process.

        EXAMPLES::

            sage: o = Octave()    # optional - octave
            sage: o.is_running()  # optional - octave
            False
            sage: o._start()      # optional - octave
            sage: o.is_running()  # optional - octave
            True
        """
        Expect._start(self)
        self.eval("page_screen_output=0;")
        self.eval("format none;")
コード例 #14
0
ファイル: octave.py プロジェクト: pombredanne/sage-1
 def _start(self):
     """
     Starts the Octave process.
     
     EXAMPLES::
     
         sage: o = Octave()    # optional - octave
         sage: o.is_running()  # optional - octave
         False
         sage: o._start()      # optional - octave
         sage: o.is_running()  # optional - octave
         True
     """
     Expect._start(self)
     self.eval("page_screen_output=0;")
     self.eval("format none;")
コード例 #15
0
ファイル: axiom.py プロジェクト: williamstein/sagelib
 def _start(self):
     """
     Start the Axiom interpreter.
     
     EXAMPLES::
     
         sage: a = Axiom()
         sage: a.is_running()
         False
         sage: a._start()     #optional - axiom
         sage: a.is_running() #optional - axiom
         True
         sage: a.quit()       #optional - axiom
     """
     Expect._start(self)
     out = self._eval_line(')set functions compile on', reformat=False)
     out = self._eval_line(')set output length 245', reformat=False)
     out = self._eval_line(')set message autoload off', reformat=False)
コード例 #16
0
ファイル: axiom.py プロジェクト: bopopescu/sagelib-1
 def _start(self):
     """
     Start the Axiom interpreter.
     
     EXAMPLES::
     
         sage: a = Axiom()
         sage: a.is_running()
         False
         sage: a._start()     #optional - axiom
         sage: a.is_running() #optional - axiom
         True
         sage: a.quit()       #optional - axiom
     """
     Expect._start(self)
     out = self._eval_line(')set functions compile on', reformat=False)
     out = self._eval_line(')set output length 245', reformat=False)
     out = self._eval_line(')set message autoload off', reformat=False)
コード例 #17
0
ファイル: nlgf.py プロジェクト: wmacmil/gf-contrib
 def _start(self):
     Expect._start(self)
     self.locals = sage_eval('globals()', cmds='load "%s"'%(nlgf_dir + 'prelude.sage'))
コード例 #18
0
 def _start(self):
     Expect._start(self)