summaryrefslogtreecommitdiff
path: root/docs/tools/dump_format_style.py
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tools/dump_format_style.py')
-rw-r--r--docs/tools/dump_format_style.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/docs/tools/dump_format_style.py b/docs/tools/dump_format_style.py
index 3d61227f73617..5feb793a4d705 100644
--- a/docs/tools/dump_format_style.py
+++ b/docs/tools/dump_format_style.py
@@ -6,7 +6,6 @@
import collections
import os
import re
-import urllib2
CLANG_DIR = os.path.join(os.path.dirname(__file__), '../..')
FORMAT_STYLE_FILE = os.path.join(CLANG_DIR, 'include/clang/Format/Format.h')
@@ -32,7 +31,7 @@ def indent(text, columns, indent_first_line=True):
return s
return indent + s
-class Option:
+class Option(object):
def __init__(self, name, type, comment):
self.name = name
self.type = type
@@ -50,7 +49,7 @@ class Option:
2)
return s
-class NestedStruct:
+class NestedStruct(object):
def __init__(self, name, comment):
self.name = name
self.comment = comment.strip()
@@ -59,7 +58,7 @@ class NestedStruct:
def __str__(self):
return '\n'.join(map(str, self.values))
-class NestedField:
+class NestedField(object):
def __init__(self, name, comment):
self.name = name
self.comment = comment.strip()
@@ -69,7 +68,7 @@ class NestedField:
self.name,
doxygen2rst(indent(self.comment, 2, indent_first_line=False)))
-class Enum:
+class Enum(object):
def __init__(self, name, comment):
self.name = name
self.comment = comment.strip()
@@ -78,7 +77,7 @@ class Enum:
def __str__(self):
return '\n'.join(map(str, self.values))
-class EnumValue:
+class EnumValue(object):
def __init__(self, name, comment):
self.name = name
self.comment = comment
@@ -101,7 +100,7 @@ def clean_comment_line(line):
return line[4:] + '\n'
def read_options(header):
- class State:
+ class State(object):
BeforeStruct, Finished, InStruct, InNestedStruct, InNestedFieldComent, \
InFieldComment, InEnum, InEnumMemberComment = range(8)
state = State.BeforeStruct
@@ -180,9 +179,9 @@ def read_options(header):
'std::vector<std::string>',
'std::vector<IncludeCategory>',
'std::vector<RawStringFormat>']:
- if enums.has_key(option.type):
+ if option.type in enums:
option.enum = enums[option.type]
- elif nested_structs.has_key(option.type):
+ elif option.type in nested_structs:
option.nested_struct = nested_structs[option.type]
else:
raise Exception('Unknown type: %s' % option.type)