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

Commitd744c86

Browse files
committed
Consistency: use camel-casing to correspond with existing codebase style
1 parent5f4ace9 commitd744c86

File tree

6 files changed

+30
-30
lines changed

6 files changed

+30
-30
lines changed

‎html5lib/_tokenizer.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ def __init__(self, data=None):
2929

3030

3131
classDoctype(Token):
32-
def__init__(self,name,public_id,system_id,correct):
32+
def__init__(self,name,publicId,systemId,correct):
3333
self.name=name.translate(asciiUpper2Lower)
3434
self.namespace=None
35-
self.public_id=public_id
36-
self.system_id=system_id
35+
self.publicId=publicId
36+
self.systemId=systemId
3737
self.correct=correct
3838

3939
classCharacters(Token):
@@ -1056,7 +1056,7 @@ def markupDeclarationOpenState(self):
10561056
matched=False
10571057
break
10581058
ifmatched:
1059-
self.currentToken=Doctype(name="",public_id=None,system_id=None,correct=True)
1059+
self.currentToken=Doctype(name="",publicId=None,systemId=None,correct=True)
10601060
self.state=self.doctypeState
10611061
returnTrue
10621062
elif (charStack[-1]=="["and
@@ -1329,10 +1329,10 @@ def beforeDoctypePublicIdentifierState(self):
13291329
ifdatainspaceCharacters:
13301330
pass
13311331
elifdata=="\"":
1332-
self.currentToken.public_id=""
1332+
self.currentToken.publicId=""
13331333
self.state=self.doctypePublicIdentifierDoubleQuotedState
13341334
elifdata=="'":
1335-
self.currentToken.public_id=""
1335+
self.currentToken.publicId=""
13361336
self.state=self.doctypePublicIdentifierSingleQuotedState
13371337
elifdata==">":
13381338
self.tokenQueue.append(ParseError("unexpected-end-of-doctype"))
@@ -1356,7 +1356,7 @@ def doctypePublicIdentifierDoubleQuotedState(self):
13561356
self.state=self.afterDoctypePublicIdentifierState
13571357
elifdata=="\u0000":
13581358
self.tokenQueue.append(ParseError("invalid-codepoint"))
1359-
self.currentToken.public_id+="\uFFFD"
1359+
self.currentToken.publicId+="\uFFFD"
13601360
elifdata==">":
13611361
self.tokenQueue.append(ParseError("unexpected-end-of-doctype"))
13621362
self.currentToken.correct=False
@@ -1368,7 +1368,7 @@ def doctypePublicIdentifierDoubleQuotedState(self):
13681368
self.tokenQueue.append(self.currentToken)
13691369
self.state=self.dataState
13701370
else:
1371-
self.currentToken.public_id+=data
1371+
self.currentToken.publicId+=data
13721372
returnTrue
13731373

13741374
defdoctypePublicIdentifierSingleQuotedState(self):
@@ -1377,7 +1377,7 @@ def doctypePublicIdentifierSingleQuotedState(self):
13771377
self.state=self.afterDoctypePublicIdentifierState
13781378
elifdata=="\u0000":
13791379
self.tokenQueue.append(ParseError("invalid-codepoint"))
1380-
self.currentToken.public_id+="\uFFFD"
1380+
self.currentToken.publicId+="\uFFFD"
13811381
elifdata==">":
13821382
self.tokenQueue.append(ParseError("unexpected-end-of-doctype"))
13831383
self.currentToken.correct=False
@@ -1389,7 +1389,7 @@ def doctypePublicIdentifierSingleQuotedState(self):
13891389
self.tokenQueue.append(self.currentToken)
13901390
self.state=self.dataState
13911391
else:
1392-
self.currentToken.public_id+=data
1392+
self.currentToken.publicId+=data
13931393
returnTrue
13941394

13951395
defafterDoctypePublicIdentifierState(self):
@@ -1401,11 +1401,11 @@ def afterDoctypePublicIdentifierState(self):
14011401
self.state=self.dataState
14021402
elifdata=='"':
14031403
self.tokenQueue.append(ParseError("unexpected-char-in-doctype"))
1404-
self.currentToken.system_id=""
1404+
self.currentToken.systemId=""
14051405
self.state=self.doctypeSystemIdentifierDoubleQuotedState
14061406
elifdata=="'":
14071407
self.tokenQueue.append(ParseError("unexpected-char-in-doctype"))
1408-
self.currentToken.system_id=""
1408+
self.currentToken.systemId=""
14091409
self.state=self.doctypeSystemIdentifierSingleQuotedState
14101410
elifdataisEOF:
14111411
self.tokenQueue.append(ParseError("eof-in-doctype"))
@@ -1426,10 +1426,10 @@ def betweenDoctypePublicAndSystemIdentifiersState(self):
14261426
self.tokenQueue.append(self.currentToken)
14271427
self.state=self.dataState
14281428
elifdata=='"':
1429-
self.currentToken.system_id=""
1429+
self.currentToken.systemId=""
14301430
self.state=self.doctypeSystemIdentifierDoubleQuotedState
14311431
elifdata=="'":
1432-
self.currentToken.system_id=""
1432+
self.currentToken.systemId=""
14331433
self.state=self.doctypeSystemIdentifierSingleQuotedState
14341434
elifdata==EOF:
14351435
self.tokenQueue.append(ParseError("eof-in-doctype"))
@@ -1465,10 +1465,10 @@ def beforeDoctypeSystemIdentifierState(self):
14651465
ifdatainspaceCharacters:
14661466
pass
14671467
elifdata=="\"":
1468-
self.currentToken.system_id=""
1468+
self.currentToken.systemId=""
14691469
self.state=self.doctypeSystemIdentifierDoubleQuotedState
14701470
elifdata=="'":
1471-
self.currentToken.system_id=""
1471+
self.currentToken.systemId=""
14721472
self.state=self.doctypeSystemIdentifierSingleQuotedState
14731473
elifdata==">":
14741474
self.tokenQueue.append(ParseError("unexpected-char-in-doctype"))
@@ -1492,7 +1492,7 @@ def doctypeSystemIdentifierDoubleQuotedState(self):
14921492
self.state=self.afterDoctypeSystemIdentifierState
14931493
elifdata=="\u0000":
14941494
self.tokenQueue.append(ParseError("invalid-codepoint"))
1495-
self.currentToken.system_id+="\uFFFD"
1495+
self.currentToken.systemId+="\uFFFD"
14961496
elifdata==">":
14971497
self.tokenQueue.append(ParseError("unexpected-end-of-doctype"))
14981498
self.currentToken.correct=False
@@ -1504,7 +1504,7 @@ def doctypeSystemIdentifierDoubleQuotedState(self):
15041504
self.tokenQueue.append(self.currentToken)
15051505
self.state=self.dataState
15061506
else:
1507-
self.currentToken.system_id+=data
1507+
self.currentToken.systemId+=data
15081508
returnTrue
15091509

15101510
defdoctypeSystemIdentifierSingleQuotedState(self):
@@ -1513,7 +1513,7 @@ def doctypeSystemIdentifierSingleQuotedState(self):
15131513
self.state=self.afterDoctypeSystemIdentifierState
15141514
elifdata=="\u0000":
15151515
self.tokenQueue.append(ParseError("invalid-codepoint"))
1516-
self.currentToken.system_id+="\uFFFD"
1516+
self.currentToken.systemId+="\uFFFD"
15171517
elifdata==">":
15181518
self.tokenQueue.append(ParseError("unexpected-end-of-doctype"))
15191519
self.currentToken.correct=False
@@ -1525,7 +1525,7 @@ def doctypeSystemIdentifierSingleQuotedState(self):
15251525
self.tokenQueue.append(self.currentToken)
15261526
self.state=self.dataState
15271527
else:
1528-
self.currentToken.system_id+=data
1528+
self.currentToken.systemId+=data
15291529
returnTrue
15301530

15311531
defafterDoctypeSystemIdentifierState(self):

‎html5lib/html5parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,8 @@ def processComment(self, token):
505505

506506
defprocessDoctype(self,token):
507507
name=token.name
508-
publicId=token.public_id
509-
systemId=token.system_id
508+
publicId=token.publicId
509+
systemId=token.systemId
510510
correct=token.correct
511511

512512
if (name!="html"orpublicIdisnotNoneor

‎html5lib/tests/tokenizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def parse(self, stream, encoding=None, innerHTML=False):
3333
returnself.outputTokens
3434

3535
defprocessDoctype(self,token):
36-
self.outputTokens.append(["DOCTYPE",token.name,token.public_id,
37-
token.system_id,token.correct])
36+
self.outputTokens.append(["DOCTYPE",token.name,token.publicId,
37+
token.systemId,token.correct])
3838

3939
defprocessStartTag(self,token):
4040
self.outputTokens.append(["StartTag",token.name,

‎html5lib/treebuilders/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ def insertRoot(self, token):
287287

288288
definsertDoctype(self,token):
289289
name=token.name
290-
publicId=token.public_id
291-
systemId=token.system_id
290+
publicId=token.publicId
291+
systemId=token.systemId
292292

293293
doctype=self.doctypeClass(name,publicId,systemId)
294294
self.document.appendChild(doctype)

‎html5lib/treebuilders/dom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ def documentClass(self):
127127

128128
definsertDoctype(self,token):
129129
name=token.name
130-
publicId=token.public_id
131-
systemId=token.system_id
130+
publicId=token.publicId
131+
systemId=token.systemId
132132

133133
domimpl=Dom.getDOMImplementation()
134134
doctype=domimpl.createDocumentType(name,publicId,systemId)

‎html5lib/treebuilders/etree_lxml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ def getFragment(self):
309309

310310
definsertDoctype(self,token):
311311
name=token.name
312-
publicId=token.public_id
313-
systemId=token.system_id
312+
publicId=token.publicId
313+
systemId=token.systemId
314314

315315
ifnotname:
316316
warnings.warn("lxml cannot represent empty doctype",DataLossWarning)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp