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
9e603ad7
Commit
9e603ad7
authored
Sep 25, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new interfaces and RDB
parent
3ce0f3a9
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
160 additions
and
303 deletions
+160
-303
lib/python/Shared/DC/ZRDB/Aqueduct.py
lib/python/Shared/DC/ZRDB/Aqueduct.py
+69
-31
lib/python/Shared/DC/ZRDB/RDB.py
lib/python/Shared/DC/ZRDB/RDB.py
+87
-241
lib/python/Shared/DC/ZRDB/customDefaultReport.dtml
lib/python/Shared/DC/ZRDB/customDefaultReport.dtml
+4
-31
No files found.
lib/python/Shared/DC/ZRDB/Aqueduct.py
View file @
9e603ad7
...
...
@@ -10,13 +10,14 @@
##############################################################################
__doc__
=
'''Shared Aqueduct classes and functions
$Id: Aqueduct.py,v 1.
7 1997/09/22 18:43:46
jim Exp $'''
__version__
=
'$Revision: 1.
7
$'
[
11
:
-
2
]
$Id: Aqueduct.py,v 1.
8 1997/09/25 18:40:57
jim Exp $'''
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
from
Globals
import
HTMLFile
import
DocumentTemplate
,
DateTime
,
regex
,
regsub
,
string
,
urllib
,
rotor
import
binascii
DateTime
.
now
=
DateTime
.
DateTime
from
cStringIO
import
StringIO
dtml_dir
=
"%s/lib/python/Aqueduct/"
%
SOFTWARE_HOME
default_report_src
=
open
(
dtml_dir
+
'defaultReport.dtml'
).
read
()
...
...
@@ -34,7 +35,7 @@ class BaseQuery:
MissingArgumentError
=
'Bad Request'
def
_argdata
(
self
,
REQUEST
,
raw
=
0
,
return_missing_keys
=
0
):
args
=
self
.
arguments
args
=
self
.
_arg
argdata
=
{}
id
=
self
.
id
missing_keys
=
[]
...
...
@@ -98,7 +99,6 @@ class BaseQuery:
def
default_input_form
(
id
,
arguments
,
action
=
'query'
):
id
=
nicify
(
id
)
if
arguments
:
return
(
"%s
\
n
%s%s"
%
(
...
...
@@ -113,9 +113,17 @@ def default_input_form(id,arguments,action='query'):
map
(
lambda
a
:
(
'<tr>
\
t
<td><strong>%s</strong>:</td>
\
n
'
'
\
t
<td><input name="%s" width=30></td></tr>'
%
(
nicify
(
detypify
(
a
)),
a
))
,
arguments
.
keys
()
'
\
t
<td><input name="%s" width=30 value="%s">'
'</td></tr>'
%
(
nicify
(
a
[
0
]),
(
a
[
1
].
has_key
(
'type'
)
and
(
"%s:%s"
%
(
a
[
0
],
a
[
1
][
'type'
]))
or
a
[
0
]
),
a
[
1
].
has_key
(
'default'
)
and
a
[
1
][
'default'
]
or
''
))
,
arguments
.
items
()
),
'
\
n
'
),
'
\
n
<tr><td></td><td>
\
n
'
...
...
@@ -149,28 +157,29 @@ def default_input_form(id,arguments,action='query'):
custom_default_report_src
=
DocumentTemplate
.
File
(
dtml_dir
+
'customDefaultReport.dtml'
)
def
custom_default_report
(
result
,
action
=
''
):
names
=
result
.
name
s
()
def
custom_default_report
(
id
,
result
,
action
=
''
):
columns
=
result
.
_searchable_result_column
s
()
heading
=
(
'<tr>
\
n
%s</tr>'
%
string
.
joinfields
(
map
(
lambda
name
:
'
\
t
<th>%s</th>
\
n
'
%
nicify
(
name
),
name
s
),
map
(
lambda
c
:
'
\
t
<th>%s</th>
\
n
'
%
nicify
(
c
[
'name'
]
),
column
s
),
''
)
)
row
=
(
'<tr>
\
n
%s</tr>'
%
string
.
joinfields
(
map
(
lambda
name
,
meta
:
map
(
lambda
c
:
'
\
t
\
t
<td><!--#var %s%s--></td>
\
n
'
%
(
urllib
.
quote
(
name
),
meta
[
'type'
]
!=
's'
and
' null=""'
or
''
,
%
(
urllib
.
quote
(
c
[
'name'
]
),
c
[
'type'
]
!=
's'
and
' null=""'
or
''
,
),
names
,
result
.
__items__
),
columns
),
''
)
)
return
custom_default_report_src
(
heading
=
heading
,
row
=
row
,
action
=
action
)
return
custom_default_report_src
(
id
=
id
,
heading
=
heading
,
row
=
row
,
action
=
action
)
def
detypify
(
arg
):
l
=
string
.
find
(
arg
,
':'
)
...
...
@@ -228,6 +237,45 @@ def parse(text,
return parse(text[l:],prefix,result)
def parse(text,
result=None,
unparmre=regex.compile(
'
\
([
\
0
-
]
*
\
([
^
\
0
-
=
\
"]+
\
)
\
)'),
parmre=regex.compile(
'
\
([
\
0- ]*
\
([^
\
0- =
\
"
]+
\
)=
\
([^
\
0
- =
\
"
]+
\
)
\
)'),
qparmre=regex.compile(
'
\
([
\
0- ]*
\
([^
\
0- =
\
"
]+
\
)=
"
\
([^
"
]+
\
)
\
"
\
)
'),
):
if result is None: result = {}
__traceback_info__=text
if parmre.match(text) >= 0:
name=parmre.group(2)
value={'
default
':parmre.group(3)}
l=len(parmre.group(1))
elif qparmre.match(text) >= 0:
name=qparmre.group(2)
value={'
default
':qparmre.group(3)}
l=len(qparmre.group(1))
elif unparmre.match(text) >= 0:
name=unparmre.group(2)
l=len(unparmre.group(1))
value={}
else:
if not text or not strip(text): return result
raise InvalidParameter, text
lt=string.find(name,'
:
')
if lt > 0:
value['
type
']=name[lt+1:]
name=name[:lt]
result[name]=value
return parse(text[l:],prefix,result)
def quotedHTML(text,
character_entities=(
(regex.compile('
&
'), '
&
amp
;
'),
...
...
@@ -312,22 +360,12 @@ def delimited_output(results,REQUEST,RESPONSE):
)
##############################################################################
# Test functions:
#
def main():
# The "main" program for this module
import sys
print sys.argv[0]+" is a pure module and doesn'
t
do
anything
by
itself
.
"
if __name__ == "
__main__
": main()
##############################################################################
#
# $Log: Aqueduct.py,v $
# Revision 1.8 1997/09/25 18:40:57 jim
# new interfaces and RDB
#
# Revision 1.7 1997/09/22 18:43:46 jim
# Got rid of ManageHTML
#
...
...
lib/python/Shared/DC/ZRDB/RDB.py
View file @
9e603ad7
This diff is collapsed.
Click to expand it.
lib/python/Shared/DC/ZRDB/customDefaultReport.dtml
View file @
9e603ad7
<html>
<head>
<title>
<!--#if title-->
<!--#var title--><!--#else title-->
<!--#var id--><!--#/if title-->
Results
</title>
</head>
<body>
<FONT
SIZE=
"+2"
COLOR=
"#77003B"
>
<!--#if title-->
<!--#var title--><!--#else title-->
<!--#var id--><!--#/if title-->
Results
</FONT><br>
<em>
As of
<!--#var query_date-->
</em><br><br>
<!--#if query_results-->
<p>
Results for this
<a
href=
"<!--#var URL2-->/<!--#var id-->%(action)s"
>
<!--#if title-->
<!--#var title--><!--#else title-->
<!--#var id--><!--#/if title-->
query
</a>
:
</p>
<!--#in query_results size=50 start=query_start-->
<!--#in %(id)s size=50 start=query_start-->
<!--#if sequence-start-->
<!--#if previous-sequence-->
<a href="<!--#var
...
...
@@ -52,17 +32,10 @@
</a>
<!--#/if next-sequence-->
<!--#/if sequence-end-->
<!--#/in query_results-->
<!--#else query_results
-->
<!--#else
-->
There was no data matching this.
<!--#if title-->
<!--#var title--><!--#else title-->
<!--#var id--><!--#/if title-->
<a
href=
"<!--#var URL2-->/<!--#var id-->%(action)s"
>
query
</a>
.
There was no data matching this <!--#var title_or_id--> query.
<!--#/if query_results
-->
<!--#/in
-->
</body>
</html>
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