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
4297b87b
Commit
4297b87b
authored
Jan 16, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the abilility to define constructors in brains.
parent
4d9e9896
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
lib/python/Shared/DC/ZRDB/RDB.py
lib/python/Shared/DC/ZRDB/RDB.py
+17
-4
No files found.
lib/python/Shared/DC/ZRDB/RDB.py
View file @
4297b87b
...
...
@@ -11,8 +11,8 @@
__doc__
=
'''Class for reading RDB files
$Id: RDB.py,v 1.1
0 1997/12/12 23:38:5
9 jim Exp $'''
__version__
=
'$Revision: 1.1
0
$'
[
11
:
-
2
]
$Id: RDB.py,v 1.1
1 1998/01/16 20:24:4
9 jim Exp $'''
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
import
regex
,
regsub
from
string
import
split
,
strip
,
lower
,
atof
,
atoi
,
atol
,
find
...
...
@@ -116,17 +116,27 @@ class File:
# Create a record class to hold the records.
names=tuple(names)
if record_classes.has_key(
names
):
if record_classes.has_key(
(names,brains)
):
r=record_classes[names,brains]
else:
class r(Record, Implicit, brains):
'
Result
record
class
'
'
Result
record
class
'
r.__record_schema__=schema
for k in filter(lambda k: k[:2]=='
__
', Record.__dict__.keys()):
setattr(r,k,getattr(Record,k))
record_classes[names,brains]=r
if hasattr(brains, '
__init__
'):
binit=brains.__init__
if hasattr(binit,'
im_func
'): binit=binit.im_func
def __init__(self, data, binit=binit):
Record.__init__(self,data)
binit(self)
r.__dict__['
__init__
']=__init__
self._class=r
# OK, we'
ve
read
meta
data
,
now
get
line
indexes
...
...
@@ -183,6 +193,9 @@ class File:
##############################################################################
#
# $Log: RDB.py,v $
# Revision 1.11 1998/01/16 20:24:49 jim
# Added the abilility to define constructors in brains.
#
# Revision 1.10 1997/12/12 23:38:59 jim
# Added support for text (t) column type.
#
...
...
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