Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit41c90ae

Browse files
committed
Fixhtml5lib#146; fix all pep8 1.5.4 failures
1 parent808d102 commit41c90ae

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

‎html5lib/html5parser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,8 +1216,7 @@ def startTagIsIndex(self, token):
12161216
attributes["name"]="isindex"
12171217
self.processStartTag(impliedTagToken("input","StartTag",
12181218
attributes=attributes,
1219-
selfClosing=
1220-
token["selfClosing"]))
1219+
selfClosing=token["selfClosing"]))
12211220
self.processEndTag(impliedTagToken("label"))
12221221
self.processStartTag(impliedTagToken("hr","StartTag"))
12231222
self.processEndTag(impliedTagToken("form"))

‎html5lib/sanitizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def sanitize_css(self, style):
245245
elifprop.split('-')[0].lower()in ['background','border','margin',
246246
'padding']:
247247
forkeywordinvalue.split():
248-
ifnotkeywordinself.acceptable_css_keywordsand \
248+
ifkeywordnotinself.acceptable_css_keywordsand \
249249
notre.match("^(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$",keyword):
250250
break
251251
else:

‎html5lib/serializer/htmlserializer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
v=utils.surrogatePairToCodepoint(v)
3636
else:
3737
v=ord(v)
38-
ifnotvinencode_entity_mapork.islower():
38+
ifvnotinencode_entity_mapork.islower():
3939
# prefer < over < and similarly for &, >, etc.
4040
encode_entity_map[v]=k
4141

@@ -291,7 +291,7 @@ def serialize(self, treewalker, encoding=None):
291291
eliftype=="Entity":
292292
name=token["name"]
293293
key=name+";"
294-
ifnotkeyinentities:
294+
ifkeynotinentities:
295295
self.serializeError(_("Entity %s not recognized"%name))
296296
ifself.resolve_entitiesandkeynotinxmlEntities:
297297
data=entities[key]

‎html5lib/tests/test_tokenizer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def processParseError(self, token):
6868
defconcatenateCharacterTokens(tokens):
6969
outputTokens= []
7070
fortokenintokens:
71-
ifnot"ParseError"intokenandtoken[0]=="Character":
72-
if (outputTokensandnot"ParseError"inoutputTokens[-1]and
71+
if"ParseError"notintokenandtoken[0]=="Character":
72+
if (outputTokensand"ParseError"notinoutputTokens[-1]and
7373
outputTokens[-1][0]=="Character"):
7474
outputTokens[-1][1]+=token[1]
7575
else:
@@ -112,7 +112,7 @@ def tokensMatch(expectedTokens, receivedTokens, ignoreErrorOrder,
112112
# Sort the tokens into two groups; non-parse errors and parse errors
113113
tokens= {"expected": [[], []],"received": [[], []]}
114114
fortokenType,tokenListinzip(list(tokens.keys()),
115-
(expectedTokens,receivedTokens)):
115+
(expectedTokens,receivedTokens)):
116116
fortokenintokenList:
117117
iftoken!="ParseError":
118118
tokens[tokenType][0].append(token)

‎html5lib/treebuilders/dom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def insertText(self, data, parent=None):
158158
else:
159159
# HACK: allow text nodes as children of the document node
160160
ifhasattr(self.dom,'_child_node_types'):
161-
ifnotNode.TEXT_NODEinself.dom._child_node_types:
161+
ifNode.TEXT_NODEnotinself.dom._child_node_types:
162162
self.dom._child_node_types=list(self.dom._child_node_types)
163163
self.dom._child_node_types.append(Node.TEXT_NODE)
164164
self.dom.appendChild(self.dom.createTextNode(data))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp