docs: flake8 fixes

This commit is contained in:
Angus Gratton
2020-02-03 17:38:45 +11:00
committed by Angus Gratton
parent ac8e931179
commit d03af45731
5 changed files with 13 additions and 11 deletions

View File

@@ -142,7 +142,7 @@ def parallel_call(args, callback):
for ret, entry in zip(errcodes, entries): for ret, entry in zip(errcodes, entries):
if ret != 0: if ret != 0:
print("language: %s, target: %s, errcode: %d" % (entry[0], entry[1], ret)) print("language: %s, target: %s, errcode: %d" % (entry[0], entry[1], ret))
#Don't re-throw real error code from each parallel process # Don't re-throw real error code from each parallel process
return 1 return 1
else: else:
return 0 return 0
@@ -197,7 +197,7 @@ def sphinx_call(language, target, build_dir, sphinx_parallel_jobs, buildername):
except KeyboardInterrupt: # this seems to be the only way to get Ctrl-C to kill everything? except KeyboardInterrupt: # this seems to be the only way to get Ctrl-C to kill everything?
p.kill() p.kill()
os.chdir(saved_cwd) os.chdir(saved_cwd)
return 130 #FIXME It doesn't return this errorcode, why? Just prints stacktrace return 130 # FIXME It doesn't return this errorcode, why? Just prints stacktrace
os.chdir(saved_cwd) os.chdir(saved_cwd)
return ret return ret
@@ -315,7 +315,8 @@ def call_linkcheck(entry):
GH_LINK_RE = r"https://github.com/espressif/esp-idf/(?:tree|blob|raw)/[^\s]+" GH_LINK_RE = r"https://github.com/espressif/esp-idf/(?:tree|blob|raw)/[^\s]+"
# we allow this one link, because we always want users to see the latest support policy # we allow this one link, because we always want users to see the latest support policy
GH_LINK_ALLOWED = [ "https://github.com/espressif/esp-idf/blob/master/SUPPORT_POLICY.md" ] GH_LINK_ALLOWED = ["https://github.com/espressif/esp-idf/blob/master/SUPPORT_POLICY.md"]
def action_gh_linkcheck(args): def action_gh_linkcheck(args):
print("Checking for hardcoded GitHub links\n") print("Checking for hardcoded GitHub links\n")
@@ -326,12 +327,12 @@ def action_gh_linkcheck(args):
for root, _, files in os.walk(docs_dir): for root, _, files in os.walk(docs_dir):
if "_build" in root: if "_build" in root:
continue continue
files = [ os.path.join(root, f) for f in files if f.endswith(".rst") ] files = [os.path.join(root, f) for f in files if f.endswith(".rst")]
for path in files: for path in files:
with open(path, "r") as f: with open(path, "r") as f:
for link in re.findall(GH_LINK_RE, f.read()): for link in re.findall(GH_LINK_RE, f.read()):
if link not in GH_LINK_ALLOWED: if link not in GH_LINK_ALLOWED:
github_links.append((path, link)) github_links.append((path, link))
if github_links: if github_links:
for path, link in github_links: for path, link in github_links:

View File

@@ -160,6 +160,7 @@ def update_exclude_patterns(tags):
'api-reference/peripherals/temp_sensor.rst']: 'api-reference/peripherals/temp_sensor.rst']:
exclude_patterns.append(e) exclude_patterns.append(e)
# The reST default role (used for this markup: `text`) to use for all # The reST default role (used for this markup: `text`) to use for all
# documents. # documents.
# default_role = None # default_role = None
@@ -370,9 +371,9 @@ def setup(app):
app.config.breathe_projects = {"esp32-idf": os.path.join(app.config.build_dir, "xml_in/")} app.config.breathe_projects = {"esp32-idf": os.path.join(app.config.build_dir, "xml_in/")}
app.config.breathe_default_project = "esp32-idf" app.config.breathe_default_project = "esp32-idf"
setup_diag_font(app) setup_diag_font(app)
def setup_diag_font(app): def setup_diag_font(app):
# blockdiag and other tools require a font which supports their character set # blockdiag and other tools require a font which supports their character set
# the font file is stored on the download server to save repo size # the font file is stored on the download server to save repo size

View File

@@ -5,10 +5,10 @@ TOOLCHAIN_NAMES = {'esp32': 'esp', 'esp32s2': 'esp32s2'}
CONFIG_PREFIX = {'esp32': 'ESP32', 'esp32s2': 'ESP32S2'} CONFIG_PREFIX = {'esp32': 'ESP32', 'esp32s2': 'ESP32S2'}
TRM_EN_URL = {'esp32': 'https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf', TRM_EN_URL = {'esp32': 'https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf',
'esp32s2': 'https://www.espressif.com/sites/default/files/documentation/esp32-s2_technical_reference_manual_en.pdf'} 'esp32s2': 'https://www.espressif.com/sites/default/files/documentation/esp32-s2_technical_reference_manual_en.pdf'}
TRM_CN_URL = {'esp32': 'https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_cn.pdf', TRM_CN_URL = {'esp32': 'https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_cn.pdf',
'esp32s2': 'https://www.espressif.com/sites/default/files/documentation/esp32-s2_technical_reference_manual_cn.pdf'} 'esp32s2': 'https://www.espressif.com/sites/default/files/documentation/esp32-s2_technical_reference_manual_cn.pdf'}
class StringSubstituter: class StringSubstituter:

View File

@@ -3,6 +3,7 @@ from __future__ import print_function
import os.path import os.path
from util import copy_if_modified, call_with_python from util import copy_if_modified, call_with_python
def setup(app): def setup(app):
# we don't actually need idf-info, just a convenient event to trigger this on # we don't actually need idf-info, just a convenient event to trigger this on
app.connect('idf-info', generate_idf_tools_links) app.connect('idf-info', generate_idf_tools_links)

View File

@@ -10,7 +10,6 @@ import sys
import os import os
sys.path.insert(0, os.path.abspath('..')) sys.path.insert(0, os.path.abspath('..'))
from conf_common import * # noqa: F401, F403 - need to make available everything from common from conf_common import * # noqa: F401, F403 - need to make available everything from common
from idf_extensions.util import download_file_if_missing # noqa: E402 - need to import from common folder
# General information about the project. # General information about the project.
project = u'ESP-IDF 编程指南' project = u'ESP-IDF 编程指南'