Changeset 6106

Show
Ignore:
Timestamp:
06/26/09 12:40:34 (9 months ago)
Author:
osimons
Message:

XmlRpcPlugin: Removing use of posixpath and replacing with os.path. Also added tests for wiki attachments where this code was used.

Closes #2818.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • xmlrpcplugin/trunk/tracrpc/tests/__init__.py

    r6096 r6106  
    7575        import tracrpc.tests.ticket 
    7676        suite.addTest(tracrpc.tests.ticket.suite()) 
     77        import tracrpc.tests.wiki 
     78        suite.addTest(tracrpc.tests.wiki.suite()) 
    7779        return suite 
    7880 
  • xmlrpcplugin/trunk/tracrpc/wiki.py

    r6067 r6106  
    1212    from StringIO import StringIO 
    1313import xmlrpclib 
    14 import posixpath 
     14import os 
    1515 
    1616from trac.core import * 
     
    154154    def getAttachment(self, req, path): 
    155155        """ returns the content of an attachment. """ 
    156         pagename, filename = posixpath.split(path) 
     156        pagename, filename = os.path.split(path) 
    157157        attachment = Attachment(self.env, 'wiki', pagename, filename) 
    158158        req.perm(attachment.resource).require('ATTACHMENT_VIEW') 
     
    164164        This method is compatible with WikiRPC.  `putAttachmentEx` has a more 
    165165        extensive set of (Trac-specific) features. """ 
    166         pagename, filename = posixpath.split(path) 
     166        pagename, filename = os.path.split(path) 
    167167        self.putAttachmentEx(req, pagename, filename, None, data) 
    168168        return True 
     
    191191    def deleteAttachment(self, req, path): 
    192192        """ Delete an attachment. """ 
    193         pagename, filename = posixpath.split(path) 
     193        pagename, filename = os.path.split(path) 
    194194        if not WikiPage(self.env, pagename).exists: 
    195195            raise TracError, 'Wiki page "%s" does not exist' % pagename