Changeset 6106


Ignore:
Timestamp:
Jun 26, 2009, 10:40:34 AM (15 years 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.

Location:
xmlrpcplugin/trunk/tracrpc
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.