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
bb3ef58c
Commit
bb3ef58c
authored
Apr 15, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved urlbase method to webdav.common, modified DAV propertysheet to exclude
host & port info in src properties.
parent
ba6da303
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
+18
-18
lib/python/OFS/PropertySheets.py
lib/python/OFS/PropertySheets.py
+4
-4
lib/python/webdav/common.py
lib/python/webdav/common.py
+9
-4
lib/python/webdav/davcmds.py
lib/python/webdav/davcmds.py
+5
-10
No files found.
lib/python/OFS/PropertySheets.py
View file @
bb3ef58c
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Property sheets"""
__version__
=
'$Revision: 1.3
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
7
$'
[
11
:
-
2
]
import
time
,
string
,
App
.
Management
,
Globals
from
ZPublisher.Converters
import
type_converters
...
...
@@ -92,6 +92,7 @@ from DocumentTemplate.DT_Util import html_quote
from
Globals
import
HTMLFile
,
MessageDialog
from
string
import
find
,
join
,
lower
,
split
,
rfind
from
Acquisition
import
Implicit
,
Explicit
from
webdav.common
import
urlbase
from
ExtensionClass
import
Base
from
Globals
import
Persistent
...
...
@@ -620,9 +621,8 @@ class DAVProperties(Virtual, PropertySheet, View):
def
dav__source
(
self
):
vself
=
self
.
v_self
()
if
hasattr
(
vself
,
'meta_type'
)
and
vself
.
meta_type
in
\
(
'Document'
,
'DTML Document'
,
'DTML Method'
):
url
=
vself
.
absolute_url
()
if
hasattr
(
vself
,
'document_src'
):
url
=
urlbase
(
vself
.
absolute_url
())
return
'
\
n
<n:link>
\
n
'
\
' <n:src>%s</n:src>
\
n
'
\
' <n:dst>%s/document_src</n:dst>
\
n
'
\
...
...
lib/python/webdav/common.py
View file @
bb3ef58c
...
...
@@ -85,10 +85,9 @@
"""Commonly used functions for WebDAV support modules."""
__version__
=
'$Revision: 1.3 $'
[
11
:
-
2
]
import
string
,
time
__version__
=
'$Revision: 1.4 $'
[
11
:
-
2
]
import
string
,
time
,
urllib
...
...
@@ -129,4 +128,10 @@ def rfc1123_date(ts=None):
return
'%s, %s %s %s %s GMT'
%
(
ts
[
0
],
ts
[
2
],
ts
[
1
],
ts
[
4
],
ts
[
3
])
def
urlbase
(
url
,
ftype
=
urllib
.
splittype
,
fhost
=
urllib
.
splithost
):
# Return a '/' based url such as '/foo/bar', removing
# type, host and port information if necessary.
if
url
[
0
]
==
'/'
:
return
url
type
,
uri
=
ftype
(
url
)
host
,
uri
=
fhost
(
uri
)
return
uri
lib/python/webdav/davcmds.py
View file @
bb3ef58c
...
...
@@ -85,10 +85,10 @@
"""WebDAV xml request objects."""
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
5
$'
[
11
:
-
2
]
import
sys
,
os
,
string
,
regex
from
common
import
absattr
,
aq_base
,
urlfix
from
common
import
absattr
,
aq_base
,
urlfix
,
urlbase
from
OFS.PropertySheets
import
DAVProperties
from
xmltools
import
XmlParser
from
cStringIO
import
StringIO
...
...
@@ -150,7 +150,7 @@ class PropFind:
result
=
StringIO
()
depth
=
self
.
depth
url
=
urlfix
(
self
.
request
[
'URL'
],
'PROPFIND'
)
url
=
rel_url
(
url
)
url
=
urlbase
(
url
)
result
.
write
(
'<?xml version="1.0" encoding="utf-8"?>
\
n
'
\
'<d:multistatus xmlns:d="DAV:">
\
n
'
)
iscol
=
hasattr
(
obj
,
'__dav_collection__'
)
...
...
@@ -220,7 +220,7 @@ class PropFind:
result
=
StringIO
()
depth
=
self
.
depth
url
=
urlfix
(
self
.
request
[
'URL'
],
'PROPFIND'
)
url
=
rel_url
(
url
)
url
=
urlbase
(
url
)
result
.
write
(
'<?xml version="1.0" encoding="utf-8"?>
\
n
'
\
'<d:multistatus xmlns:d="DAV:">
\
n
'
)
iscol
=
hasattr
(
obj
,
'__dav_collection__'
)
...
...
@@ -414,9 +414,4 @@ class Lock:
def
rel_url
(
url
,
r
=
regex
.
compile
(
'http://
\
([^:/]+
\
)
\
(:[
0
-9]+
\
)?
\
(/.+
\
)?
'
,
regex.casefold)):
if r.match(url) >= 0:
host,port,uri=r.group(1,2,3)
return uri or '
/
'
else: raise ValueError, url
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