[PATCH] Implement debug framework.

0 views
Skip to first unread message

fabian...@gmail.com

unread,
Nov 24, 2008, 6:50:55 AM11/24/08
to sympy-...@googlegroups.com, Fabian Seoane
From: Fabian Seoane <fab...@fseoane.net>

For now this is just a variable sympy.SYMPY_DEBUG that has values True/False.

Values for this are set using the environment variable SYMPY_DEBUG
---
doc/src/guide.txt | 9 +++++++++
sympy/__init__.py | 3 +++
2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/doc/src/guide.txt b/doc/src/guide.txt
index 69cf07c..70680dc 100644
--- a/doc/src/guide.txt
+++ b/doc/src/guide.txt
@@ -197,6 +197,15 @@ up::
Out[2]: False


+Debugging
+---------
+
+Starting with 0.6.4, you can turn on/off debugg messages with the environment variable
+SYMPY_DEBUG, which is expected to have the values True or False. For example, o turn on
+debugging, you would issue::
+
+ [user@localhost]: SYMPY_DEBUG=True ./bin/isympy
+
Functionality
-------------

diff --git a/sympy/__init__.py b/sympy/__init__.py
index 29da638..9d083db 100644
--- a/sympy/__init__.py
+++ b/sympy/__init__.py
@@ -37,5 +37,8 @@ from polynomials import factor

evalf._create_evalf_table()

+import os
+SYMPY_DEBUG = eval(os.getenv('SYMPY_DEBUG', 'False'))
+
# This is slow to import:
#import abc
--
1.6.0.2

Reply all
Reply to author
Forward
0 new messages