# Validate many python style rules
FLAKE8_INDENTATION = E114,E115,E116,E121,E125,E126,E127,E128,E129,E131
-FLAKE8_WHITESPACE = E211,E221,E222,E225,E226,E231,E261
FLAKE8_LINE_LENGTH = E501
FLAKE8_WARNINGS = W504
FLAKE8_IGNORE = $(FLAKE8_INDENTATION),$\
- $(FLAKE8_WHITESPACE),$\
$(FLAKE8_LINE_LENGTH),$\
$(FLAKE8_WARNINGS) \
$(NULL)
i = 0
nline = len(line)
while i < nline:
- if line[i] == '*' and i+1 < nline and line[i+1] == '/':
- self.line = line[i+2:]
- line = line[:i-1]
+ if line[i] == '*' and i + 1 < nline and line[i + 1] == '/':
+ self.line = line[i + 2:]
+ line = line[:i - 1]
nline = i
found = 1
break
return self.last
i = 0
while i < nline:
- if line[i] == '/' and i+1 < nline and line[i+1] == '/':
+ if line[i] == '/' and i + 1 < nline and line[i + 1] == '/':
self.line = line[i:]
line = line[:i]
break
- if line[i] == '/' and i+1 < nline and line[i+1] == '*':
+ if line[i] == '/' and i + 1 < nline and line[i + 1] == '*':
self.line = line[i:]
line = line[:i]
break
continue
if line[i] in "+-*><=/%&!|.":
if line[i] == '.' and i + 2 < nline and \
- line[i+1] == '.' and line[i+2] == '.':
+ line[i + 1] == '.' and line[i + 2] == '.':
self.tokens.append(('name', '...'))
i = i + 3
continue
j = i + 1
if j < nline and line[j] in "+-*><=/%&!|":
- self.tokens.append(('op', line[i:j+1]))
+ self.tokens.append(('op', line[i:j + 1]))
i = j + 1
else:
self.tokens.append(('op', line[i]))
lst.append(token[1])
token = self.lexer.token()
try:
- name = name.split('(') [0]
+ name = name.split('(')[0]
except Exception:
pass
return string
def generate_typefromstring(self):
- string = " if (STREQ(type, \"%s\"))\n" % self.name
+ string = " if (STREQ(type, \"%s\"))\n" % self.name
string += " return esxVI_Type_%s;\n" % self.name
return string
class GenericObject(Type):
FEATURE__DYNAMIC_CAST = (1 << 1)
- FEATURE__LIST = (1 << 2)
- FEATURE__DEEP_COPY = (1 << 3)
- FEATURE__ANY_TYPE = (1 << 4)
- FEATURE__SERIALIZE = (1 << 5)
- FEATURE__DESERIALIZE = (1 << 6)
+ FEATURE__LIST = (1 << 2)
+ FEATURE__DEEP_COPY = (1 << 3)
+ FEATURE__ANY_TYPE = (1 << 4)
+ FEATURE__SERIALIZE = (1 << 5)
+ FEATURE__DESERIALIZE = (1 << 6)
def __init__(self, name, category, managed, generic_objects_by_name):
Type.__init__(self, "struct", name)
for property in cls.properties:
source += property.generate_typemap()
- source += ' { "", "", 0 },\n' # null terminated
+ source += ' { "", "", 0 },\n' # null terminated
source += '};\n\n'
source += self._define_WmiInfo_struct()
if "msr" in cpuData:
msr = cpuData["msr"]
for index in sorted(msr.keys()):
- f.write(" <msr index='0x%x' edx='0x%08x' eax='0x%08x'/>\n" %(
- index, msr[index]['edx'], msr[index]['eax']))
+ f.write(" <msr index='0x%x' edx='0x%08x' eax='0x%08x'/>\n" %
+ (index, msr[index]['edx'], msr[index]['eax']))
f.write("</cpudata>\n")