else:
mode = 1
- if not self.functions.has_key(n):
+ if n not in self.functions:
self.functions[ n ] = [c, mode]
return
def printPixelFunction(self, f):
- if self.pixel_stubs.has_key( f.name ):
+ if f.name in self.pixel_stubs:
# Normally gl_function::get_parameter_string could be
# used. However, this call needs to have the missing
# dimensions (e.g., a fake height value for
for enum_name in enum_dict:
e = enum_dict[ enum_name ]
- if e.functions.has_key( match_name ):
+ if match_name in e.functions:
[count, mode] = e.functions[ match_name ]
if mode_set and mode != self.mode:
self.mode = mode
- if self.enums.has_key( e.value ):
+ if e.value in self.enums:
if e.name not in self.enums[ e.value ]:
self.enums[ e.value ].append( e )
else:
- if not self.count.has_key( count ):
+ if count not in self.count:
self.count[ count ] = []
self.enums[ e.value ] = [ e ]
for a in self.enums:
count += 1
- if self.count.has_key(-1):
+ if -1 in self.count:
return 0
# Determine if there is some mask M, such that M = (2^N) - 1,
if (ef.is_set() and self.emit_set) or (not ef.is_set() and self.emit_get):
sig = ef.signature()
- if enum_sigs.has_key( sig ):
+ if sig in enum_sigs:
aliases.append( [func.name, enum_sigs[ sig ]] )
else:
enum_sigs[ sig ] = func.name
sig = ef.signature()
- if not enum_functions.has_key(func.name):
+ if func.name not in enum_functions:
enum_functions[ func.name ] = sig
- if not enum_sigs.has_key( sig ):
+ if sig not in enum_sigs:
enum_sigs[ sig ] = ef
if func.server_handcode: continue
if not func.has_variable_size_request(): continue
- if enum_functions.has_key(func.name):
+ if func.name in enum_functions:
sig = enum_functions[func.name]
ef = enum_sigs[ sig ]
# already be emitted, don't emit this function. Instead, add
# it to the list of function aliases.
- if self.counter_sigs.has_key(sig):
+ if sig in self.counter_sigs:
n = self.counter_sigs[sig];
alias = [f.name, n]
else:
temp_name = child.get( "name" )
self.category_dict[ temp_name ] = [cat_name, cat_number]
- if self.functions_by_name.has_key( func_name ):
+ if func_name in self.functions_by_name:
func = self.functions_by_name[ func_name ]
func.process_element( child )
else:
if (cat == None) or (cat == cat_name):
[func_cat_type, key] = classify_category(cat_name, cat_number)
- if not lists[func_cat_type].has_key(key):
+ if key not in lists[func_cat_type]:
lists[func_cat_type][key] = {}
lists[func_cat_type][key][func.name] = func
def get_category_for_name( self, name ):
- if self.category_dict.has_key(name):
+ if name in self.category_dict:
return self.category_dict[name]
else:
return ["<unknown category>", None]
for n in func.entry_points:
cat, num = api.get_category_for_name(n)
if (cat.startswith("es") or cat.startswith("GL_OES")):
- if not categories.has_key(cat):
+ if cat not in categories:
categories[cat] = []
proto = 'GLAPI %s GLAPIENTRY %s(%s);' \
% (func.return_type, "gl" + n, func.get_parameter_string(n))
else:
attrs['handcode'] = None
- if entry_dict.has_key(name):
+ if name in entry_dict:
raise Exception('%s is duplicated' % (name))
cols = []
ent = ABIEntry(cols, attrs, func)
entry_dict[ent.name] = ent
- entries = entry_dict.values()
- entries.sort()
+ entries = sorted(entry_dict.values())
return entries
raise Exception('invalid slot in %s' % (line))
ent = ABIEntry(cols, attrs)
- if entry_dict.has_key(ent.name):
+ if ent.name in entry_dict:
raise Exception('%s is duplicated' % (ent.name))
entry_dict[ent.name] = ent
- entries = entry_dict.values()
- entries.sort()
+ entries = sorted(entry_dict.values())
return entries
# open quote
q = u'\u201d'
r = r + q
- elif escapeSeqs.has_key(s[i]):
+ elif s[i] in escapeSeqs:
r = r + escapeSeqs[s[i]]
else:
r = r + s[i]
escape = False
r = r + chr(num)
else:
- if escapeSeqs.has_key(s[i]):
+ if s[i] in escapeSeqs:
r = r + escapeSeqs[s[i]]
escape = False
elif s[i] >= '0' and s[i] <= '7':