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
aed48cd2
Commit
aed48cd2
authored
May 26, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got rid of sys.exc_*
parent
c9fbe38d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
17 deletions
+19
-17
lib/python/webdav/Resource.py
lib/python/webdav/Resource.py
+14
-12
lib/python/webdav/davcmds.py
lib/python/webdav/davcmds.py
+5
-5
No files found.
lib/python/webdav/Resource.py
View file @
aed48cd2
...
...
@@ -85,7 +85,7 @@
"""WebDAV support - resource objects."""
__version__
=
'$Revision: 1.
29
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
30
$'
[
11
:
-
2
]
import
sys
,
os
,
string
,
mimetypes
,
davcmds
,
ExtensionClass
from
common
import
absattr
,
aq_base
,
urlfix
,
rfc1123_date
...
...
@@ -259,20 +259,21 @@ class Resource(ExtensionClass.Base):
raise
'Conflict'
,
'Attempt to copy to an unknown namespace.'
except
'Not Found'
:
raise
'Conflict'
,
'Object ancestors must already exist.'
except
:
raise
sys
.
exc_type
,
sys
.
exc_value
except
:
t
,
v
,
tb
=
sys
.
exc_info
()
raise
t
,
v
if
hasattr
(
parent
,
'__null_resource__'
):
raise
'Conflict'
,
'Object ancestors must already exist.'
existing
=
hasattr
(
aq_base
(
parent
),
name
)
if
existing
and
oflag
==
'F'
:
raise
'Precondition Failed'
,
'Destination resource exists.'
try
:
parent
.
_checkId
(
name
,
allow_dup
=
1
)
except
:
raise
'Forbidden'
,
sys
.
exc_
value
except
:
raise
'Forbidden'
,
sys
.
exc_
info
()[
1
]
try
:
parent
.
_verifyObjectPaste
(
self
,
REQUEST
)
except
'Unauthorized'
:
raise
'Unauthorized'
,
sys
.
exc_value
except
:
raise
'Forbidden'
,
sys
.
exc_value
#try: self._notifyOfCopyTo(parent, op=0)
#except: raise 'Forbidden', sys.exc_value
raise
'Unauthorized'
,
sys
.
exc_info
()[
1
]
except
:
raise
'Forbidden'
,
sys
.
exc_info
()[
1
]
ob
=
self
.
_getCopy
(
parent
)
ob
.
manage_afterClone
(
ob
)
ob
.
_setId
(
name
)
...
...
@@ -317,18 +318,19 @@ class Resource(ExtensionClass.Base):
raise
'Conflict'
,
'Attempt to move to an unknown namespace.'
except
'Not Found'
:
raise
'Conflict'
,
'The resource %s must exist.'
%
path
except
:
raise
sys
.
exc_type
,
sys
.
exc_value
except
:
t
,
v
,
tb
=
sys
.
exc_info
()
raise
t
,
v
if
hasattr
(
parent
,
'__null_resource__'
):
raise
'Conflict'
,
'The resource %s must exist.'
%
path
existing
=
hasattr
(
aq_base
(
parent
),
name
)
if
existing
and
flag
==
'F'
:
raise
'Precondition Failed'
,
'Resource %s exists.'
%
dest
try
:
parent
.
_checkId
(
name
,
allow_dup
=
1
)
except
:
raise
'Forbidden'
,
sys
.
exc_
value
except
:
raise
'Forbidden'
,
sys
.
exc_
info
()[
1
]
try
:
parent
.
_verifyObjectPaste
(
self
,
REQUEST
)
except
:
raise
'Forbidden'
,
sys
.
exc_value
#try: self._notifyOfCopyTo(parent, op=1)
#except: raise 'Forbidden', sys.exc_value
except
:
raise
'Forbidden'
,
sys
.
exc_info
()[
1
]
ob
=
aq_base
(
self
.
_getCopy
(
parent
))
self
.
aq_parent
.
_delObject
(
absattr
(
self
.
id
))
ob
.
_setId
(
name
)
...
...
lib/python/webdav/davcmds.py
View file @
aed48cd2
...
...
@@ -85,7 +85,7 @@
"""WebDAV xml request objects."""
__version__
=
'$Revision: 1.
7
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
import
sys
,
os
,
string
,
regex
from
common
import
absattr
,
aq_base
,
urlfix
,
urlbase
...
...
@@ -126,7 +126,7 @@ class PropFind:
self
.
allprop
=
(
not
len
(
body
))
if
not
body
:
return
try
:
root
=
XmlParser
().
parse
(
body
)
except
:
raise
'Bad Request'
,
sys
.
exc_
value
except
:
raise
'Bad Request'
,
sys
.
exc_
info
()[
1
]
e
=
root
.
elements
(
'propfind'
,
ns
=
dav
)
if
not
e
:
raise
'Bad Request'
,
'Invalid xml request.'
e
=
e
[
0
]
...
...
@@ -227,7 +227,7 @@ class PropPatch:
def
parse
(
self
,
request
,
dav
=
'DAV:'
):
body
=
request
.
get
(
'BODY'
,
''
)
try
:
root
=
XmlParser
().
parse
(
body
)
except
:
raise
'Bad Request'
,
sys
.
exc_
value
except
:
raise
'Bad Request'
,
sys
.
exc_
info
()[
1
]
vals
=
self
.
values
e
=
root
.
elements
(
'propertyupdate'
,
ns
=
dav
)
if
not
e
:
raise
'Bad Request'
,
'Invalid xml request.'
...
...
@@ -288,12 +288,12 @@ class PropPatch:
if
propset
.
hasProperty
(
name
):
try
:
propset
.
_updateProperty
(
name
,
val
,
meta
=
md
)
except
:
errors
.
append
(
str
(
sys
.
exc_
value
))
errors
.
append
(
str
(
sys
.
exc_
info
()[
1
]
))
status
=
'409 Conflict'
else
:
try
:
propset
.
_setProperty
(
name
,
val
,
meta
=
md
)
except
:
errors
.
append
(
str
(
sys
.
exc_
value
))
errors
.
append
(
str
(
sys
.
exc_
info
()[
1
]
))
status
=
'409 Conflict'
else
:
name
,
ns
=
value
...
...
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