Changeset 66
- Timestamp:
- 07/27/07 19:18:26 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
projects/Twisted-Goodies/trunk/misc/var_www_foss.tellectual.com_index.py
r65 r66 183 183 resource to it is returned instead of a TracResource. 184 184 """ 185 def extendRequest(*newSegments):186 newSegments = list(newSegments)187 request.postpath.extend(newSegments)188 subSegments.extend(newSegments)189 addition = "/" + "/".join(newSegments)190 request.uri = request.uri.rstrip("/") + addition191 192 185 def rootState(segmentList): 193 186 root = segmentList[0] … … 199 192 return root, False 200 193 194 def listOp(methodName, *args): 195 uriList = request.uri.split("/") 196 k = len(uriList) - len(segments) 197 uriPreList, uriPostList = uriList[:k], uriList[k:] 198 for thisList in (request.postpath, subSegments, uriPostList): 199 getattr(thisList, methodName)(*args) 200 request.uri = "/".join(uriPreList + uriPostList) 201 201 202 projectName, subSegments = segments[0], list(segments[1:]) 202 203 if not subSegments: 203 extendRequest('wiki')204 listOp('append', 'wiki') 204 205 root, isAtRoot = rootState(subSegments) 206 if root == 'wiki' and len(subSegments) > 1: 207 subRoot = subSegments[1] 208 if subRoot.isalpha() and subRoot.islower(): 209 listOp('remove', 'wiki') 210 root = subRoot 205 211 if root == 'api': 206 212 return self.apiDocResource, [projectName] + subSegments[1:] … … 209 215 if isAtRoot: 210 216 if root == 'wiki': 211 extendRequest("Start_%s" % projectName)217 listOp('append', "Start_%s" % projectName) 212 218 elif root == 'browser': 213 extendRequest('projects', projectName, 'trunk')219 listOp('extend', ['projects', projectName, 'trunk']) 214 220 possibleResult = self._possibleStatic('trac', *subSegments) 215 221 if possibleResult: projects/Twisted-Goodies/trunk/twisted_goodies/simpleserver/pop3.py
r38 r66 20 20 """ 21 21 22 import os.path as ospath22 import os.path 23 23 from zope.interface import implements 24 24 from twisted.internet import defer, protocol … … 47 47 if pop3.IMailbox not in interfaces: 48 48 raise NotImplementedError(self, interfaces) 49 thisMaildir = os path.join(self.baseDir, avatarId)49 thisMaildir = os.path.join(self.baseDir, avatarId) 50 50 avatar = maildir.MaildirMailbox(thisMaildir) 51 51 result = (pop3.IMailbox, avatar, self.logout)
