Show
Ignore:
Timestamp:
02/04/2008 05:52:40 PM (10 months ago)
Author:
dave
Message:

modify docutils beps.py to use pep_base_url.

I tried using bep_base_url to disambiguate the base URL for beps and peps, but this required reaching
into the source code for restructured text (which has some hard-coded notion of PEPs). I decided
not to touch that code just now.

regenerate updated html files.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dotorg/trunk_fixed/docutils/docutils/transforms/beps.py

    r10307 r10535  
    3333    default_priority = 360 
    3434 
     35    # NOTE: There is no bep_base_url.  The base of the BEP directory is specified with pep_base_url 
     36    # because changing this requires modifying the rst repository.   This value can be changed with the pep-base-url 
     37    # argument.  For now, I don't want to modify restructured text parsing code.  It means we cannot currently 
     38    # disambiguate between peps and beps for specifying the base url. 
    3539    bep_url = 'bep-%04d' 
    3640    bep_cvs_url = ('https://svn.bittorrent.com/trac.cgi/browser/dotorg/trunk/html/beps/bep_%04d.rst') 
    37     //bep_cvs_url = ('http://svn.bittorrent.com/view/*checkout*' 
    38     //               '/peps/trunk/bep-%04d.txt') 
     41    #bep_cvs_url = ('http://svn.bittorrent.com/view/*checkout*' 
     42    #               '/peps/trunk/bep-%04d.txt') 
    3943    rcs_keyword_substitutions = ( 
    4044          (re.compile(r'\$' r'RCSfile: (.+),v \$$', re.IGNORECASE), r'\1'), 
     
    120124                    newbody.append(nodes.reference( 
    121125                        refbep, refbep, 
    122                         refuri=(self.document.settings.bep_base_url 
     126                        refuri=(self.document.settings.pep_base_url 
    123127                                + self.bep_url % bepno))) 
    124128                    newbody.append(space) 
     
    131135            elif name == 'content-type': 
    132136                bep_type = para.astext() 
    133                 uri = self.document.settings.bep_base_url + self.bep_url % 12 
     137                uri = self.document.settings.pep_base_url + self.bep_url % 12 
    134138                para[:] = [nodes.reference('', bep_type, refuri=uri)] 
    135139            elif name == 'version' and len(body): 
     
    269273                try: 
    270274                    bep = int(text) 
    271                     ref = (self.document.settings.bep_base_url 
     275                    ref = (self.document.settings.pep_base_url 
    272276                           + self.bep_url % bep) 
    273277                    p[0] = nodes.reference(text, text, refuri=ref)