History

Merge pull request #1045 from simon04/python-constants

Jasper van Merle committed 7 years ago

Commit b6384c02 parents bcf2dda 8368b453 files · +6 −18Browse files

Unified · Split

3 files
  1. lib/docs/filters/python/entries_v2.rb +1 −7
  2. lib/docs/filters/python/entries_v3.rb +1 −7
  3. lib/docs/scrapers/python.rb +4 −4
lib/docs/filters/python/entries_v2.rb+1−7
@@ -57,16 +57,10 @@ module Docs · 56 unmodified lines
57 clean_id_attributes57 clean_id_attributes
58 entries = []58 entries = []
59 59
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|
61 entries << [node['id'], node['id']]61 entries << [node['id'], node['id']]
62 end62 end
63 63
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
70 css('.function > dt[id]', '.method > dt[id]', '.staticmethod > dt[id]', '.classmethod > dt[id]').each do |node|64 css('.function > dt[id]', '.method > dt[id]', '.staticmethod > dt[id]', '.classmethod > dt[id]').each do |node|
71 entries << [node['id'] + '()', node['id']]65 entries << [node['id'] + '()', node['id']]
72 end66 end
lib/docs/filters/python/entries_v3.rb+1−7
@@ -55,16 +55,10 @@ module Docs · 54 unmodified lines
55 clean_id_attributes55 clean_id_attributes
56 entries = []56 entries = []
57 57
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|
59 entries << [node['id'], node['id']]59 entries << [node['id'], node['id']]
60 end60 end
61 61
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
68 css('.function > dt[id]', '.method > dt[id]', '.staticmethod > dt[id]', '.classmethod > dt[id]').each do |node|62 css('.function > dt[id]', '.method > dt[id]', '.staticmethod > dt[id]', '.classmethod > dt[id]').each do |node|
69 entries << [node['id'] + '()', node['id']]63 entries << [node['id'] + '()', node['id']]
70 end64 end
lib/docs/scrapers/python.rb+4−4
@@ -24,28 +24,28 @@ module Docs · 23 unmodified lines
24 HTML24 HTML
25 25
26 version '3.7' do # docs.python.org/3.7/download.html26 version '3.7' do # docs.python.org/3.7/download.html
27 self.release = '3.7.0'27 self.release = '3.7.4'
28 self.base_url = 'https://docs.python.org/3.7/'28 self.base_url = 'https://docs.python.org/3.7/'
29 29
30 html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'30 html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
31 end31 end
32 32
33 version '3.6' do # docs.python.org/3.6/download.html33 version '3.6' do # docs.python.org/3.6/download.html
34 self.release = '3.6.6'34 self.release = '3.6.9'
35 self.base_url = 'https://docs.python.org/3.6/'35 self.base_url = 'https://docs.python.org/3.6/'
36 36
37 html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'37 html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
38 end38 end
39 39
40 version '3.5' do # docs.python.org/3.5/download.html40 version '3.5' do # docs.python.org/3.5/download.html
41 self.release = '3.5.3'41 self.release = '3.5.7'
42 self.base_url = 'https://docs.python.org/3.5/'42 self.base_url = 'https://docs.python.org/3.5/'
43 43
44 html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'44 html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
45 end45 end
46 46
47 version '2.7' do # docs.python.org/2.7/download.html47 version '2.7' do # docs.python.org/2.7/download.html
48 self.release = '2.7.13'48 self.release = '2.7.16'
49 self.base_url = 'https://docs.python.org/2.7/'49 self.base_url = 'https://docs.python.org/2.7/'
50 50
51 html_filters.push 'python/entries_v2', 'sphinx/clean_html', 'python/clean_html'51 html_filters.push 'python/entries_v2', 'sphinx/clean_html', 'python/clean_html'