Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
ca9ecce4
Commit
ca9ecce4
authored
Dec 05, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better brain and record-as-instance support.
parent
3e582f53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
lib/python/Shared/DC/ZRDB/RDB.py
lib/python/Shared/DC/ZRDB/RDB.py
+14
-6
No files found.
lib/python/Shared/DC/ZRDB/RDB.py
View file @
ca9ecce4
...
@@ -11,8 +11,8 @@
...
@@ -11,8 +11,8 @@
__doc__
=
'''Class for reading RDB files
__doc__
=
'''Class for reading RDB files
$Id: RDB.py,v 1.
8 1997/10/09 15:21:49
jim Exp $'''
$Id: RDB.py,v 1.
9 1997/12/05 21:27:58
jim Exp $'''
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
import
regex
,
regsub
import
regex
,
regsub
from
string
import
split
,
strip
,
lower
,
atof
,
atoi
,
atol
from
string
import
split
,
strip
,
lower
,
atof
,
atoi
,
atol
...
@@ -20,6 +20,7 @@ import DateTime
...
@@ -20,6 +20,7 @@ import DateTime
from
Missing
import
MV
from
Missing
import
MV
from
array
import
array
from
array
import
array
from
Record
import
Record
from
Record
import
Record
from
Acquisition
import
Implicit
Parsers
=
{
'n'
:
atof
,
Parsers
=
{
'n'
:
atof
,
'i'
:
atoi
,
'i'
:
atoi
,
...
@@ -30,12 +31,14 @@ Parsers={'n': atof,
...
@@ -30,12 +31,14 @@ Parsers={'n': atof,
record_classes
=
{}
record_classes
=
{}
class
NoBrains
:
pass
class
File
:
class
File
:
"""Class for reading RDB files
"""Class for reading RDB files
"""
"""
_index
=
None
_index
=
None
def
__init__
(
self
,
file
):
def
__init__
(
self
,
file
,
brains
=
NoBrains
):
self
.
_file
=
file
self
.
_file
=
file
readline
=
file
.
readline
readline
=
file
.
readline
...
@@ -104,13 +107,15 @@ class File:
...
@@ -104,13 +107,15 @@ class File:
# Create a record class to hold the records.
# Create a record class to hold the records.
names=tuple(names)
names=tuple(names)
if record_classes.has_key(names):
if record_classes.has_key(names):
r=record_classes[names]
r=record_classes[names
,brains
]
else:
else:
class r(Record): pass
class r(Record, Implicit, brains):
'
Result
record
class
'
r.__record_schema__=schema
r.__record_schema__=schema
for k in filter(lambda k: k[:2]=='
__
', Record.__dict__.keys()):
for k in filter(lambda k: k[:2]=='
__
', Record.__dict__.keys()):
setattr(r,k,getattr(Record,k))
setattr(r,k,getattr(Record,k))
record_classes[names]=r
record_classes[names
,brains
]=r
self._class=r
self._class=r
...
@@ -168,6 +173,9 @@ class File:
...
@@ -168,6 +173,9 @@ class File:
##############################################################################
##############################################################################
#
#
# $Log: RDB.py,v $
# $Log: RDB.py,v $
# Revision 1.9 1997/12/05 21:27:58 jim
# Better brain and record-as-instance support.
#
# Revision 1.8 1997/10/09 15:21:49 jim
# Revision 1.8 1997/10/09 15:21:49 jim
# Fixed name error in exception handler.
# Fixed name error in exception handler.
#
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment