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
54e2f310
Commit
54e2f310
authored
Aug 10, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge date func rearrangement from 2.2 branch
parent
6e6e3eef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
+19
-14
lib/python/webdav/client.py
lib/python/webdav/client.py
+2
-9
lib/python/webdav/common.py
lib/python/webdav/common.py
+17
-5
No files found.
lib/python/webdav/client.py
View file @
54e2f310
"""HTTP 1.1 / WebDAV client library."""
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
2
$'
[
11
:
-
2
]
import
sys
,
os
,
string
,
regex
,
time
,
types
import
socket
,
httplib
,
mimetools
from
types
import
FileType
from
mimetypes
import
guess_type
from
base64
import
encodestring
from
common
import
rfc1123_date
from
cStringIO
import
StringIO
from
whrandom
import
random
from
urllib
import
quote
...
...
@@ -423,14 +424,6 @@ find_xml="""<?xml version="1.0" encoding="utf-8" ?>
urlregex
=
regex
.
compile
(
'http://
\
([^:/]+
\
)
\
(:[
0
-9]+
\
)?
\
(/.+
\
)?
'
, regex.casefold)
def rfc1123_date(ts=None):
# Return an RFC 1123 format date string, required for
# use in HTTP Date headers per the HTTP 1.1 spec.
if ts is None: ts=time.time()
ts=time.asctime(time.gmtime(ts))
ts=string.split(ts)
return '
%
s
,
%
s
%
s
%
s
%
s
GMT
' % (ts[0],ts[2],ts[1],ts[4],ts[3])
def marshal_string(name, val):
return '
%
s
=%
s
' % (name, quote(str(val)))
...
...
lib/python/webdav/common.py
View file @
54e2f310
...
...
@@ -85,7 +85,7 @@
"""Commonly used functions for WebDAV support modules."""
__version__
=
'$Revision: 1.
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
7
$'
[
11
:
-
2
]
import
string
,
time
,
urllib
...
...
@@ -120,13 +120,25 @@ def is_acquired(ob):
return
0
return
1
def
rfc1123_date
(
ts
=
None
):
def
iso8601_date
(
ts
=
None
,
format
=
'%Y-%m-%dT%H:%M:%SZ'
):
# Return an ISO 8601 formatted date string, required
# for certain DAV properties.
#1997-12-01T17:42:21-08:00
#Monday, 12-Jan-98 09:25:56 GMT
if
ts
is
None
:
ts
=
time
.
time
()
return
time
.
strftime
(
format
,
time
.
gmtime
(
ts
))
def
rfc850_date
(
ts
=
None
,
format
=
'%A, %d-%b-%y %H:%M:%S GMT'
):
# Return an HTTP-date formatted date string.
if
ts
is
None
:
ts
=
time
.
time
()
return
time
.
strftime
(
format
,
time
.
gmtime
(
ts
))
def
rfc1123_date
(
ts
=
None
,
format
=
'%a, %d %b %Y %H:%M:%S GMT'
):
# Return an RFC 1123 format date string, required for
# use in HTTP Date headers per the HTTP 1.1 spec.
if
ts
is
None
:
ts
=
time
.
time
()
ts
=
time
.
asctime
(
time
.
gmtime
(
ts
))
ts
=
string
.
split
(
ts
)
return
'%s, %s %s %s %s GMT'
%
(
ts
[
0
],
ts
[
2
],
ts
[
1
],
ts
[
4
],
ts
[
3
])
return
time
.
strftime
(
format
,
time
.
gmtime
(
ts
))
def
urlbase
(
url
,
ftype
=
urllib
.
splittype
,
fhost
=
urllib
.
splithost
):
...
...
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