Changeset 16525


Ignore:
Timestamp:
Apr 16, 2017, 2:00:00 AM (8 years ago)
Author:
Ryan J Ollos
Message:

Fix indentation

Location:
pydocplugin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pydocplugin/0.10/tracpydoc/tracpydoc.py

    r2010 r16525  
    4343    _cleanup_inline_re = re.compile(r'<a href=".">index</a>(?:<br>)?|'
    4444                                    r'<a href="file:.*?</a>(?:<br>)?')
    45    
     45
    4646    def __init__(self, env):
    4747        self.env = env
     
    8989        return '<a href="%s">%s</a>' % \
    9090               (self.env.href.pydoc(target).encode('utf-8'), label or target)
    91    
     91
    9292    def modulelink(self, obj):
    9393        return self._pydoc_link(obj.__name__)
     
    123123        return re.sub(self._cleanup_heading_re, r'href="\1"',
    124124                      self._cleanup('heading', *args))
    125        
     125
    126126    def section(self, *args):
    127127        return self._cleanup('section', *args)
     
    131131
    132132    def _cleanup(self, kind, *args):
    133         return re.sub(self._cleanup_inline_re, '', 
     133        return re.sub(self._cleanup_inline_re, '',
    134134                      re.sub(self._cleanup_re, 'class="pydoc%s"' % kind,
    135135                             getattr(pydoc.HTMLDoc, kind)(self, *args)))
    136    
     136
    137137
    138138class PyDoc(Component):
     
    270270        finally:
    271271            self.makedoc_lock.release()
    272    
     272
    273273    # INavigationContributor methods
    274    
     274
    275275    def get_active_navigation_item(self, req):
    276276        return 'pydoc'
    277                
     277
    278278    def get_navigation_items(self, req):
    279279        yield 'mainnav', 'pydoc', html.A('PyDoc', href= req.href.pydoc())
    280280
    281281    # IRequestHandler methods
    282    
     282
    283283    def match_request(self, req):
    284284        return req.path_info.startswith('/pydoc')
     
    288288        target = req.path_info[7:]
    289289        req.hdf['trac.href.pydoc'] = req.href.pydoc()
    290         req.hdf['pydoc.trail'] = [Markup(to_unicode(x)) for x in 
     290        req.hdf['pydoc.trail'] = [Markup(to_unicode(x)) for x in
    291291                                  self.doc._path_links(target)[:-1]]
    292292        req.hdf['pydoc.trail_last'] = target.split('.')[-1]
     
    296296
    297297    # ITemplateProvider methods
    298    
     298
    299299    def get_templates_dirs(self):
    300300        from pkg_resources import resource_filename
     
    341341    An optional second argument (`visibility`) can be set in order
    342342    to control the type of documentation that will be shown:
    343      * using "public", only show the documentation for exported symbols 
     343     * using "public", only show the documentation for exported symbols
    344344     * using "private", all the documentation will be shown
    345345
     
    358358    def get_macro_description(self, name):
    359359        return self.__doc__
    360    
     360
    361361    def render_macro(self, req, name, content):
    362362        args = content.split(',')
     
    395395            pydoc.ModuleScanner().run(callback)
    396396        return results
    397 
  • pydocplugin/0.11/tracpydoc/tracpydoc.py

    r2012 r16525  
    3838    _cleanup_inline_re = re.compile(r'<a href=".">index</a>(?:<br>)?|'
    3939                                    r'<a href="file:.*?</a>(?:<br>)?')
    40    
     40
    4141    def __init__(self, env):
    4242        self.env = env
     
    8484        return '<a href="%s">%s</a>' % \
    8585               (self.env.href.pydoc(target).encode('utf-8'), label or target)
    86    
     86
    8787    def modulelink(self, obj):
    8888        return self._pydoc_link(obj.__name__)
     
    118118        return re.sub(self._cleanup_heading_re, r'href="\1"',
    119119                      self._cleanup('heading', *args))
    120        
     120
    121121    def section(self, *args):
    122122        return self._cleanup('section', *args)
     
    126126
    127127    def _cleanup(self, kind, *args):
    128         return re.sub(self._cleanup_inline_re, '', 
     128        return re.sub(self._cleanup_inline_re, '',
    129129                      re.sub(self._cleanup_re, 'class="pydoc%s"' % kind,
    130130                             getattr(pydoc.HTMLDoc, kind)(self, *args)))
    131    
     131
    132132
    133133class PyDoc(Component):
     
    265265        finally:
    266266            self.makedoc_lock.release()
    267    
     267
    268268    # INavigationContributor methods
    269    
     269
    270270    def get_active_navigation_item(self, req):
    271271        return 'pydoc'
    272                
     272
    273273    def get_navigation_items(self, req):
    274274        yield 'mainnav', 'pydoc', tag.a('PyDoc', href= req.href.pydoc())
    275275
    276276    # IRequestHandler methods
    277    
     277
    278278    def match_request(self, req):
    279279        return req.path_info.startswith('/pydoc')
     
    282282        add_stylesheet(req, 'pydoc/css/pydoc.css')
    283283        target = req.path_info[7:]
    284         data = {'trail': [Markup(to_unicode(x)) for x in 
     284        data = {'trail': [Markup(to_unicode(x)) for x in
    285285                          self.doc._path_links(target)],
    286286                'generate_help': self.generate_help,
     
    289289
    290290    # ITemplateProvider methods
    291    
     291
    292292    def get_templates_dirs(self):
    293293        from pkg_resources import resource_filename
     
    334334    An optional second argument (`visibility`) can be set in order
    335335    to control the type of documentation that will be shown:
    336      * using "public", only show the documentation for exported symbols 
     336     * using "public", only show the documentation for exported symbols
    337337     * using "private", all the documentation will be shown
    338338
     
    351351    def get_macro_description(self, name):
    352352        return self.__doc__
    353    
     353
    354354    def render_macro(self, req, name, content):
    355355        args = content.split(',')
     
    388388            pydoc.ModuleScanner().run(callback)
    389389        return results
    390 
Note: See TracChangeset for help on using the changeset viewer.