Changeset 1130

Show
Ignore:
Timestamp:
08/17/06 09:04:18 (2 years ago)
Author:
Blackhex
Message:

DoxygenPlugin:

default_project confing option rename to default_documentation.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • doxygenplugin/0.9/doxygentrac/doxygentrac.py

    r1129 r1130  
    5555        # Get config variables. 
    5656        base_path = self.config.get('doxygen', 'path', '/var/lib/trac/doxygen') 
    57         default_project = self.config.get('doxygen', 'default_project', '') 
     57        default_doc = self.config.get('doxygen', 'default_documentation', '') 
    5858        ext = self.config.get('doxygen', 'ext', 'htm html png') 
    5959        ext = '|'.join(ext.split(' ')) 
     
    7272            if not match.group(1) and not match.group(2): 
    7373                # Request for documentation index. 
    74                 req.args['path'] = os.path.join(base_path, default_project
     74                req.args['path'] = os.path.join(base_path, default_doc
    7575                req.args['action'] = 'index' 
    7676            else: 
    77                 # Get project and file from request. 
     77                # Get doc and file from request. 
    7878                if not match.group(2): 
    79                     project = default_project 
     79                    doc = default_doc 
    8080                    file = match.group(1) 
    8181                else: 
    82                     project = match.group(1) 
     82                    doc = match.group(1) 
    8383                    file = match.group(2) 
    8484 
    85                 self.log.debug('project: %s' % (project,)) 
     85                self.log.debug('documentation: %s' % (doc,)) 
    8686                self.log.debug('file: %s' % (file,)) 
    8787 
     
    9292                elif re.match(r'''^(.*)[.](%s)''' % (ext,), file): 
    9393                    # Request for documentation file. 
    94                     path = os.path.join(base_path, project, file) 
     94                    path = os.path.join(base_path, doc, file) 
    9595                    self.log.debug('path: %s' % (path,)) 
    9696                    if os.path.exists(path): 
     
    105105                    if match: 
    106106                        # Request for source file documentation. 
    107                         path = os.path.join(base_path, project, '%s_8%s.html' 
     107                        path = os.path.join(base_path, doc, '%s_8%s.html' 
    108108                          % (match.group(1), match.group(2))) 
    109109                        self.log.debug('path: %s' % (path,)) 
     
    116116 
    117117                    else: 
    118                         path = os.path.join(base_path, project, 'class%s.html' 
     118                        path = os.path.join(base_path, doc, 'class%s.html' 
    119119                          % (file,)) 
    120120                        if os.path.exists(path): 
     
    122122                            req.args['action'] = 'file' 
    123123                        else: 
    124                             path = os.path.join(base_path, project
     124                            path = os.path.join(base_path, doc
    125125                              'struct%s.html' % (file,)) 
    126126                            if os.path.exists(path): 
     
    128128                                req.args['action'] = 'file' 
    129129                            else: 
    130                                 results = self._search_in_project(project
     130                                results = self._search_in_documentation(doc
    131131                                  [file]) 
    132132                                for result in results: 
    133133                                    self.log.debug(result) 
    134134                                    if result['name'] == file: 
    135                                         req.redirect(self.env.href.doxygen( 
    136                                           project) + '/' + result['url']) 
     135                                        req.redirect(self.env.href.doxygen(doc) 
     136                                          + '/' + result['url']) 
    137137                                req.args['action'] = 'search' 
    138138                                req.args['query'] = file 
     
    223223        base_path = self.config.get('doxygen', 'path') 
    224224 
    225         for project in os.listdir(base_path): 
    226             # Search in project documentation directories 
    227             path = os.path.join(base_path, project
     225        for doc in os.listdir(base_path): 
     226            # Search in documentation directories 
     227            path = os.path.join(base_path, doc
    228228            if os.path.isdir(path): 
    229229                index = os.path.join(path, 'search.idx') 
    230230                if os.path.exists(index): 
    231231                    creation = os.path.getctime(index) 
    232                     for result in  self._search_in_project(project, keywords): 
    233                         result['url'] =  self.env.href.doxygen(project) + '/' \ 
     232                    for result in  self._search_in_documentation(doc, keywords): 
     233                        result['url'] =  self.env.href.doxygen(doc) + '/' \ 
    234234                          + result['url'] 
    235235                        yield result['url'], result['name'], creation, \ 
     
    240240            if os.path.exists(index): 
    241241                creation = os.path.getctime(index) 
    242                 for result in self._search_in_project('', keywords): 
     242                for result in self._search_in_documentation('', keywords): 
    243243                    result['url'] =  self.env.href.doxygen() + '/' + \ 
    244244                      result['url'] 
     
    254254 
    255255    # internal methods 
    256     def _search_in_project(self, project, keywords): 
    257         # Open index file for project documentation 
     256    def _search_in_documentation(self, doc, keywords): 
     257        # Open index file for documentation 
    258258        base_path = self.config.get('doxygen', 'path') 
    259         index = os.path.join(base_path, project, 'search.idx') 
     259        index = os.path.join(base_path, doc, 'search.idx') 
    260260        if os.path.exists(index): 
    261261            fd = open(index)