Skip to content

Commit

Permalink
Cleaned up some minor code style glitches.
Browse files Browse the repository at this point in the history
  • Loading branch information
strichter committed Apr 26, 2005
1 parent 008813a commit acf3ca8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
5 changes: 3 additions & 2 deletions ftp/ftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################

"""This module defines all the FTP shell classes
"""
__docformat__="restructuredtext"

## cStringIO is causing me problems with unicode charactors.
from cStringIO import StringIO
Expand Down Expand Up @@ -90,7 +90,8 @@ class ZopeFTPShell(object):
implements(ftp.IFTPShell)

def __init__(self, username, password, request_factory):
self.fs_access = PublisherFileSystem((username, password), request_factory)
self.fs_access = PublisherFileSystem((username, password),
request_factory)
self._dir = '/'

def mapCPathToSPath(self, path):
Expand Down
4 changes: 3 additions & 1 deletion ftp/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################

"""Interfaces related to the FTP server and Publisher
"""
__docformat__="restructuredtext"
from zope.interface import Interface

class IFileSystem(Interface):
Expand Down
4 changes: 3 additions & 1 deletion ftp/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################

"""Publisher File System Implementation
"""
__docformat__="restructuredtext"
import posixpath
from cStringIO import StringIO

Expand Down
12 changes: 9 additions & 3 deletions ftp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Twisted-based FTP server for Zope's Publisher.
"""
__docformat__="restructuredtext"

from zope.interface import implements

Expand Down Expand Up @@ -49,18 +52,21 @@ def __init__(self, request_factory, logout = None):

def requestAvatar(self, avatarId, mind, *interfaces):
if ftp.IFTPShell in interfaces:
avatar = ZopeFTPShell(avatarId.username, avatarId.password, self.request_factory)
avatar = ZopeFTPShell(avatarId.username, avatarId.password,
self.request_factory)
avatar.logout = self.logout
return ftp.IFTPShell, avatar, avatar.logout
raise NotImplementedError("Only IFTPShell interface is supported by this realm")
raise NotImplementedError, \
"Only IFTPShell interface is supported by this realm")

class FTPFactory(ftp.FTPFactory):
allowAnonymous = False

def __init__(self, request_factory):
r = FTPRealm(request_factory)
p = portal.Portal(r)
p.registerChecker(ZopeSimpleAuthenticatation(), credentials.IUsernamePassword)
p.registerChecker(ZopeSimpleAuthenticatation(),
credentials.IUsernamePassword)

self.portal = p

Expand Down

0 comments on commit acf3ca8

Please sign in to comment.