Mercurial > p > roundup > code
comparison roundup/hyperdb.py @ 2514:091711fb2f8c
Initial logging integration: replace all debug prints with logging calls...
...clean up and replace some with info() logs.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 02 Jul 2004 05:22:09 +0000 |
| parents | 682eefe8ef23 |
| children | 58848e3b6bb8 |
comparison
equal
deleted
inserted
replaced
| 2512:f5542d92307a | 2514:091711fb2f8c |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: hyperdb.py,v 1.99 2004-06-24 06:39:06 richard Exp $ | 18 # $Id: hyperdb.py,v 1.100 2004-07-02 05:22:08 richard Exp $ |
| 19 | 19 |
| 20 """Hyperdatabase implementation, especially field types. | 20 """Hyperdatabase implementation, especially field types. |
| 21 """ | 21 """ |
| 22 __docformat__ = 'restructuredtext' | 22 __docformat__ = 'restructuredtext' |
| 23 | 23 |
| 24 # standard python modules | 24 # standard python modules |
| 25 import sys, os, time, re, shutil | 25 import sys, os, time, re, shutil |
| 26 | 26 |
| 27 # roundup modules | 27 # roundup modules |
| 28 import date, password | 28 import date, password |
| 29 | |
| 30 # configure up the DEBUG and TRACE captures | |
| 31 class Sink: | |
| 32 def write(self, content): | |
| 33 pass | |
| 34 DEBUG = os.environ.get('HYPERDBDEBUG', '') | |
| 35 if DEBUG and __debug__: | |
| 36 if DEBUG == 'stdout': | |
| 37 DEBUG = sys.stdout | |
| 38 else: | |
| 39 DEBUG = open(DEBUG, 'a') | |
| 40 else: | |
| 41 DEBUG = Sink() | |
| 42 TRACE = os.environ.get('HYPERDBTRACE', '') | |
| 43 if TRACE and __debug__: | |
| 44 if TRACE == 'stdout': | |
| 45 TRACE = sys.stdout | |
| 46 else: | |
| 47 TRACE = open(TRACE, 'w') | |
| 48 else: | |
| 49 TRACE = Sink() | |
| 50 def traceMark(): | |
| 51 print >>TRACE, '**MARK', time.ctime() | |
| 52 del Sink | |
| 53 | 29 |
| 54 # | 30 # |
| 55 # Types | 31 # Types |
| 56 # | 32 # |
| 57 class String: | 33 class String: |
