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
edde903d
Commit
edde903d
authored
Aug 03, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extensions management aspecs of brains have been moved to App/Extensions.
parent
14cbd55e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
42 deletions
+9
-42
lib/python/Shared/DC/ZRDB/DA.py
lib/python/Shared/DC/ZRDB/DA.py
+9
-42
No files found.
lib/python/Shared/DC/ZRDB/DA.py
View file @
edde903d
...
@@ -11,8 +11,8 @@
...
@@ -11,8 +11,8 @@
__doc__
=
'''Generic Database adapter
__doc__
=
'''Generic Database adapter
$Id: DA.py,v 1.5
0 1998/07/12 23:15:09
jim Exp $'''
$Id: DA.py,v 1.5
1 1998/08/03 13:45:10
jim Exp $'''
__version__
=
'$Revision: 1.5
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.5
1
$'
[
11
:
-
2
]
import
OFS.SimpleItem
,
Aqueduct
.
Aqueduct
,
Aqueduct
.
RDB
import
OFS.SimpleItem
,
Aqueduct
.
Aqueduct
,
Aqueduct
.
RDB
import
DocumentTemplate
,
marshal
,
md5
,
base64
,
DateTime
,
Acquisition
,
os
import
DocumentTemplate
,
marshal
,
md5
,
base64
,
DateTime
,
Acquisition
,
os
...
@@ -30,6 +30,7 @@ import ExtensionClass
...
@@ -30,6 +30,7 @@ import ExtensionClass
import
DocumentTemplate.DT_Util
import
DocumentTemplate.DT_Util
from
cPickle
import
dumps
,
loads
from
cPickle
import
dumps
,
loads
from
Aqueduct.Results
import
Results
from
Aqueduct.Results
import
Results
from
App.Extensions
import
getBrain
class
SQL
(
DocumentTemplate
.
HTML
):
class
SQL
(
DocumentTemplate
.
HTML
):
commands
=
{}
commands
=
{}
...
@@ -191,8 +192,7 @@ class DA(
...
@@ -191,8 +192,7 @@ class DA(
self
.
max_cache_
,
self
.
cache_time_
=
max_cache
,
cache_time
self
.
max_cache_
,
self
.
cache_time_
=
max_cache
,
cache_time
self
.
_v_cache
=
{},
IOBTree
.
Bucket
()
self
.
_v_cache
=
{},
IOBTree
.
Bucket
()
self
.
class_name_
,
self
.
class_file_
=
class_name
,
class_file
self
.
class_name_
,
self
.
class_file_
=
class_name
,
class_file
if
modules
.
has_key
(
class_file
):
del
modules
[
class_file
]
self
.
_v_brain
=
getBrain
(
self
.
class_file_
,
self
.
class_name_
,
1
)
getBrain
(
self
)
if
REQUEST
:
return
self
.
manage_editedDialog
(
REQUEST
)
if
REQUEST
:
return
self
.
manage_editedDialog
(
REQUEST
)
def
manage_testForm
(
self
,
REQUEST
):
def
manage_testForm
(
self
,
REQUEST
):
...
@@ -310,7 +310,8 @@ class DA(
...
@@ -310,7 +310,8 @@ class DA(
else
:
result
=
DB__
.
query
(
query
,
self
.
max_rows_
)
else
:
result
=
DB__
.
query
(
query
,
self
.
max_rows_
)
if
hasattr
(
self
,
'_v_brain'
):
brain
=
self
.
_v_brain
if
hasattr
(
self
,
'_v_brain'
):
brain
=
self
.
_v_brain
else
:
brain
=
getBrain
(
self
)
else
:
brain
=
self
.
_v_brain
=
getBrain
(
self
.
class_file_
,
self
.
class_name_
)
if
type
(
result
)
is
type
(
''
):
if
type
(
result
)
is
type
(
''
):
result
=
Aqueduct
.
RDB
.
File
(
StringIO
(
result
),
brain
,
self
)
result
=
Aqueduct
.
RDB
.
File
(
StringIO
(
result
),
brain
,
self
)
else
:
else
:
...
@@ -434,46 +435,12 @@ class Traverse(ExtensionClass.Base):
...
@@ -434,46 +435,12 @@ class Traverse(ExtensionClass.Base):
return
getattr
(
self
.
__dict__
[
'_da'
],
name
)
return
getattr
(
self
.
__dict__
[
'_da'
],
name
)
braindir
=
SOFTWARE_HOME
+
'/Extensions'
modules
=
{}
def
getBrain
(
self
,
):
'Check/load a class'
module
=
self
.
class_file_
class_name
=
self
.
class_name_
if
not
module
and
not
class_name
:
c
=
Aqueduct
.
RDB
.
NoBrains
self
.
_v_brain
=
c
return
c
if
modules
.
has_key
(
module
):
m
=
modules
[
module
]
else
:
d
,
n
=
os
.
path
.
split
(
module
)
if
d
:
raise
ValueError
,
(
'The file name, %s, should be a simple file name'
%
module
)
m
=
{}
exec
open
(
"%s/%s.py"
%
(
braindir
,
module
))
in
m
modules
[
module
]
=
m
if
not
m
.
has_key
(
class_name
):
raise
ValueError
,
(
'The class, %s, is not defined in file, %s'
%
(
class_name
,
module
))
c
=
m
[
class_name
]
if
not
hasattr
(
c
,
'__bases__'
):
raise
ValueError
,
(
'%s, is not a class'
%
class_name
)
self
.
_v_brain
=
c
return
c
##############################################################################
##############################################################################
#
#
# $Log: DA.py,v $
# $Log: DA.py,v $
# Revision 1.51 1998/08/03 13:45:10 jim
# Extensions management aspecs of brains have been moved to App/Extensions.
#
# Revision 1.50 1998/07/12 23:15:09 jim
# Revision 1.50 1998/07/12 23:15:09 jim
# Changed editing screen:
# Changed editing screen:
# - size prefs now separate from Document prefs
# - size prefs now separate from Document prefs
...
...
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