Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Push all configuration in the gp interface code
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Puydt committed Feb 17, 2015
1 parent e88642d commit 89e7171
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 57 deletions.
45 changes: 0 additions & 45 deletions build/pkgs/pari/gprc.expect

This file was deleted.

7 changes: 0 additions & 7 deletions build/pkgs/pari/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,6 @@ install()
fi

cd "$CUR"

# Copy gprc.expect to $SAGE_LOCAL/etc
cp -f "$TOP/gprc.expect" "$SAGE_LOCAL/etc"
if [ $? -ne 0 ]; then
echo >&2 "Error installing gprc.expect"
exit 1
fi
}


Expand Down
22 changes: 17 additions & 5 deletions src/sage/interfaces/gp.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def __init__(self, stacksize=10000000, # 10MB
Expect.__init__(self,
name = 'pari',
prompt = '\\? ',
command = "gp --emacs --quiet --stacksize %s"%stacksize,
command = "gp --fast --emacs --quiet --stacksize %s"%stacksize,
maxread = maxread,
server=server,
server_tmpdir=server_tmpdir,
Expand All @@ -212,6 +212,21 @@ def __init__(self, stacksize=10000000, # 10MB
self.__var_store_len = 0
self.__init_list_length = init_list_length

def _start(self, alt_message=None, block_during_init=True):
Expect._start(self, alt_message, block_during_init)
self._eval_line('default(compatible,0);')
# disable timer
self._eval_line('default(timer,0);')
# disable the break loop, otherwise gp will seem to hand 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);')

def _repr_(self):
"""
Expand Down Expand Up @@ -997,12 +1012,9 @@ def is_GpElement(x):
"""
return isinstance(x, GpElement)

from sage.env import DOT_SAGE, SAGE_ETC
from sage.env import DOT_SAGE
import os

# Set GPRC environment variable to $SAGE_ETC/gprc.expect
os.environ["GPRC"] = os.path.join(SAGE_ETC, 'gprc.expect')

# An instance
gp = Gp(logfile=os.path.join(DOT_SAGE,'gp-expect.log')) # useful for debugging!

Expand Down

0 comments on commit 89e7171

Please sign in to comment.