Skip to content

Commit b6384c0

Browse files
committed
Merge pull request #1045 from simon04/python-constants
python: do not exclude constants
2 parents bcf2dda + 8368b45 commit b6384c0

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

lib/docs/filters/python/entries_v2.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,10 @@ def additional_entries
5757
clean_id_attributes
5858
entries = []
5959

60-
css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]').each do |node|
60+
css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]', '.data > dt[id]').each do |node|
6161
entries << [node['id'], node['id']]
6262
end
6363

64-
css('.data > dt[id]').each do |node|
65-
if node['id'].split('.').last.upcase! # skip constants
66-
entries << [node['id'], node['id']]
67-
end
68-
end
69-
7064
css('.function > dt[id]', '.method > dt[id]', '.staticmethod > dt[id]', '.classmethod > dt[id]').each do |node|
7165
entries << [node['id'] + '()', node['id']]
7266
end

lib/docs/filters/python/entries_v3.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,10 @@ def additional_entries
5555
clean_id_attributes
5656
entries = []
5757

58-
css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]').each do |node|
58+
css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]', '.data > dt[id]').each do |node|
5959
entries << [node['id'], node['id']]
6060
end
6161

62-
css('.data > dt[id]').each do |node|
63-
if node['id'].split('.').last.upcase! # skip constants
64-
entries << [node['id'], node['id']]
65-
end
66-
end
67-
6862
css('.function > dt[id]', '.method > dt[id]', '.staticmethod > dt[id]', '.classmethod > dt[id]').each do |node|
6963
entries << [node['id'] + '()', node['id']]
7064
end

lib/docs/scrapers/python.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@ class Python < FileScraper
2424
HTML
2525

2626
version '3.7' do # docs.python.org/3.7/download.html
27-
self.release = '3.7.0'
27+
self.release = '3.7.4'
2828
self.base_url = 'https://docs.python.org/3.7/'
2929

3030
html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
3131
end
3232

3333
version '3.6' do # docs.python.org/3.6/download.html
34-
self.release = '3.6.6'
34+
self.release = '3.6.9'
3535
self.base_url = 'https://docs.python.org/3.6/'
3636

3737
html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
3838
end
3939

4040
version '3.5' do # docs.python.org/3.5/download.html
41-
self.release = '3.5.3'
41+
self.release = '3.5.7'
4242
self.base_url = 'https://docs.python.org/3.5/'
4343

4444
html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
4545
end
4646

4747
version '2.7' do # docs.python.org/2.7/download.html
48-
self.release = '2.7.13'
48+
self.release = '2.7.16'
4949
self.base_url = 'https://docs.python.org/2.7/'
5050

5151
html_filters.push 'python/entries_v2', 'sphinx/clean_html', 'python/clean_html'

0 commit comments

Comments
 (0)