mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #3948 from rneatherway/lgtm-fixes
Fix alerts found on lgtm.com
This commit is contained in:
commit
618760cf58
@ -73,8 +73,6 @@ class ChangesBuilder(Builder):
|
|||||||
ttext = self.typemap[type]
|
ttext = self.typemap[type]
|
||||||
context = content.replace('\n', ' ')
|
context = content.replace('\n', ' ')
|
||||||
if descname and docname.startswith('c-api'):
|
if descname and docname.startswith('c-api'):
|
||||||
if not descname:
|
|
||||||
continue
|
|
||||||
if context:
|
if context:
|
||||||
entry = '<b>%s</b>: <i>%s:</i> %s' % (descname, ttext,
|
entry = '<b>%s</b>: <i>%s:</i> %s' % (descname, ttext,
|
||||||
context)
|
context)
|
||||||
|
@ -4673,9 +4673,8 @@ class DefinitionParser(object):
|
|||||||
else:
|
else:
|
||||||
# For testing purposes.
|
# For testing purposes.
|
||||||
# do it again to get the proper traceback (how do you
|
# do it again to get the proper traceback (how do you
|
||||||
# relieable save a traceback when an exception is
|
# reliably save a traceback when an exception is
|
||||||
# constructed?)
|
# constructed?)
|
||||||
pass
|
|
||||||
self.pos = startPos
|
self.pos = startPos
|
||||||
typed = True
|
typed = True
|
||||||
declSpecs = self._parse_decl_specs(outer=outer, typed=typed)
|
declSpecs = self._parse_decl_specs(outer=outer, typed=typed)
|
||||||
|
@ -91,9 +91,8 @@ class Grammar(object):
|
|||||||
|
|
||||||
def dump(self, filename):
|
def dump(self, filename):
|
||||||
"""Dump the grammar tables to a pickle file."""
|
"""Dump the grammar tables to a pickle file."""
|
||||||
f = open(filename, "wb")
|
with open(filename, "wb") as f:
|
||||||
pickle.dump(self.__dict__, f, 2)
|
pickle.dump(self.__dict__, f, 2)
|
||||||
f.close()
|
|
||||||
|
|
||||||
def load(self, filename):
|
def load(self, filename):
|
||||||
"""Load the grammar tables from a pickle file."""
|
"""Load the grammar tables from a pickle file."""
|
||||||
|
@ -431,7 +431,7 @@ def generate_tokens(readline):
|
|||||||
(lnum, pos), (lnum, pos+1), line)
|
(lnum, pos), (lnum, pos+1), line)
|
||||||
pos = pos + 1
|
pos = pos + 1
|
||||||
|
|
||||||
for indent in indents[1:]: # pop remaining indent levels
|
for _ in indents[1:]: # pop remaining indent levels
|
||||||
yield (DEDENT, '', (lnum, 0), (lnum, 0), '')
|
yield (DEDENT, '', (lnum, 0), (lnum, 0), '')
|
||||||
yield (ENDMARKER, '', (lnum, 0), (lnum, 0), '')
|
yield (ENDMARKER, '', (lnum, 0), (lnum, 0), '')
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@
|
|||||||
li.hide();
|
li.hide();
|
||||||
|
|
||||||
// Determine where in the parents children list to insert this comment.
|
// Determine where in the parents children list to insert this comment.
|
||||||
for(i=0; i < siblings.length; i++) {
|
for(var i=0; i < siblings.length; i++) {
|
||||||
if (comp(comment, siblings[i]) <= 0) {
|
if (comp(comment, siblings[i]) <= 0) {
|
||||||
$('#cd' + siblings[i].id)
|
$('#cd' + siblings[i].id)
|
||||||
.parent()
|
.parent()
|
||||||
|
@ -432,7 +432,7 @@ var cssHelper = function () {
|
|||||||
oss[n][oss[n].length] = r;
|
oss[n][oss[n].length] = r;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
for (i = 0; i < ors.length; i++) {
|
for (var i = 0; i < ors.length; i++) {
|
||||||
collectSelectors(ors[i]);
|
collectSelectors(ors[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ class ImageConverter(BaseImageConverter):
|
|||||||
def is_available(self):
|
def is_available(self):
|
||||||
# type: () -> bool
|
# type: () -> bool
|
||||||
"""Confirms the converter is available or not."""
|
"""Confirms the converter is available or not."""
|
||||||
raise NotImplemented
|
raise NotImplementedError()
|
||||||
|
|
||||||
def guess_mimetypes(self, node):
|
def guess_mimetypes(self, node):
|
||||||
# type: (nodes.Node) -> List[unicode]
|
# type: (nodes.Node) -> List[unicode]
|
||||||
@ -248,7 +248,7 @@ class ImageConverter(BaseImageConverter):
|
|||||||
def convert(self, _from, _to):
|
def convert(self, _from, _to):
|
||||||
# type: (unicode, unicode) -> bool
|
# type: (unicode, unicode) -> bool
|
||||||
"""Converts the image to expected one."""
|
"""Converts the image to expected one."""
|
||||||
raise NotImplemented
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
|
||||||
def setup(app):
|
def setup(app):
|
||||||
|
@ -21,7 +21,7 @@ except ImportError:
|
|||||||
class BaseStemmer(object):
|
class BaseStemmer(object):
|
||||||
def stem(self, word):
|
def stem(self, word):
|
||||||
# type: (unicode) -> unicode
|
# type: (unicode) -> unicode
|
||||||
raise NotImplemented
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
|
||||||
class PyStemmer(BaseStemmer):
|
class PyStemmer(BaseStemmer):
|
||||||
|
Loading…
Reference in New Issue
Block a user