Changeset 1278

Show
Ignore:
Timestamp:
09/19/06 06:01:15 (2 years ago)
Author:
athomas
Message:

XmlRpcPlugin:

  • Added system.getAPIVersion(). Returns a two element tuple containing the Trac XML-RPC version number. Closes #652 (refer to this ticket for semantics).
  • Added ticket.getTicketFields(). Forwards directly to TicketSystem().get_ticket_fields(). Closes #651.
  • Fixed #723.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • xmlrpcplugin/0.10/setup.py

    r511 r1278  
    44 
    55setup( 
    6     name = 'TracXMLRPC', 
    7     version = '0.1', 
    8     author = 'Alec Thomas', 
    9     author_email = 'alec@swapoff.org', 
    10     url = 'http://trac-hacks.swapoff.org/wiki/XmlRpcPlugin', 
    11     description = 'XML-RPC interface to Trac', 
     6    name='TracXMLRPC', 
     7    version='0.1', 
     8    author='Alec Thomas', 
     9    author_email='alec@swapoff.org', 
     10    url='http://trac-hacks.swapoff.org/wiki/XmlRpcPlugin', 
     11    description='XML-RPC interface to Trac', 
    1212    zip_safe=True, 
    1313    packages=['tracrpc'], 
  • xmlrpcplugin/0.10/tracrpc/api.py

    r1188 r1278  
    158158        yield ('XML_RPC', ((str, str),), self.methodHelp) 
    159159        yield ('XML_RPC', ((list, str),), self.methodSignature) 
     160        yield ('XML_RPC', ((list,),), self.getAPIVersion) 
    160161 
    161162    def get_method(self, method): 
     
    163164        for provider in self.method_handlers: 
    164165            for candidate in provider.xmlrpc_methods(): 
    165                 self.env.log.debug(candidate) 
     166                #self.env.log.debug(candidate) 
    166167                p = Method(provider, *candidate) 
    167168                if p.name == method: 
     
    218219        req.perm.assert_permission(p.permission) 
    219220        return [','.join([RPC_TYPES[x] for x in sig]) for sig in p.xmlrpc_signatures()] 
     221 
     222    def getAPIVersion(self, req): 
     223        """ Returns a list with two elements. First element is the major 
     224        version number, second is the minor. Changes to the major version 
     225        indicate API breaking changes, while minor version changes are simple 
     226        additions, bug fixes, etc. """ 
     227        return [0, 1] 
  • xmlrpcplugin/0.10/tracrpc/search.py

    r477 r1278  
    4949        for source in self.search_sources: 
    5050            for result in source.get_search_results(req, query, filters): 
     51                result = map(unicode, result) 
    5152                results.append(['/'.join(req.base_url.split('/')[0:3]) 
    5253                                + result[0]] + list(result[1:])) 
  • xmlrpcplugin/0.10/tracrpc/ticket.py

    r1188 r1278  
    3636               self.putAttachment) 
    3737        yield ('TICKET_ADMIN', ((bool, int, str),), self.deleteAttachment) 
     38        yield ('TICKET_VIEW', ((list,),), self.getTicketFields) 
    3839 
    3940    # Exported methods 
     
    136137        return True 
    137138 
     139    def getTicketFields(self, req): 
     140        """ Return a list of all ticket fields fields. """ 
     141        return TicketSystem(self.env).get_ticket_fields() 
     142 
    138143 
    139144def ticketModelFactory(cls, cls_attributes):