Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
5d0b2745
Commit
5d0b2745
authored
Oct 21, 2010
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DAVFS: expose the getpathurl() method
parent
4d291172
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
fs/contrib/davfs/__init__.py
+4
-4
No files found.
fs/contrib/davfs/__init__.py
View file @
5d0b2745
...
@@ -145,7 +145,7 @@ class DAVFS(FS):
...
@@ -145,7 +145,7 @@ class DAVFS(FS):
self
.
_url_p
=
urlparse
(
self
.
url
)
self
.
_url_p
=
urlparse
(
self
.
url
)
self
.
_cookiejar
=
cookielib
.
CookieJar
()
self
.
_cookiejar
=
cookielib
.
CookieJar
()
def
_path2url
(
self
,
path
):
def
getpathurl
(
self
,
path
,
allow_none
=
False
):
"""Convert a client-side path into a server-side URL."""
"""Convert a client-side path into a server-side URL."""
path
=
relpath
(
normpath
(
path
))
path
=
relpath
(
normpath
(
path
))
if
path
.
endswith
(
"/"
):
if
path
.
endswith
(
"/"
):
...
@@ -172,7 +172,7 @@ class DAVFS(FS):
...
@@ -172,7 +172,7 @@ class DAVFS(FS):
This is a simple wrapper around httplib that does basic error and
This is a simple wrapper around httplib that does basic error and
sanity checking e.g. following redirects and providing authentication.
sanity checking e.g. following redirects and providing authentication.
"""
"""
url
=
self
.
_path2
url
(
path
)
url
=
self
.
getpath
url
(
path
)
visited
=
[]
visited
=
[]
resp
=
None
resp
=
None
try
:
try
:
...
@@ -577,7 +577,7 @@ class DAVFS(FS):
...
@@ -577,7 +577,7 @@ class DAVFS(FS):
self
.
_copy
(
src
,
dst
,
overwrite
=
overwrite
)
self
.
_copy
(
src
,
dst
,
overwrite
=
overwrite
)
def
_copy
(
self
,
src
,
dst
,
overwrite
=
False
):
def
_copy
(
self
,
src
,
dst
,
overwrite
=
False
):
headers
=
{
"Destination"
:
self
.
_path2
url
(
dst
)}
headers
=
{
"Destination"
:
self
.
getpath
url
(
dst
)}
if
overwrite
:
if
overwrite
:
headers
[
"Overwrite"
]
=
"T"
headers
[
"Overwrite"
]
=
"T"
else
:
else
:
...
@@ -604,7 +604,7 @@ class DAVFS(FS):
...
@@ -604,7 +604,7 @@ class DAVFS(FS):
self
.
_move
(
src
,
dst
,
overwrite
=
overwrite
)
self
.
_move
(
src
,
dst
,
overwrite
=
overwrite
)
def
_move
(
self
,
src
,
dst
,
overwrite
=
False
):
def
_move
(
self
,
src
,
dst
,
overwrite
=
False
):
headers
=
{
"Destination"
:
self
.
_path2
url
(
dst
)}
headers
=
{
"Destination"
:
self
.
getpath
url
(
dst
)}
if
overwrite
:
if
overwrite
:
headers
[
"Overwrite"
]
=
"T"
headers
[
"Overwrite"
]
=
"T"
else
:
else
:
...
...
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