Skip to content

Commit 4802e38

Browse files
committed
Fix pydoctor 0.5+ detection
Their header changed with the 0.5 release.
1 parent 78d1bee commit 4802e38

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

doc2dash/parsers/pydoctor.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818

1919

2020
PYDOCTOR_HEADER = b'''\
21+
This documentation was automatically generated by
22+
<a href="https://launchpad.net/pydoctor/">pydoctor</a>'''
23+
24+
PYDOCTOR_HEADER_OLD = b'''\
2125
This documentation was automatically generated by
2226
<a href="http://codespeak.net/~mwh/pydoctor/">pydoctor</a>'''
2327

@@ -34,6 +38,8 @@ class PyDoctorParser(object):
3438
def detect(self, path):
3539
return has_file_with(
3640
path, "index.html", PYDOCTOR_HEADER
41+
) or has_file_with(
42+
path, "index.html", PYDOCTOR_HEADER_OLD
3743
)
3844

3945
def parse(self):

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Changelog
1010
- Better Unicode support.
1111
The move from ``unicode_literals`` to explicit prefixes broke some things that are fixed now.
1212
(`#29 <https://github.com/hynek/doc2dash/issues/29>`_, `#30 <https://github.com/hynek/doc2dash/issues/30>`_)
13+
- Fix detection of `pydoctor 0.5 <http://bazaar.launchpad.net/~mwhudson/pydoctor/dev/revision/605>`_. (`#31 <https://github.com/hynek/doc2dash/issues/31>`_)
1314

1415

1516
2.0.0 (2014-08-14)

tests/parsers/test_detectors.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
from __future__ import absolute_import, division, print_function
2+
13
import os
24

35
import pytest
6+
47
from mock import MagicMock
58

69
import doc2dash
10+
711
from doc2dash.parsers import DOCTYPES
812

913

0 commit comments

Comments
 (0)