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
14668331
Commit
14668331
authored
Dec 15, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
ea0c1bd3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
lib/python/Shared/DC/ZRDB/DA.py
lib/python/Shared/DC/ZRDB/DA.py
+12
-6
No files found.
lib/python/Shared/DC/ZRDB/DA.py
View file @
14668331
...
@@ -11,8 +11,8 @@
...
@@ -11,8 +11,8 @@
__doc__
=
'''Generic Database adapter
__doc__
=
'''Generic Database adapter
$Id: DA.py,v 1.5
3 1998/12/02 12:11:49
jim Exp $'''
$Id: DA.py,v 1.5
4 1998/12/15 17:31:02
jim Exp $'''
__version__
=
'$Revision: 1.5
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.5
4
$'
[
11
:
-
2
]
import
OFS.SimpleItem
,
Aqueduct
,
RDB
import
OFS.SimpleItem
,
Aqueduct
,
RDB
import
DocumentTemplate
,
marshal
,
md5
,
base64
,
DateTime
,
Acquisition
,
os
import
DocumentTemplate
,
marshal
,
md5
,
base64
,
DateTime
,
Acquisition
,
os
...
@@ -22,7 +22,7 @@ from Globals import HTMLFile, MessageDialog
...
@@ -22,7 +22,7 @@ from Globals import HTMLFile, MessageDialog
from
cStringIO
import
StringIO
from
cStringIO
import
StringIO
import
sys
,
Globals
,
OFS
.
SimpleItem
,
AccessControl
.
Role
import
sys
,
Globals
,
OFS
.
SimpleItem
,
AccessControl
.
Role
from
string
import
atoi
,
find
,
join
,
split
from
string
import
atoi
,
find
,
join
,
split
import
IOBTree
,
DocumentTemplate
,
sqlvar
,
sqltest
,
sqlgroup
import
DocumentTemplate
,
sqlvar
,
sqltest
,
sqlgroup
from
time
import
time
from
time
import
time
from
zlib
import
compress
,
decompress
from
zlib
import
compress
,
decompress
md5new
=
md5
.
new
md5new
=
md5
.
new
...
@@ -32,6 +32,12 @@ from cPickle import dumps, loads
...
@@ -32,6 +32,12 @@ from cPickle import dumps, loads
from
Results
import
Results
from
Results
import
Results
from
App.Extensions
import
getBrain
from
App.Extensions
import
getBrain
try
:
raise
'waaa'
from
IOBTree
import
Bucket
except
:
Bucket
=
lambda
:{}
class
SQL
(
DocumentTemplate
.
HTML
):
class
SQL
(
DocumentTemplate
.
HTML
):
commands
=
{}
commands
=
{}
for
k
,
v
in
DocumentTemplate
.
HTML
.
commands
.
items
():
commands
[
k
]
=
v
for
k
,
v
in
DocumentTemplate
.
HTML
.
commands
.
items
():
commands
[
k
]
=
v
...
@@ -149,7 +155,7 @@ class DA(
...
@@ -149,7 +155,7 @@ class DA(
self
.
src
=
template
self
.
src
=
template
self
.
template
=
t
=
SQL
(
template
)
self
.
template
=
t
=
SQL
(
template
)
t
.
cook
()
t
.
cook
()
self
.
_v_cache
=
{},
IOBTree
.
Bucket
()
self
.
_v_cache
=
{},
Bucket
()
if
REQUEST
:
return
self
.
manage_editedDialog
(
REQUEST
)
if
REQUEST
:
return
self
.
manage_editedDialog
(
REQUEST
)
def
manage_advanced
(
self
,
key
,
max_rows
,
max_cache
,
cache_time
,
def
manage_advanced
(
self
,
key
,
max_rows
,
max_cache
,
cache_time
,
...
@@ -190,7 +196,7 @@ class DA(
...
@@ -190,7 +196,7 @@ class DA(
self
.
_setKey
(
key
)
self
.
_setKey
(
key
)
self
.
max_rows_
=
max_rows
self
.
max_rows_
=
max_rows
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
=
{},
Bucket
()
self
.
class_name_
,
self
.
class_file_
=
class_name
,
class_file
self
.
class_name_
,
self
.
class_file_
=
class_name
,
class_file
self
.
_v_brain
=
getBrain
(
self
.
class_file_
,
self
.
class_name_
,
1
)
self
.
_v_brain
=
getBrain
(
self
.
class_file_
,
self
.
class_name_
,
1
)
if
REQUEST
:
return
self
.
manage_editedDialog
(
REQUEST
)
if
REQUEST
:
return
self
.
manage_editedDialog
(
REQUEST
)
...
@@ -241,7 +247,7 @@ class DA(
...
@@ -241,7 +247,7 @@ class DA(
# Try to fetch from cache
# Try to fetch from cache
if
hasattr
(
self
,
'_v_cache'
):
cache
=
self
.
_v_cache
if
hasattr
(
self
,
'_v_cache'
):
cache
=
self
.
_v_cache
else
:
cache
=
self
.
_v_cache
=
{},
IOBTree
.
Bucket
()
else
:
cache
=
self
.
_v_cache
=
{},
Bucket
()
cache
,
tcache
=
cache
cache
,
tcache
=
cache
max_cache
=
self
.
max_cache_
max_cache
=
self
.
max_cache_
now
=
time
()
now
=
time
()
...
...
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