pydoc patch for Subversion

Discussion in 'Python' started by Eric Mathew Hopper, Jan 11, 2004.

  1. I have a patch that allows pydoc to deal with Subversion
    (http://www.subversion.tigris.org) style version strings.

    Subversion does not do '$Revsion: num$' style tags. The closest it will
    get is '$Rev: num$'. So, I included a check for that type as well.

    It's a patch to this version of pydoc.py

    __version__ = "$Revision: 1.86.8.1 $"

    Thanks,
    --
    "It does me no injury for my neighbor to say there are twenty gods or no God.
    It neither picks my pocket nor breaks my leg." --- Thomas Jefferson
    "Go to Heaven for the climate, Hell for the company." -- Mark Twain
    -- Eric Hopper ( http://www.omnifarious.org/~hopper) --


    -------cut---------
    --- /sw/lib/python2.3/pydoc.py Sat Jan 3 15:43:56 2004
    +++ pydoc2.3.py Sun Jan 11 00:56:39 2004
    @@ -528,8 +528,11 @@
    info = []
    if hasattr(object, '__version__'):
    version = str(object.__version__)
    - if version[:11] == '$' + 'Revision: ' and version[-1:] == '$':
    - version = strip(version[11:-1])
    + if (version[0] == '$') and (version[-1] == '$'):
    + if version[1:11] == 'Revision: ':
    + version = strip(version[11:-1])
    + elif version[1:6] == 'Rev: ':
    + version = strip(version[6:-1])
    info.append('version %s' % self.escape(version))
    if hasattr(object, '__date__'):
    info.append(self.escape(str(object.__date__)))
    @@ -1004,8 +1007,11 @@

    if hasattr(object, '__version__'):
    version = str(object.__version__)
    - if version[:11] == '$' + 'Revision: ' and version[-1:] == '$':
    - version = strip(version[11:-1])
    + if (version[0] == '$') and (version[-1] == '$'):
    + if version[1:11] == 'Revision: ':
    + version = strip(version[11:-1])
    + elif version[1:6] == 'Rev: ':
    + version = strip(version[6:-1])
    result = result + self.section('VERSION', version)
    if hasattr(object, '__date__'):
    result = result + self.section('DATE', str(object.__date__))
    -------cut---------

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.1 (GNU/Linux)

    iD8DBQFAARIkjtsvlOwvazYRAqUvAJ9j/bnIozFiPbmBWkOLR59zyaPZUQCgukkc
    yHAO+4UDP1l00FBBNMejvkk=
    =3NUT
    -----END PGP SIGNATURE-----
     
    Eric Mathew Hopper, Jan 11, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    381
  2. BartlebyScrivener

    pydoc script.py vs. pydoc scriptpy

    BartlebyScrivener, Oct 20, 2007, in forum: Python
    Replies:
    1
    Views:
    687
    Stargaming
    Oct 22, 2007
  3. George Sakkis
    Replies:
    3
    Views:
    398
  4. Replies:
    5
    Views:
    818
    John B. Matthews
    Apr 30, 2010
  5. Replies:
    0
    Views:
    390
Loading...

Share This Page