# HG changeset patch
# User Jeroen Demeyer <jdemeyer@cage.ugent.be>
# Date 1318877612 -7200
# Node ID 4af3521a79e6406e3932376e548871221c9d0e19
# Parent 6d54c8dcc3a7ca7a441f8b97d0b4adeecfcb9599
When doctesting, don't write files in $SAGE_ROOT
diff --git a/sage/interfaces/qepcad.py b/sage/interfaces/qepcad.py
a
|
b
|
|
515 | 515 | /\ |
516 | 516 | x^2 - 3 < 0 |
517 | 517 | |
| 518 | TESTS: |
| 519 | |
| 520 | Check the qepcad configuration file:: |
| 521 | |
| 522 | sage: from sage.misc.misc import SAGE_LOCAL |
| 523 | sage: open('%s/default.qepcadrc'%SAGE_LOCAL).readlines()[-1] |
| 524 | 'SINGULAR .../local/bin\n' |
| 525 | |
518 | 526 | AUTHORS: |
519 | 527 | |
520 | 528 | - Carl Witty (2008-03): initial version |
… |
… |
|
630 | 638 | |
631 | 639 | _command_info_cache = cache |
632 | 640 | |
633 | | _rewrote_qepcadrc = False |
634 | | def _rewrite_qepcadrc(): |
635 | | r""" |
636 | | Write the file \file{default.qepcadrc} to specify a path to Singular |
637 | | (which QEPCAD uses for Gr\"obner basis computations). |
638 | | |
639 | | EXAMPLES: |
640 | | sage: from sage.interfaces.qepcad import _rewrite_qepcadrc |
641 | | sage: _rewrite_qepcadrc() |
642 | | sage: from sage.misc.misc import SAGE_LOCAL |
643 | | sage: open('%s/default.qepcadrc'%SAGE_LOCAL).readlines()[-1] |
644 | | 'SINGULAR .../bin' |
645 | | """ |
646 | | global _rewrote_qepcadrc |
647 | | if _rewrote_qepcadrc: return |
648 | | |
649 | | SL = sage.misc.misc.SAGE_LOCAL |
650 | | fn = '%s/default.qepcadrc'%SL |
651 | | text = \ |
652 | | """# THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT |
653 | | |
654 | | ##################################################### |
655 | | # QEPCAD rc file. |
656 | | # This file allows for some customization of QEPCADB. |
657 | | # Right now, the ability to give a path to Singular, |
658 | | # so that it gets used for some computer algebra |
659 | | # computations is the only feature. |
660 | | ##################################################### |
661 | | SINGULAR %s/bin""" % SL |
662 | | |
663 | | open(fn, 'w').write(text) |
664 | | |
665 | 641 | # QEPCAD does not have a typical "computer algebra system" interaction |
666 | 642 | # model. Instead, you run QEPCAD once for each problem you wish to solve, |
667 | 643 | # then interact with it while you solve that problem. |
… |
… |
|
693 | 669 | sage: Qepcad_expect(memcells=100000, logfile=sys.stdout) |
694 | 670 | Qepcad |
695 | 671 | """ |
696 | | _rewrite_qepcadrc() |
697 | 672 | Expect.__init__(self, |
698 | 673 | name="QEPCAD", |
699 | 674 | # yuck: when QEPCAD first starts, |
… |
… |
|
1487 | 1462 | ... |
1488 | 1463 | Enter an informal description between '[' and ']': |
1489 | 1464 | """ |
1490 | | _rewrite_qepcadrc() |
1491 | 1465 | # This will only spawn local processes |
1492 | 1466 | os.system(_qepcad_cmd(memcells)) |
1493 | 1467 | |
diff --git a/sage/misc/session.pyx b/sage/misc/session.pyx
a
|
b
|
|
267 | 267 | Something similar happens for cython-defined functions.:: |
268 | 268 | |
269 | 269 | sage: g = cython_lambda('double x', 'x*x + 1.5') |
270 | | sage: save_session('tmp_f', verbose=True) |
| 270 | sage: save_session(tmp_f, verbose=True) |
271 | 271 | Saving... |
272 | 272 | Not saving g: g is a function, method, class or type |
273 | 273 | ... |