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
f9f0ddd0
Commit
f9f0ddd0
authored
Jan 22, 2001
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge from 2.3
parent
840802e5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
2 deletions
+66
-2
ZServer/FTPRequest.py
ZServer/FTPRequest.py
+6
-0
ZServer/FTPServer.py
ZServer/FTPServer.py
+27
-1
lib/python/ZServer/FTPRequest.py
lib/python/ZServer/FTPRequest.py
+6
-0
lib/python/ZServer/FTPServer.py
lib/python/ZServer/FTPServer.py
+27
-1
No files found.
ZServer/FTPRequest.py
View file @
f9f0ddd0
...
...
@@ -162,6 +162,12 @@ class FTPRequest(HTTPRequest):
env
[
'PATH_INFO'
]
=
self
.
_join_paths
(
channel
.
path
,
path
,
'manage_addFolder'
)
env
[
'QUERY_STRING'
]
=
'id=%s'
%
args
[
0
]
elif
command
==
'RNTO'
:
env
[
'PATH_INFO'
]
=
self
.
_join_paths
(
channel
.
path
,
path
,
'manage_renameObject'
)
env
[
'QUERY_STRING'
]
=
'id=%s&new_id=%s'
%
(
args
[
0
],
args
[
1
])
elif
command
==
'STOR'
:
env
[
'PATH_INFO'
]
=
self
.
_join_paths
(
channel
.
path
,
path
)
env
[
'REQUEST_METHOD'
]
=
'PUT'
...
...
ZServer/FTPServer.py
View file @
f9f0ddd0
...
...
@@ -411,7 +411,32 @@ class zope_ftp_channel(ftp_channel):
else
:
self
.
client_dc
.
channel
.
respond
(
'426 Error creating file.'
)
self
.
client_dc
.
close
()
def
cmd_rnfr
(
self
,
line
):
'rename from'
if
len
(
line
)
!=
2
:
self
.
command_not_understood
(
string
.
join
(
line
))
else
:
self
.
fromfile
=
line
[
1
]
self
.
respond
(
'350 RNFR command successful.'
)
def
cmd_rnto
(
self
,
line
):
if
len
(
line
)
!=
2
:
self
.
command_not_understood
(
string
.
join
(
line
))
return
pathf
,
idf
=
os
.
path
.
split
(
self
.
fromfile
)
patht
,
idt
=
os
.
path
.
split
(
line
[
1
])
response
=
make_response
(
self
,
self
.
rnto_completion
)
request
=
FTPRequest
(
pathf
,(
'RNTO'
,
idf
,
idt
),
self
,
response
)
handle
(
self
.
module
,
request
,
response
)
def
rnto_completion
(
self
,
response
):
status
=
response
.
getStatus
()
if
status
==
200
:
self
.
respond
(
'250 RNTO command successful.'
)
else
:
self
.
respond
(
'550 error renaming file.'
)
def
cmd_dele
(
self
,
line
):
if
len
(
line
)
!=
2
:
self
.
command
.
not_understood
(
string
.
join
(
line
))
...
...
@@ -532,6 +557,7 @@ class zope_ftp_channel(ftp_channel):
self
.
respond
(
'502 Command not implemented.'
)
# Override ftp server receive channel reponse mechanism
# XXX hack alert, this should probably be redone in a more OO way.
...
...
lib/python/ZServer/FTPRequest.py
View file @
f9f0ddd0
...
...
@@ -162,6 +162,12 @@ class FTPRequest(HTTPRequest):
env
[
'PATH_INFO'
]
=
self
.
_join_paths
(
channel
.
path
,
path
,
'manage_addFolder'
)
env
[
'QUERY_STRING'
]
=
'id=%s'
%
args
[
0
]
elif
command
==
'RNTO'
:
env
[
'PATH_INFO'
]
=
self
.
_join_paths
(
channel
.
path
,
path
,
'manage_renameObject'
)
env
[
'QUERY_STRING'
]
=
'id=%s&new_id=%s'
%
(
args
[
0
],
args
[
1
])
elif
command
==
'STOR'
:
env
[
'PATH_INFO'
]
=
self
.
_join_paths
(
channel
.
path
,
path
)
env
[
'REQUEST_METHOD'
]
=
'PUT'
...
...
lib/python/ZServer/FTPServer.py
View file @
f9f0ddd0
...
...
@@ -411,7 +411,32 @@ class zope_ftp_channel(ftp_channel):
else
:
self
.
client_dc
.
channel
.
respond
(
'426 Error creating file.'
)
self
.
client_dc
.
close
()
def
cmd_rnfr
(
self
,
line
):
'rename from'
if
len
(
line
)
!=
2
:
self
.
command_not_understood
(
string
.
join
(
line
))
else
:
self
.
fromfile
=
line
[
1
]
self
.
respond
(
'350 RNFR command successful.'
)
def
cmd_rnto
(
self
,
line
):
if
len
(
line
)
!=
2
:
self
.
command_not_understood
(
string
.
join
(
line
))
return
pathf
,
idf
=
os
.
path
.
split
(
self
.
fromfile
)
patht
,
idt
=
os
.
path
.
split
(
line
[
1
])
response
=
make_response
(
self
,
self
.
rnto_completion
)
request
=
FTPRequest
(
pathf
,(
'RNTO'
,
idf
,
idt
),
self
,
response
)
handle
(
self
.
module
,
request
,
response
)
def
rnto_completion
(
self
,
response
):
status
=
response
.
getStatus
()
if
status
==
200
:
self
.
respond
(
'250 RNTO command successful.'
)
else
:
self
.
respond
(
'550 error renaming file.'
)
def
cmd_dele
(
self
,
line
):
if
len
(
line
)
!=
2
:
self
.
command
.
not_understood
(
string
.
join
(
line
))
...
...
@@ -532,6 +557,7 @@ class zope_ftp_channel(ftp_channel):
self
.
respond
(
'502 Command not implemented.'
)
# Override ftp server receive channel reponse mechanism
# XXX hack alert, this should probably be redone in a more OO way.
...
...
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