rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
prec = tokens[i-1] if prec.line == t.line and prec.end == t.col:
if t.prec.line == t.line and t.prec.end == t.col:
def check_missing_spaces_before(tokens, lines, warnings): "Check for missing spaces before }" operators = '}', for i, t in enumerate(tokens): if t.typ != Token.punct or t.string not in operators: continue prec = tokens[i-1] if prec.line == t.line and prec.end == t.col: w = 'Missing space before `%s\' (col %d): %s' warnings.append((t.line, w % (t.string, t.col, lines[t.line])))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
for i, t in enumerate(tokens):
for t in tokens:
def check_singlular_opening_braces(tokens, lines, warnings): "Check for inappropriate { on a separate line" for i, t in enumerate(tokens): if t.bracelevel == 0 or t.typ != Token.punct or t.string != '{': continue prec = tokens[i-1] if t.line > prec.line and prec.typ == Token.punct \ and prec.string == ')': w = 'Opening brace on a separate line (col %d)' warnings.append((t.line, w % t.col))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
prec = tokens[i-1] if t.line > prec.line and prec.typ == Token.punct \ and prec.string == ')':
if t.line > t.prec.line and t.prec.typ == Token.punct \ and t.prec.string == ')':
def check_singlular_opening_braces(tokens, lines, warnings): "Check for inappropriate { on a separate line" for i, t in enumerate(tokens): if t.bracelevel == 0 or t.typ != Token.punct or t.string != '{': continue prec = tokens[i-1] if t.line > prec.line and prec.typ == Token.punct \ and prec.string == ')': w = 'Opening brace on a separate line (col %d)' warnings.append((t.line, w % t.col))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
for i, t in enumerate(tokens):
for t in tokens:
def check_keyword_spacing(tokens, lines, warnings): "Check for missing spaces after for, while, etc." keywlist = 'if', 'for', 'while', 'switch' keywords = dict([(x, 1) for x in keywlist]) for i, t in enumerate(tokens): if t.typ != Token.ident or t.string not in keywords: continue succ = tokens[i+1] if succ.line == t.line and t.end == succ.col: w = 'Missing space after `%s\' (col %d): %s' warnings.append((t.line, w % (t.string, t.col, lines[t.line])))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
succ = tokens[i+1] if succ.line == t.line and t.end == succ.col:
if t.succ.line == t.line and t.end == t.succ.col:
def check_keyword_spacing(tokens, lines, warnings): "Check for missing spaces after for, while, etc." keywlist = 'if', 'for', 'while', 'switch' keywords = dict([(x, 1) for x in keywlist]) for i, t in enumerate(tokens): if t.typ != Token.ident or t.string not in keywords: continue succ = tokens[i+1] if succ.line == t.line and t.end == succ.col: w = 'Missing space after `%s\' (col %d): %s' warnings.append((t.line, w % (t.string, t.col, lines[t.line])))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
for i, t in enumerate(tokens):
for t in tokens:
def check_multistatements(tokens, lines, warnings): "Check for more than one statemen on one line" for i, t in enumerate(tokens): if t.typ != Token.punct or t.string != ';' or t.parenlevel > 0: continue try: succ = tokens[i+1] except IndexError: break if succ.line == t.line: w = 'More than one statement on a line (col %d): %s' warnings.append((t.line, w % (succ.col, lines[t.line])))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
try: succ = tokens[i+1] except IndexError: break if succ.line == t.line:
if t.succ.line == t.line:
def check_multistatements(tokens, lines, warnings): "Check for more than one statemen on one line" for i, t in enumerate(tokens): if t.typ != Token.punct or t.string != ';' or t.parenlevel > 0: continue try: succ = tokens[i+1] except IndexError: break if succ.line == t.line: w = 'More than one statement on a line (col %d): %s' warnings.append((t.line, w % (succ.col, lines[t.line])))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
warnings.append((t.line, w % (succ.col, lines[t.line])))
warnings.append((t.line, w % (t.succ.col, lines[t.line])))
def check_multistatements(tokens, lines, warnings): "Check for more than one statemen on one line" for i, t in enumerate(tokens): if t.typ != Token.punct or t.string != ';' or t.parenlevel > 0: continue try: succ = tokens[i+1] except IndexError: break if succ.line == t.line: w = 'More than one statement on a line (col %d): %s' warnings.append((t.line, w % (succ.col, lines[t.line])))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
for i, t in enumerate(tokens):
for t in tokens:
def check_oneliners(tokens, lines, warnings): "Check for if, else, statements on the same line." for i, t in enumerate(tokens): if t.typ != Token.ident: continue if t.string == 'else': succ = tokens[i+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[i+2] if succ.line > t.line: continue if succ.typ == Token.ident and succ.string == 'if': continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue if t.string in ('for', 'while', 'if'): # catch do-while if t.string == 'while': prec = tokens[i-1] if prec.typ == Token.punct and prec.string == '}': prec = tokens[prec.matching-1] if prec.typ == Token.ident and prec.string == 'do': continue succ = tokens[i+1] assert succ.typ == Token.punct and succ.string == '(' m = succ.matching succ = tokens[m+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[m+2] if succ.line > tokens[m].line: continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
succ = tokens[i+1]
succ = t.succ
def check_oneliners(tokens, lines, warnings): "Check for if, else, statements on the same line." for i, t in enumerate(tokens): if t.typ != Token.ident: continue if t.string == 'else': succ = tokens[i+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[i+2] if succ.line > t.line: continue if succ.typ == Token.ident and succ.string == 'if': continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue if t.string in ('for', 'while', 'if'): # catch do-while if t.string == 'while': prec = tokens[i-1] if prec.typ == Token.punct and prec.string == '}': prec = tokens[prec.matching-1] if prec.typ == Token.ident and prec.string == 'do': continue succ = tokens[i+1] assert succ.typ == Token.punct and succ.string == '(' m = succ.matching succ = tokens[m+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[m+2] if succ.line > tokens[m].line: continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
succ = tokens[i+2]
succ = succ.succ
def check_oneliners(tokens, lines, warnings): "Check for if, else, statements on the same line." for i, t in enumerate(tokens): if t.typ != Token.ident: continue if t.string == 'else': succ = tokens[i+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[i+2] if succ.line > t.line: continue if succ.typ == Token.ident and succ.string == 'if': continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue if t.string in ('for', 'while', 'if'): # catch do-while if t.string == 'while': prec = tokens[i-1] if prec.typ == Token.punct and prec.string == '}': prec = tokens[prec.matching-1] if prec.typ == Token.ident and prec.string == 'do': continue succ = tokens[i+1] assert succ.typ == Token.punct and succ.string == '(' m = succ.matching succ = tokens[m+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[m+2] if succ.line > tokens[m].line: continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
prec = tokens[i-1]
prec = t.prec
def check_oneliners(tokens, lines, warnings): "Check for if, else, statements on the same line." for i, t in enumerate(tokens): if t.typ != Token.ident: continue if t.string == 'else': succ = tokens[i+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[i+2] if succ.line > t.line: continue if succ.typ == Token.ident and succ.string == 'if': continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue if t.string in ('for', 'while', 'if'): # catch do-while if t.string == 'while': prec = tokens[i-1] if prec.typ == Token.punct and prec.string == '}': prec = tokens[prec.matching-1] if prec.typ == Token.ident and prec.string == 'do': continue succ = tokens[i+1] assert succ.typ == Token.punct and succ.string == '(' m = succ.matching succ = tokens[m+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[m+2] if succ.line > tokens[m].line: continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
prec = tokens[prec.matching-1]
prec = prec.matching.prec
def check_oneliners(tokens, lines, warnings): "Check for if, else, statements on the same line." for i, t in enumerate(tokens): if t.typ != Token.ident: continue if t.string == 'else': succ = tokens[i+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[i+2] if succ.line > t.line: continue if succ.typ == Token.ident and succ.string == 'if': continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue if t.string in ('for', 'while', 'if'): # catch do-while if t.string == 'while': prec = tokens[i-1] if prec.typ == Token.punct and prec.string == '}': prec = tokens[prec.matching-1] if prec.typ == Token.ident and prec.string == 'do': continue succ = tokens[i+1] assert succ.typ == Token.punct and succ.string == '(' m = succ.matching succ = tokens[m+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[m+2] if succ.line > tokens[m].line: continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
succ = tokens[i+1] assert succ.typ == Token.punct and succ.string == '('
succ = t.succ if succ.typ != Token.punct or succ.string != '(': continue
def check_oneliners(tokens, lines, warnings): "Check for if, else, statements on the same line." for i, t in enumerate(tokens): if t.typ != Token.ident: continue if t.string == 'else': succ = tokens[i+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[i+2] if succ.line > t.line: continue if succ.typ == Token.ident and succ.string == 'if': continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue if t.string in ('for', 'while', 'if'): # catch do-while if t.string == 'while': prec = tokens[i-1] if prec.typ == Token.punct and prec.string == '}': prec = tokens[prec.matching-1] if prec.typ == Token.ident and prec.string == 'do': continue succ = tokens[i+1] assert succ.typ == Token.punct and succ.string == '(' m = succ.matching succ = tokens[m+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[m+2] if succ.line > tokens[m].line: continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
succ = tokens[m+1]
succ = m.succ
def check_oneliners(tokens, lines, warnings): "Check for if, else, statements on the same line." for i, t in enumerate(tokens): if t.typ != Token.ident: continue if t.string == 'else': succ = tokens[i+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[i+2] if succ.line > t.line: continue if succ.typ == Token.ident and succ.string == 'if': continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue if t.string in ('for', 'while', 'if'): # catch do-while if t.string == 'while': prec = tokens[i-1] if prec.typ == Token.punct and prec.string == '}': prec = tokens[prec.matching-1] if prec.typ == Token.ident and prec.string == 'do': continue succ = tokens[i+1] assert succ.typ == Token.punct and succ.string == '(' m = succ.matching succ = tokens[m+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[m+2] if succ.line > tokens[m].line: continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
succ = tokens[m+2] if succ.line > tokens[m].line:
succ = succ.succ if succ.line > m.line:
def check_oneliners(tokens, lines, warnings): "Check for if, else, statements on the same line." for i, t in enumerate(tokens): if t.typ != Token.ident: continue if t.string == 'else': succ = tokens[i+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[i+2] if succ.line > t.line: continue if succ.typ == Token.ident and succ.string == 'if': continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue if t.string in ('for', 'while', 'if'): # catch do-while if t.string == 'while': prec = tokens[i-1] if prec.typ == Token.punct and prec.string == '}': prec = tokens[prec.matching-1] if prec.typ == Token.ident and prec.string == 'do': continue succ = tokens[i+1] assert succ.typ == Token.punct and succ.string == '(' m = succ.matching succ = tokens[m+1] if succ.typ == Token.punct and succ.string == '{': succ = tokens[m+2] if succ.line > tokens[m].line: continue w = 'Statement for `%s\' on the same line (col %d): %s' warnings.append((succ.line, w % (t.string, succ.col, lines[succ.line]))) continue
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
for i, t in enumerate(tokens):
for t in tokens:
def check_eol_operators(tokens, lines, warnings): "Check for operators on the end of line." # XXX: don't check `=', not always sure about the style oplist = '&&', '||', '+', '-', '*', '/', '%', '|', '&', '^', \ '==', '!=', '<', '>', '<=', '>=', '?' #, '=' operators = dict([(x, 1) for x in oplist]) for i, t in enumerate(tokens): if t.bracelevel == 0: continue if t.typ != Token.punct or t.string not in operators: continue if t.line == tokens[i+1].line: continue w = 'Line ends with an operator `%s\' (col %d): %s' warnings.append((t.line, w % (t.string, t.col, lines[t.line])))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
if t.line == tokens[i+1].line:
if t.line == t.succ.line:
def check_eol_operators(tokens, lines, warnings): "Check for operators on the end of line." # XXX: don't check `=', not always sure about the style oplist = '&&', '||', '+', '-', '*', '/', '%', '|', '&', '^', \ '==', '!=', '<', '>', '<=', '>=', '?' #, '=' operators = dict([(x, 1) for x in oplist]) for i, t in enumerate(tokens): if t.bracelevel == 0: continue if t.typ != Token.punct or t.string not in operators: continue if t.line == tokens[i+1].line: continue w = 'Line ends with an operator `%s\' (col %d): %s' warnings.append((t.line, w % (t.string, t.col, lines[t.line])))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
for i, t in enumerate(tokens):
for t in tokens:
def check_function_call_spaces(tokens, lines, warnings): "Check for function calls having the silly GNU spaces before (." keywlist = 'if', 'for', 'while', 'switch', 'return', 'case', 'goto' keywords = dict([(x, 1) for x in keywlist]) for i, t in enumerate(tokens): if t.bracelevel == 0: continue if t.typ != Token.punct or t.string != '(': continue prec = tokens[i-1] if prec.typ != Token.ident or prec.string in keywords: continue if prec.line == t.line and prec.end == t.col: continue m = t.matching if tokens[m+1].typ == Token.punct and tokens[m+1].string == '(': continue w = 'Space between function name and parenthesis (col %d): %s' warnings.append((t.line, w % (t.col, lines[t.line])))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
prec = tokens[i-1]
prec = t.prec
def check_function_call_spaces(tokens, lines, warnings): "Check for function calls having the silly GNU spaces before (." keywlist = 'if', 'for', 'while', 'switch', 'return', 'case', 'goto' keywords = dict([(x, 1) for x in keywlist]) for i, t in enumerate(tokens): if t.bracelevel == 0: continue if t.typ != Token.punct or t.string != '(': continue prec = tokens[i-1] if prec.typ != Token.ident or prec.string in keywords: continue if prec.line == t.line and prec.end == t.col: continue m = t.matching if tokens[m+1].typ == Token.punct and tokens[m+1].string == '(': continue w = 'Space between function name and parenthesis (col %d): %s' warnings.append((t.line, w % (t.col, lines[t.line])))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
if prec.line == t.line and prec.end == t.col: continue m = t.matching if tokens[m+1].typ == Token.punct and tokens[m+1].string == '(':
if prec.line == t.line and prec.end == t.col or prec.line < t.line: continue m = t.matching.succ if m.typ == Token.punct and m.string == '(':
def check_function_call_spaces(tokens, lines, warnings): "Check for function calls having the silly GNU spaces before (." keywlist = 'if', 'for', 'while', 'switch', 'return', 'case', 'goto' keywords = dict([(x, 1) for x in keywlist]) for i, t in enumerate(tokens): if t.bracelevel == 0: continue if t.typ != Token.punct or t.string != '(': continue prec = tokens[i-1] if prec.typ != Token.ident or prec.string in keywords: continue if prec.line == t.line and prec.end == t.col: continue m = t.matching if tokens[m+1].typ == Token.punct and tokens[m+1].string == '(': continue w = 'Space between function name and parenthesis (col %d): %s' warnings.append((t.line, w % (t.col, lines[t.line])))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
for i, t in enumerate(tokens):
for t in tokens:
def check_return_case_parentheses(tokens, lines, warnings): keywlist = 'return', 'case', 'goto' keywords = dict([(x, 1) for x in keywlist]) for i, t in enumerate(tokens): if t.typ != Token.punct or t.string != '(': continue if not i or tokens[i-1].string not in keywords: continue w = 'Extra return/case/goto parentheses (col %d)' warnings.append((t.line, w % (t.col)))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
if not i or tokens[i-1].string not in keywords:
if t.prec.string not in keywords: continue if t.matching.succ.typ != Token.punct or t.matching.succ.string != ';':
def check_return_case_parentheses(tokens, lines, warnings): keywlist = 'return', 'case', 'goto' keywords = dict([(x, 1) for x in keywlist]) for i, t in enumerate(tokens): if t.typ != Token.punct or t.string != '(': continue if not i or tokens[i-1].string not in keywords: continue w = 'Extra return/case/goto parentheses (col %d)' warnings.append((t.line, w % (t.col)))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
for i, t in enumerate(tokens): if not i or tokens[i].string not in keywords: continue if tokens[i-1].typ != Token.punct or (tokens[i-1].string != '!=' and tokens[i-1].string != '=='):
for t in tokens: if t.string not in keywords: continue prec = t.prec if prec.typ != Token.punct or (prec.string != '!=' and prec.string != '=='):
def check_boolean_comparisons(tokens, lines, warnings): keywlist = 'TRUE', 'FALSE' keywords = dict([(x, 1) for x in keywlist]) for i, t in enumerate(tokens): if not i or tokens[i].string not in keywords: continue if tokens[i-1].typ != Token.punct or (tokens[i-1].string != '!=' and tokens[i-1].string != '=='): continue w = 'Comparison to TRUE or FALSE (col %d)' warnings.append((t.line, w % (t.col)))
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
tokens[p].matching = i
p.matching = t
def find_matching_parentheses(tokens): "Add `matching' attribute to each token that is a parenthesis." pairs = {'}': '{', ')': '(', ']': '['} stacks = {'{': [], '(': [], '[': []} for i, t in enumerate(tokens): if t.string in pairs: p = stacks[pairs[t.string]].pop() t.matching = p tokens[p].matching = i t.parenlevel = len(stacks['(']) t.bracelevel = len(stacks['{']) if t.string in stacks: stacks[t.string].append(i)
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
stacks[t.string].append(i)
stacks[t.string].append(t)
def find_matching_parentheses(tokens): "Add `matching' attribute to each token that is a parenthesis." pairs = {'}': '{', ')': '(', ']': '['} stacks = {'{': [], '(': [], '[': []} for i, t in enumerate(tokens): if t.string in pairs: p = stacks[pairs[t.string]].pop() t.matching = p tokens[p].matching = i t.parenlevel = len(stacks['(']) t.bracelevel = len(stacks['{']) if t.string in stacks: stacks[t.string].append(i)
ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py
re_dbl = re.compile(r'\b(\d*\.\d+|\d+\.?)(?:[Ee][-+]?\d+)?\b') re_int = re.compile(r'\b(?:0[xX][a-fA-F0-9]+|0[0-7]+|[-+]?\d+)[LU]*\b')
re_dbl = re.compile(r'\b(\d*\.\d+|\d+\.?)(?:[Ee][-+]?\d+)?[FfLl]?\b') re_int = re.compile(r'\b(?:0[xX][a-fA-F0-9]+|0[0-7]+|[-+]?\d+)[LlUu]*\b')
def tokenize(lines): "`Parse' a C file returning a sequence of Tokens" re_com = re.compile(r'/\*.*?\*/|//.*') re_mac = re.compile(r'#.*') re_str = re.compile(r'"([^\\"]+|\\"|\\[^"])*"') re_chr = re.compile(r'\'(?:.|\\.|\\[0-7]{3}|\\x[0-9a-f]{2})\'') re_id = re.compile(r'\b[A-Za-z_]\w*\b') # this eats some integers too re_dbl = re.compile(r'\b(\d*\.\d+|\d+\.?)(?:[Ee][-+]?\d+)?\b') re_int = re.compile(r'\b(?:0[xX][a-fA-F0-9]+|0[0-7]+|[-+]?\d+)[LU]*\b') re_eq = re.compile(r'(?:[-+*%/&|!<>=^]|&&|>>|<<|\|\|)?=') re_grp = re.compile(r'&&|<<|>>|->|::|\.\*|->\*|\|\|') re_sin = re.compile(r'[][(){};:?,.+~!%^&*|/^<>]|-') re_tokens = re_com, re_str, re_chr, re_id, re_dbl, re_int, \ re_eq, re_grp, re_sin token_ids = { re_com: 0, re_str: Token.string, re_chr: Token.char, re_id: Token.ident, re_dbl: Token.double, re_int: Token.integer, re_eq: Token.punct, re_grp: Token.punct, re_sin: Token.punct } tokens = [] in_comment = False in_macro = False for i, l in enumerate(lines): l, col = blstrip(l, 0) # special processing when we are inside a multiline comment or macro if in_comment: base = l.find('*/') if base == -1: continue l = l[base+2:] col += base+2 l, col = blstrip(l, col) in_comment = False elif in_macro: in_macro = l.endswith('\\') continue elif l.startswith('#'): if l.endswith('\\'): in_macro = True continue while l: if l.startswith('/*') and l.find('*/') == -1: in_comment = True break for r in re_tokens: m = r.match(l) if m: if token_ids[r]: tokens.append(Token(i, col, token_ids[r], m.group())) col += m.end() l, col = blstrip(l[m.end():], col) break if not m: sys.stderr.write('*** ERROR: Completely ugly code ' + '(trying to sync): %s\n' % l) l = '' return tokens
b86b81524673d5b6826b01f759ed7a4ce58669cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/b86b81524673d5b6826b01f759ed7a4ce58669cf/check-coding-style.py
if t.succ.line == t.line:
if t.succ and t.succ.line == t.line:
def check_multistatements(tokens, lines, warnings): "Check for more than one statemen on one line" for t in tokens: if t.typ != Token.punct or t.string != ';' or t.parenlevel > 0: continue if t.succ.line == t.line: w = 'More than one statement on a line (col %d): %s' warnings.append((t.line, w % (t.succ.col, lines[t.line])))
3a2ed594157cfa10ae7978a2a834fe6ca223ab85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/3a2ed594157cfa10ae7978a2a834fe6ca223ab85/check-coding-style.py
k = re.sub(r'_1_1', '_1:1', k) words = k.split('_')
words = re.sub(r'_1_1', '_1:1', k).split('_')
def update_documentation(images): """Update `documentation' in C source to list all stock icons.""" # Format documentation entries # Note the `../' in image path. It is here to undo the effect of content # files being XIncluded from xml/ subdirectory, therefore straight paths # get xml/ prepended to be relative to the driver file (as of 1.66.1 # stylesheets) -- which is exactly what we do NOT need. cfile = base + '.c' template = ('/**\n' ' * GWY_STOCK_%s\n' ' *\n' ' * The "%s" stock icon.\n' ' * <inlinegraphic fileref="../gwy_%s-%d.png" format="PNG"/>\n' ' **/\n' '\n') docs = [] for k, v in images.items(): k = re.sub(r'_1_1', '_1:1', k) words = k.split('_') for i in range(len(words)): # Heuristics: words without wovels are abbreviations if not re.search(r'[aeiouy]', words[i]): words[i] = words[i].upper() else: words[i] = words[i].title() human_name = '-'.join(words) if 24 in v: size = 24 else: size = max(v) docs.append(template % (k.upper(), human_name, k, size)) docs.sort() docs = ''.join(docs) replace_file(cfile, docs)
615a12f229f016a9e46ca741b59697c24bb3cac7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/615a12f229f016a9e46ca741b59697c24bb3cac7/stockgen.py
re_enum = re.compile(r'^\s+(?P<ident>[A-Z][A-Z0-9_]+)\s*[=,]', re.M)
re_enum = re.compile(r'^\s+(?P<ident>[A-Z][A-Z0-9_]+)\b', re.M)
command -nargs=+ HiLink hi def link <args>
f22036f31504e04fccaf44bbd14c6b8df92670ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/f22036f31504e04fccaf44bbd14c6b8df92670ec/vim-syn-gen.py
assert c == '['
if not c: return False if c != '[': fh.seek(-1, 1) return False
def _read_dfield(fh, data, base): c = fh.read(1) assert c == '[' dfield = {} _dmove(data, base + '/xres', dfield, 'xres', int) _dmove(data, base + '/yres', dfield, 'yres', int) _dmove(data, base + '/xreal', dfield, 'xreal', float) _dmove(data, base + '/yreal', dfield, 'yreal', float) _dmove(data, base + '/unit-xy', dfield, 'unit-xy') _dmove(data, base + '/unit-z', dfield, 'unit-z') a = _array.array('d') a.fromfile(fh, dfield['xres']*dfield['yres']) c = fh.readline() assert c == ']]\n' dfield['data'] = a data[base] = dfield
44776d77de69c849b502946b3d04c28b955b1cee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/44776d77de69c849b502946b3d04c28b955b1cee/dump.py
if m: _read_dfield(fh, data, m.group('key'))
if m and _read_dfield(fh, data, m.group('key')):
def read(filename): """Read a Gwyddion plug-in proxy dump file. The file is returned as a dictionary of dump key, value pairs. Data fields are packed into dictionaries with following keys (not all has to be present): `xres', x-resolution (number of samples), `yres', y-resolution (number of samples), `xreal', real x size (in base SI units), `yreal', real y size (in base SI units), `unit-xy', lateral units (base SI, like `m'), `unit-z', value units (base SI, like `m' or `A'), `data', the data field data itself (array of floats). The `data' member is a raw array of floats (please see array module documentation). Exceptions, caused by fatal errors, are not handled -- it is up to caller to eventually handle them.""" line_re = _re.compile(r'^(?P<key>[^=]+)=(?P<val>.*)\n') field_re = _re.compile(r'^(?P<key>[^=]+)=\[\n') fh = file(filename, 'rb') data = {} while True: line = fh.readline() if not line: break m = field_re.match(line) if m: _read_dfield(fh, data, m.group('key')) continue m = line_re.match(line) if m: data[m.group('key')] = m.group('val') continue raise 'Can\'t understand input' fh.close() return data
44776d77de69c849b502946b3d04c28b955b1cee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/44776d77de69c849b502946b3d04c28b955b1cee/dump.py
LIB_HEADERS: this variable, filled from lib_LTLIBRARIES, fooinclude_HEADERS
LIB_HEADERS: install rules, filled from lib_LTLIBRARIES, fooinclude_HEADERS
def expand_template(makefile, name, supplementary=None): """Get expansion of specified template, taking information from Makefile. SELF: defines TOP_SRCDIR, LIBRARY, LIBDIR DATA: install-data rule, created from foo_DATA LIB_HEADERS: this variable, filled from lib_LTLIBRARIES, fooinclude_HEADERS LIB_OBJECTS: this variable, filled from lib_LTLIBRARIES, foo_SOURCES LIB_OBJ_RULES: .c -> .obj rules, filled from lib_LTLIBRARIES, foo_SOURCES PRG_OBJECTS: this variable, filled from bin_PROGRAMS, foo_SOURCES PRG_OBJ_RULES: .c -> .obj rules, filled from bin_PROGRAMS, foo_SOURCES MODULES: this variable, filled from foo_LTLIBRARIES MOD_OBJ_RULES: .c -> .obj rules, filled from foo_LTLIBRARIES, foo_SOURCES MOD_DLL_RULES: .obj -> .dll rules, filled from foo_LTLIBRARIES MO_INSTALL_RULES: installdirs and install-mo rules, filled from LINGUAS""" if name == 'SELF': if srcpath: srcdir = '\\'.join(['..'] * len(srcpath)) s = ['TOP_SRCDIR = ' + srcdir] else: s = ['TOP_SRCDIR = .'] libraries = fix_suffixes(get_list(makefile, 'lib_LTLIBRARIES'), '.la') if libraries: assert len(libraries) == 1 s.append('LIBDIR = ' + srcpath[-1]) l = libraries[0] s.append('LIBRARY = ' + l) return '\n'.join(s) elif name == 'DATA': lst = get_list(makefile, '\w+_DATA') list_part = name + ' =' + format_list(lst) inst_part = [('$(INSTALL) %s "$(DEST_DIR)\$(DATA_TYPE)"' % x) for x in lst] inst_part = '\n\t'.join(['install-data: data'] + inst_part) return list_part + '\n\n' + inst_part elif name == 'LIB_HEADERS': libraries = fix_suffixes(get_list(makefile, 'lib_LTLIBRARIES'), '.la') lst = [] for l in libraries: ul = underscorize(l) lst += get_list(makefile, '%sinclude_HEADERS' % ul) return name + ' =' + format_list(lst) elif name == 'LIB_OBJECTS': libraries = get_list(makefile, 'lib_LTLIBRARIES') lst = [] for l in libraries: ul = underscorize(l) lst += fix_suffixes(get_list(makefile, '%s_SOURCES' % ul), '.c', '.obj') return name + ' =' + format_list(lst) elif name == 'LIB_OBJ_RULES': libraries = get_list(makefile, 'lib_LTLIBRARIES') lst = [] for l in libraries: ul = underscorize(l) for x in fix_suffixes(get_list(makefile, '%s_SOURCES' % ul), '.c'): deps = format_list(get_file_deps(x, ul)) lst.append(object_rule % (x, deps, 'LIB', x)) return '\n'.join(lst) elif name == 'PRG_OBJECTS': programs = get_list(makefile, 'bin_PROGRAMS') lst = [] for p in programs: up = underscorize(p) lst += fix_suffixes(get_list(makefile, '%s_SOURCES' % up), '.c', '.obj') return name + ' =' + format_list(lst) elif name == 'PRG_OBJ_RULES': programs = get_list(makefile, 'bin_PROGRAMS') lst = [] for p in programs: up = underscorize(p) for x in fix_suffixes(get_list(makefile, '%s_SOURCES' % up), '.c'): deps = format_list(get_file_deps(x)) lst.append(object_rule % (x, deps, 'PRG', x)) return '\n'.join(lst) elif name == 'MODULES': mods = get_list(makefile, r'\w+_LTLIBRARIES') mods = expand_make_vars(mods, supplementary) mods = fix_suffixes(fix_suffixes(mods, '.la', '.dll'), ')', ').dll') return name + ' =' + format_list(mods) elif name == 'MOD_OBJ_RULES': mods = get_list(makefile, r'\w+_LTLIBRARIES') mods = expand_make_vars(mods, supplementary) lst = [] for m in mods: um = underscorize(m) for x in get_list(makefile, '%s_SOURCES' % um): # Ignore header files in SOURCES if not x.endswith('.c'): continue x = x[:-2] deps = format_list(get_file_deps(x, um)) lst.append(object_rule % (x, deps, 'MOD', x)) return '\n'.join(lst) elif name == 'MOD_DLL_RULES': mods = get_list(makefile, r'\w+_LTLIBRARIES') mods = expand_make_vars(mods, supplementary) mods = fix_suffixes(mods, '.la') lst = [] for m in mods: lst.append(mod_dll_rule % (m, m, m, m, m)) return '\n'.join(lst) elif name == 'MO_INSTALL_RULES': pos = [l.strip() for l in file('LINGUAS')] pos = [l for l in pos if l and not l.strip().startswith('#')] assert len(pos) == 1 pos = re.split(r'\s+', pos[0]) if not pos: return lst = ['installdirs:', '\t-@mkdir "$(DEST_DIR)\\locale"'] for p in pos: lst.append('\t-@mkdir "$(DEST_DIR)\\locale\\%s"' % p) lst.append('\t-@mkdir "$(DEST_DIR)\\locale\\%s\\LC_MESSAGES"' % p) lst.append('') lst.append('install-mo:') for p in pos: lst.append(mo_inst_rule % (p, p)) return '\n'.join(lst) print 'WARNING: Unknown template %s' % name return ''
0e0d8602beb7590342670c278c2f17f752493061 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/0e0d8602beb7590342670c278c2f17f752493061/update-msvc.py
return name + ' =' + format_list(lst)
list_part = name + ' =' + format_list(lst) inst_part = [('$(INSTALL) %s "$(DEST_DIR)\include\$(LIBDIR)"' % x) for x in lst] inst_part = '\n\t'.join(['install-headers:'] + inst_part) return list_part + '\n\n' + inst_part
def expand_template(makefile, name, supplementary=None): """Get expansion of specified template, taking information from Makefile. SELF: defines TOP_SRCDIR, LIBRARY, LIBDIR DATA: install-data rule, created from foo_DATA LIB_HEADERS: this variable, filled from lib_LTLIBRARIES, fooinclude_HEADERS LIB_OBJECTS: this variable, filled from lib_LTLIBRARIES, foo_SOURCES LIB_OBJ_RULES: .c -> .obj rules, filled from lib_LTLIBRARIES, foo_SOURCES PRG_OBJECTS: this variable, filled from bin_PROGRAMS, foo_SOURCES PRG_OBJ_RULES: .c -> .obj rules, filled from bin_PROGRAMS, foo_SOURCES MODULES: this variable, filled from foo_LTLIBRARIES MOD_OBJ_RULES: .c -> .obj rules, filled from foo_LTLIBRARIES, foo_SOURCES MOD_DLL_RULES: .obj -> .dll rules, filled from foo_LTLIBRARIES MO_INSTALL_RULES: installdirs and install-mo rules, filled from LINGUAS""" if name == 'SELF': if srcpath: srcdir = '\\'.join(['..'] * len(srcpath)) s = ['TOP_SRCDIR = ' + srcdir] else: s = ['TOP_SRCDIR = .'] libraries = fix_suffixes(get_list(makefile, 'lib_LTLIBRARIES'), '.la') if libraries: assert len(libraries) == 1 s.append('LIBDIR = ' + srcpath[-1]) l = libraries[0] s.append('LIBRARY = ' + l) return '\n'.join(s) elif name == 'DATA': lst = get_list(makefile, '\w+_DATA') list_part = name + ' =' + format_list(lst) inst_part = [('$(INSTALL) %s "$(DEST_DIR)\$(DATA_TYPE)"' % x) for x in lst] inst_part = '\n\t'.join(['install-data: data'] + inst_part) return list_part + '\n\n' + inst_part elif name == 'LIB_HEADERS': libraries = fix_suffixes(get_list(makefile, 'lib_LTLIBRARIES'), '.la') lst = [] for l in libraries: ul = underscorize(l) lst += get_list(makefile, '%sinclude_HEADERS' % ul) return name + ' =' + format_list(lst) elif name == 'LIB_OBJECTS': libraries = get_list(makefile, 'lib_LTLIBRARIES') lst = [] for l in libraries: ul = underscorize(l) lst += fix_suffixes(get_list(makefile, '%s_SOURCES' % ul), '.c', '.obj') return name + ' =' + format_list(lst) elif name == 'LIB_OBJ_RULES': libraries = get_list(makefile, 'lib_LTLIBRARIES') lst = [] for l in libraries: ul = underscorize(l) for x in fix_suffixes(get_list(makefile, '%s_SOURCES' % ul), '.c'): deps = format_list(get_file_deps(x, ul)) lst.append(object_rule % (x, deps, 'LIB', x)) return '\n'.join(lst) elif name == 'PRG_OBJECTS': programs = get_list(makefile, 'bin_PROGRAMS') lst = [] for p in programs: up = underscorize(p) lst += fix_suffixes(get_list(makefile, '%s_SOURCES' % up), '.c', '.obj') return name + ' =' + format_list(lst) elif name == 'PRG_OBJ_RULES': programs = get_list(makefile, 'bin_PROGRAMS') lst = [] for p in programs: up = underscorize(p) for x in fix_suffixes(get_list(makefile, '%s_SOURCES' % up), '.c'): deps = format_list(get_file_deps(x)) lst.append(object_rule % (x, deps, 'PRG', x)) return '\n'.join(lst) elif name == 'MODULES': mods = get_list(makefile, r'\w+_LTLIBRARIES') mods = expand_make_vars(mods, supplementary) mods = fix_suffixes(fix_suffixes(mods, '.la', '.dll'), ')', ').dll') return name + ' =' + format_list(mods) elif name == 'MOD_OBJ_RULES': mods = get_list(makefile, r'\w+_LTLIBRARIES') mods = expand_make_vars(mods, supplementary) lst = [] for m in mods: um = underscorize(m) for x in get_list(makefile, '%s_SOURCES' % um): # Ignore header files in SOURCES if not x.endswith('.c'): continue x = x[:-2] deps = format_list(get_file_deps(x, um)) lst.append(object_rule % (x, deps, 'MOD', x)) return '\n'.join(lst) elif name == 'MOD_DLL_RULES': mods = get_list(makefile, r'\w+_LTLIBRARIES') mods = expand_make_vars(mods, supplementary) mods = fix_suffixes(mods, '.la') lst = [] for m in mods: lst.append(mod_dll_rule % (m, m, m, m, m)) return '\n'.join(lst) elif name == 'MO_INSTALL_RULES': pos = [l.strip() for l in file('LINGUAS')] pos = [l for l in pos if l and not l.strip().startswith('#')] assert len(pos) == 1 pos = re.split(r'\s+', pos[0]) if not pos: return lst = ['installdirs:', '\t-@mkdir "$(DEST_DIR)\\locale"'] for p in pos: lst.append('\t-@mkdir "$(DEST_DIR)\\locale\\%s"' % p) lst.append('\t-@mkdir "$(DEST_DIR)\\locale\\%s\\LC_MESSAGES"' % p) lst.append('') lst.append('install-mo:') for p in pos: lst.append(mo_inst_rule % (p, p)) return '\n'.join(lst) print 'WARNING: Unknown template %s' % name return ''
0e0d8602beb7590342670c278c2f17f752493061 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/0e0d8602beb7590342670c278c2f17f752493061/update-msvc.py
re_grp = re.compile(r'&&|<<|>>|->|::|\.\*|->\*|\|\|')
re_grp = re.compile(r'&&|<<|>>|->|::|\.\*|->\*|\|\||\+\+|--|\*\*+|\.\.\.')
def tokenize(lines): "`Parse' a C file returning a sequence of Tokens" re_com = re.compile(r'/\*.*?\*/|//.*') re_mac = re.compile(r'#.*') re_str = re.compile(r'"([^\\"]+|\\"|\\[^"])*"') re_chr = re.compile(r'\'(?:.|\\.|\\[0-7]{3}|\\x[0-9a-f]{2})\'') re_id = re.compile(r'\b[A-Za-z_]\w*\b') # this eats some integers too re_dbl = re.compile(r'\b(\d*\.\d+|\d+\.?)(?:[Ee][-+]?\d+)?[FfLl]?\b') re_int = re.compile(r'\b(?:0[xX][a-fA-F0-9]+|0[0-7]+|[-+]?\d+)[LlUu]*\b') re_eq = re.compile(r'(?:[-+*%/&|!<>=^]|&&|>>|<<|\|\|)?=') re_grp = re.compile(r'&&|<<|>>|->|::|\.\*|->\*|\|\|') re_sin = re.compile(r'[][(){};:?,.+~!%^&*|/^<>]|-') re_tokens = re_com, re_str, re_chr, re_id, re_dbl, re_int, \ re_eq, re_grp, re_sin token_ids = { re_com: 0, re_str: Token.string, re_chr: Token.char, re_id: Token.ident, re_dbl: Token.double, re_int: Token.integer, re_eq: Token.punct, re_grp: Token.punct, re_sin: Token.punct } tokens = [] in_comment = False in_macro = False for i, l in enumerate(lines): l, col = blstrip(l, 0) # special processing when we are inside a multiline comment or macro if in_comment: base = l.find('*/') if base == -1: continue l = l[base+2:] col += base+2 l, col = blstrip(l, col) in_comment = False elif in_macro: in_macro = l.endswith('\\') continue elif l.startswith('#'): if l.endswith('\\'): in_macro = True continue while l: if l.startswith('/*') and l.find('*/') == -1: in_comment = True break for r in re_tokens: m = r.match(l) if m: if token_ids[r]: tokens.append(Token(i, col, token_ids[r], m.group())) col += m.end() l, col = blstrip(l[m.end():], col) break if not m: sys.stderr.write('*** ERROR: Completely ugly code ' + '(trying to sync): %s\n' % l) l = '' # Make tokens a doubly linked list for i, t in enumerate(tokens): if i: t.prec = tokens[i-1] else: t.prec = None try: t.succ = tokens[i+1] except IndexError: t.succ = None return tokens
9b67737d3ecfce51d6a8231cbcb581d5a83a17d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/9b67737d3ecfce51d6a8231cbcb581d5a83a17d8/check-coding-style.py
inst_part = [('$(INSTALL) %s "$(DEST_DIR)\$(DATA_TYPE)"' % x)
inst_part = [('$(INSTALL) %s "$(DEST_DIR)\data\$(DATA_TYPE)"' % x)
def expand_template(makefile, name): if name == 'DATA': lst = get_list(makefile, '\w+_DATA') list_part = name + ' =' + ' \\\n\t'.join([''] + lst) inst_part = [('$(INSTALL) %s "$(DEST_DIR)\$(DATA_TYPE)"' % x) for x in lst] inst_part = '\n\t'.join(['install-data: data'] + inst_part) return list_part + '\n\n' + inst_part elif name == 'LIB_HEADERS': libraries = fix_suffixes(get_list(makefile, 'lib_LTLIBRARIES'), '.la') lst = [] for l in libraries: l = re.sub(r'[^a-z0-9]', '_', l) lst += get_list(makefile, '%sinclude_HEADERS' % l) return name + ' =' + ' \\\n\t'.join([''] + lst) elif name == 'LIB_OBJECTS': libraries = get_list(makefile, 'lib_LTLIBRARIES') lst = [] for l in libraries: l = re.sub(r'[^a-z0-9]', '_', l) lst += fix_suffixes(get_list(makefile, '%s_SOURCES' % l), '.c', '.obj') return name + ' =' + ' \\\n\t'.join([''] + lst) elif name == 'PRG_OBJECTS': programs = get_list(makefile, 'bin_PROGRAMS') lst = [] for p in programs: p = re.sub(r'[^a-z0-9]', '_', p) lst += fix_suffixes(get_list(makefile, '%s_SOURCES' % p), '.c', '.obj') return name + ' =' + ' \\\n\t'.join([''] + lst) elif name == 'PRG_OBJECT_RULES': programs = get_list(makefile, 'bin_PROGRAMS') lst = [] for p in programs: p = re.sub(r'[^a-z0-9]', '_', p) for x in fix_suffixes(get_list(makefile, '%s_SOURCES' % p), '.c'): lst.append(prg_object_rule % (x, x, x)) return '\n'.join(lst) elif name == 'MODULES': mods = fix_suffixes(get_list(makefile, r'\w+_LTLIBRARIES'), '.la', '.dll') return name + ' =' + ' \\\n\t'.join([''] + mods) elif name == 'MOD_DLL_RULES': mods = fix_suffixes(get_list(makefile, r'\w+_LTLIBRARIES'), '.la') lst = [] for m in mods: lst.append(mod_dll_rule % (m, m, m, m, m)) return '\n'.join(lst) elif name == 'MO_INSTALL_RULES': pos = [l.strip() for l in file('LINGUAS')] pos = [l for l in pos if l and not l.strip().startswith('#')] assert len(pos) == 1 pos = re.split('\s+', pos[0]) if not pos: return lst = ['installdirs:', '\t-@mkdir "$(DEST_DIR)\\locale"'] for p in pos: lst.append('\t-@mkdir "$(DEST_DIR)\\locale\\%s"' % p) lst.append('\t-@mkdir "$(DEST_DIR)\\locale\\%s\\LC_MESSAGES"' % p) lst.append('') lst.append('install-mo:') for p in pos: lst.append(mo_inst_rule % (p, p)) return '\n'.join(lst) print '*** Unknown template %s ***' % name return ''
048a56801b8e206dc52da6238be04b05354badd4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/048a56801b8e206dc52da6238be04b05354badd4/update-msvc.py
_python_version = int, sys.version.split()[0].split('.')
_python_version = sys.version.split()[0].split('.')
def DBPRINT(*args): print ' '.join(args)
ccf5e2e16937652728a56b1c71a885c307550196 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/ccf5e2e16937652728a56b1c71a885c307550196/keepalive.py
handlers.append( urllib2.FTPHandler() ) if not (keepalive_handler and self.opts.keepalive):
if not need_keepalive_handler:
def _get_opener(self): """Build a urllib2 OpenerDirector based on request options.""" if self.opts.opener: return self.opts.opener elif self._opener is None: handlers = [] # if you specify a ProxyHandler when creating the opener # it _must_ come before all other handlers in the list or urllib2 # chokes. if self.opts.proxies: handlers.append( CachedProxyHandler(self.opts.proxies) )
7a4c714171c8cd266a5aa1af8b14e14011bb0562 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/7a4c714171c8cd266a5aa1af8b14e14011bb0562/grabber.py
if keepalive_handler and self.opts.keepalive:
if need_keepalive_handler:
def _get_opener(self): """Build a urllib2 OpenerDirector based on request options.""" if self.opts.opener: return self.opts.opener elif self._opener is None: handlers = [] # if you specify a ProxyHandler when creating the opener # it _must_ come before all other handlers in the list or urllib2 # chokes. if self.opts.proxies: handlers.append( CachedProxyHandler(self.opts.proxies) )
7a4c714171c8cd266a5aa1af8b14e14011bb0562 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/7a4c714171c8cd266a5aa1af8b14e14011bb0562/grabber.py
if range_handlers and (self.opts.range or self.opts.reget):
if need_range_handler:
def _get_opener(self): """Build a urllib2 OpenerDirector based on request options.""" if self.opts.opener: return self.opts.opener elif self._opener is None: handlers = [] # if you specify a ProxyHandler when creating the opener # it _must_ come before all other handlers in the list or urllib2 # chokes. if self.opts.proxies: handlers.append( CachedProxyHandler(self.opts.proxies) )
7a4c714171c8cd266a5aa1af8b14e14011bb0562 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/7a4c714171c8cd266a5aa1af8b14e14011bb0562/grabber.py
raise
def setUp(self): self.url = ref_proftp try: fo = urllib2.urlopen(self.url).close() except IOError: raise self.skip()
6b80397f4d26966456bc76b5324a66e77c3d1a19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/6b80397f4d26966456bc76b5324a66e77c3d1a19/test_grabber.py
Return a string of the form "bytes=<firstbyte>-<lastbyte>".
Return a string of the form "bytes=<firstbyte>-<lastbyte>" or None if no range is needed.
def range_tuple_to_header(range_tup): """Convert a range tuple to a Range header value. Return a string of the form "bytes=<firstbyte>-<lastbyte>". """ if range_tup is None: return None range_tup = range_tuple_normalize(range_tup) if range_tup: if range_tup[1]: range_tup = (range_tup[0],range_tup[1] - 1) return 'bytes=%s-%s' % range_tup
d2dd668a8e9da91fbcdf0c34c467b3871a777850 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/d2dd668a8e9da91fbcdf0c34c467b3871a777850/byterange.py
return 'bytes=%s-%s' % range_tup
return 'bytes=%s-%s' % range_tup
def range_tuple_to_header(range_tup): """Convert a range tuple to a Range header value. Return a string of the form "bytes=<firstbyte>-<lastbyte>". """ if range_tup is None: return None range_tup = range_tuple_normalize(range_tup) if range_tup: if range_tup[1]: range_tup = (range_tup[0],range_tup[1] - 1) return 'bytes=%s-%s' % range_tup
d2dd668a8e9da91fbcdf0c34c467b3871a777850 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/d2dd668a8e9da91fbcdf0c34c467b3871a777850/byterange.py
filename = os.path.basename( path )
if scheme in [ 'http', 'https' ]: filename = os.path.basename( urllib.unquote(path) ) else: filename = os.path.basename( path )
def urlgrab(self, url, filename=None, **kwargs): """grab the file at <url> and make a local copy at <filename> If filename is none, the basename of the url is used. urlgrab returns the filename of the local file, which may be different from the passed-in filename if copy_local == 0. """ opts = self.opts.derive(**kwargs) (url, parts) = self._parse_url(url) (scheme, host, path, parm, query, frag) = parts if filename is None: filename = os.path.basename( path ) if scheme == 'file' and not opts.copy_local: # just return the name of the local file - don't make a # copy currently if not os.path.exists(path): raise URLGrabError(2, _('Local file does not exist: %s') % (path, )) elif not os.path.isfile(path): raise URLGrabError(3, _('Not a normal file: %s') % (path, )) elif not opts.range: return path def retryfunc(opts, url, filename): fo = URLGrabberFileObject(url, filename, opts) try: fo._do_grab() if not opts.checkfunc is None: cb_func, cb_args, cb_kwargs = \ self._make_callback(opts.checkfunc) obj = CallbackObject() obj.filename = filename obj.url = url apply(cb_func, (obj, )+cb_args, cb_kwargs) finally: fo.close() return filename return self._retry(opts, retryfunc, url, filename)
c6fc52157f46b898a640ab5d5128b0c9318b537f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/c6fc52157f46b898a640ab5d5128b0c9318b537f/grabber.py
except socket.error:
except socket.error, e:
def _fill_buffer(self, amt=None): """fill the buffer to contain at least 'amt' bytes by reading from the underlying file object. If amt is None, then it will read until it gets nothing more. It updates the progress meter and throttles after every self._rbufsize bytes.""" # the _rbuf test is only in this first 'if' for speed. It's not # logically necessary if self._rbuf and not amt is None: L = len(self._rbuf) if amt > L: amt = amt - L else: return
6974b2ddaf5904a5f8c8e5c2ad029da50ad15802 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/6974b2ddaf5904a5f8c8e5c2ad029da50ad15802/grabber.py
if isinstance(e.reason, TimeoutError):
if hasattr(e, 'reason') and isinstance(e.reason, TimeoutError):
def _make_request(self, req, opener): try: if have_socket_timeout and self.opts.timeout: old_to = socket.getdefaulttimeout() socket.setdefaulttimeout(self.opts.timeout) try: fo = opener.open(req) finally: socket.setdefaulttimeout(old_to) else: fo = opener.open(req) hdr = fo.info() except ValueError, e: raise URLGrabError(1, _('Bad URL: %s') % (e, )) except RangeError, e: raise URLGrabError(9, _('%s') % (e, )) except IOError, e: if isinstance(e.reason, TimeoutError): raise URLGrabError(12, _('Timeout: %s') % (e, )) else: raise URLGrabError(4, _('IOError: %s') % (e, )) except OSError, e: raise URLGrabError(5, _('OSError: %s') % (e, )) except HTTPException, e: raise URLGrabError(7, _('HTTP Error (%s): %s') % \ (e.__class__.__name__, e)) else: return (fo, hdr)
e72da0c35662052b1fb9a267bd324e8aa3e1c9d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/e72da0c35662052b1fb9a267bd324e8aa3e1c9d1/grabber.py
user_password, host = string.split(host, '@', 1) user, password = string.split(user_password, ':', 1)
user_password, host = urllib2.splituser(host) user, password = urllib2.splitpasswd(user_password)
def _parse_url(self,url): """break up the url into its component parts
c9767596434c912bbef6db309496791e8476fe5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/c9767596434c912bbef6db309496791e8476fe5a/grabber.py
self.cache_openers = True
def _set_defaults(self): """Set all options to their default values. When adding new options, make sure a default is provided here. """ self.progress_obj = None self.throttle = 1.0 self.bandwidth = 0 self.retry = None self.retrycodes = [-1,2,4,5,6,7] self.checkfunc = None self.copy_local = 0 self.close_connection = 0 self.range = None self.user_agent = 'urlgrabber/%s' % __version__ self.keepalive = 1 self.proxies = None self.reget = None self.failure_callback = None self.prefix = None self.opener = None
ff9e21d416dc5939b4d44c8c750100b1086d4d4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/ff9e21d416dc5939b4d44c8c750100b1086d4d4e/grabber.py
self._opener = urllib2.build_opener(*handlers)
if self.opts.cache_openers: self._opener = CachedOpenerDirector(*handlers) else: self._opener = urllib2.build_opener(*handlers)
def _get_opener(self): """Build a urllib2 OpenerDirector based on request options.""" if self.opts.opener: return self.opts.opener elif self._opener is None: handlers = [] # if you specify a ProxyHandler when creating the opener # it _must_ come before all other handlers in the list or urllib2 # chokes. if self.opts.proxies: handlers.append( CachedProxyHandler(self.opts.proxies) ) if keepalive_handler and self.opts.keepalive: handlers.append( keepalive_handler ) if range_handlers and (self.opts.range or self.opts.reget): handlers.extend( range_handlers ) handlers.append( auth_handler ) # Temporarily disabling this because it doesn't yet work # correctly. Some reget tests fail. I really don't understand # why, but some of the error handlers aren't set correctly. #self._opener = CachedOpenerDirector(*handlers) self._opener = urllib2.build_opener(*handlers) # OK, I don't like to do this, but otherwise, we end up with # TWO user-agent headers. self._opener.addheaders = [] return self._opener
ff9e21d416dc5939b4d44c8c750100b1086d4d4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/ff9e21d416dc5939b4d44c8c750100b1086d4d4e/grabber.py
def retryfunc(opts, url, filename): fo = URLGrabberFileObject(url, filename, opts) try: fo._do_grab() if not opts.checkfunc is None: if callable(opts.checkfunc): func, args, kwargs = opts.checkfunc, (), {} else: func, args, kwargs = opts.checkfunc apply(func, (filename, )+args, kwargs) finally: fo.close() return filename
4137d8c4f50d8684734882135d48bcabe31bd2e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/4137d8c4f50d8684734882135d48bcabe31bd2e1/grabber.py
s = fo.read(limit)
if limit is None: s = fo.read() else: s = fo.read(limit)
def retryfunc(opts, url, limit): fo = URLGrabberFileObject(url, filename=None, opts=opts) s = '' try: s = fo.read(limit) if not opts.checkfunc is None: if callable(opts.checkfunc): func, args, kwargs = opts.checkfunc, (), {} else: func, args, kwargs = opts.checkfunc apply(func, (s, )+args, kwargs) finally: fo.close() return s
4137d8c4f50d8684734882135d48bcabe31bd2e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/4137d8c4f50d8684734882135d48bcabe31bd2e1/grabber.py
if p.endswith('/') or url.startswith('/'): url = p + url
if p[-1] == '/' or url[0] == '/': url = p + url
def _parse_url(self,url): """break up the url into its component parts
4137d8c4f50d8684734882135d48bcabe31bd2e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/4137d8c4f50d8684734882135d48bcabe31bd2e1/grabber.py
raise URLError('file not on local host')
raise urllib2.URLError('file not on local host')
def open_local_file(self, req): import mimetypes import mimetools host = req.get_host() file = req.get_selector() localfile = urllib.url2pathname(file) stats = os.stat(localfile) size = stats[stat.ST_SIZE] modified = rfc822.formatdate(stats[stat.ST_MTIME]) mtype = mimetypes.guess_type(file)[0] if host: host, port = urllib.splitport(host) if port or socket.gethostbyname(host) not in self.get_names(): raise URLError('file not on local host') fo = open(localfile,'rb') brange = req.headers.get('Range',None) brange = range_header_to_tuple(brange) assert brange != () if brange: (fb,lb) = brange if lb == '': lb = size if fb < 0 or fb > size or lb > size: raise RangeError('Requested Range Not Satisfiable') size = (lb - fb) fo = RangeableFileObject(fo, (fb,lb)) headers = mimetools.Message(StringIO( 'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' % (mtype or 'text/plain', size, modified))) return urllib.addinfourl(fo, headers, 'file:'+file)
910f95a098f1a90682e47d55fc5c2b6a80026f06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/910f95a098f1a90682e47d55fc5c2b6a80026f06/byterange.py
raise URLError(msg)
raise urllib2.URLError(msg)
def ftp_open(self, req): host = req.get_host() if not host: raise IOError, ('ftp error', 'no host given') host, port = splitport(host) if port is None: port = ftplib.FTP_PORT
910f95a098f1a90682e47d55fc5c2b6a80026f06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/910f95a098f1a90682e47d55fc5c2b6a80026f06/byterange.py
user_password, host = user_pass, host = host.split('@', 1)
user_pass, host = host.split('@', 1)
def _parse_url(self,url): """break up the url into its component parts
70274e677ad597849ac7442a34fd48a7d40a2d32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/70274e677ad597849ac7442a34fd48a7d40a2d32/grabber.py
self._opener = CachedOpenerDirector(*handlers)
self._opener = urllib2.build_opener(*handlers) self._opener.addheaders = []
def _get_opener(self): """Build a urllib2 OpenerDirector based on request options.""" if self._opener is None: handlers = [] # if you specify a ProxyHandler when creating the opener # it _must_ come before all other handlers in the list or urllib2 # chokes. if self.opts.proxies: handlers.append( CachedProxyHandler(self.opts.proxies) ) if keepalive_handler and self.opts.keepalive: handlers.append( keepalive_handler ) if range_handlers and (self.opts.range or self.opts.reget): handlers.extend( range_handlers ) handlers.append( auth_handler ) self._opener = CachedOpenerDirector(*handlers) return self._opener
f8e09d44bf6d99154cb2e13ba3803e9ac22a7adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/f8e09d44bf6d99154cb2e13ba3803e9ac22a7adc/grabber.py
return self.parent.error('http', req, r, r.status, r.reason, r.msg)
return self.parent.error('http', req, r, r.status, r.msg, r.headers)
def do_open(self, http_class, req): host = req.get_host() if not host: raise urllib2.URLError('no host given')
481fa18e5223136b5a882a755e68fec724cbabb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/481fa18e5223136b5a882a755e68fec724cbabb7/keepalive.py
return self.msg
return self.headers
def info(self): return self.msg
481fa18e5223136b5a882a755e68fec724cbabb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/481fa18e5223136b5a882a755e68fec724cbabb7/keepalive.py
{'increment': 0,
{'increment': 0,
def _(st): return st
f696723c2d26f554cc641be0d28757f1ea18bc64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/f696723c2d26f554cc641be0d28757f1ea18bc64/mirror.py
'fail': 0}
'fail': 0}
def _(st): return st
f696723c2d26f554cc641be0d28757f1ea18bc64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/f696723c2d26f554cc641be0d28757f1ea18bc64/mirror.py
tuple, it is enterpreted to be of the form (cb, args, kwargs)
tuple, it is interpreted to be of the form (cb, args, kwargs)
def _(st): return st
f696723c2d26f554cc641be0d28757f1ea18bc64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/f696723c2d26f554cc641be0d28757f1ea18bc64/mirror.py
itself. The callback will be passed exception that was raised (and args and kwargs if present).
itself. The callback will be passed the exception that was raised (and args and kwargs if present).
def _(st): return st
f696723c2d26f554cc641be0d28757f1ea18bc64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/f696723c2d26f554cc641be0d28757f1ea18bc64/mirror.py
y = (x)
y = (x,)
def testIdentity(self): # test to make sure that objects retain identity properly x = [] y = (x) x.append(y) x.append(y) self.assertIdentical(x[0], x[1]) self.assertIdentical(x[0][0], x) d = self.encode(x) d.addCallback(self.shouldDecode) d.addCallback(self._testIdentity_1) return d
47312db05ee43a480d55b1a4af6e32f87018da3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13646/47312db05ee43a480d55b1a4af6e32f87018da3b/test_banana.py
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
faces = { 'times': 'Times', 'mono' : 'Courier', 'helv' : 'Helvetica', 'other': 'new century schoolbook', 'size' : 12, 'size2': 10, }
faces = { 'times': 'Times', 'mono' : 'Courier', 'helv' : 'Helvetica', 'other': 'new century schoolbook', 'size' : 10, 'size2': 8, }
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
def __init__ (self,parent): wx.TextCtrl.__init__(self,parent,style = wx.TE_MULTILINE | wx.TE_RICH2 | wx.TE_READONLY) self.Bind(wx.EVT_CHAR, self.OnChar)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
self.SetLexer(wx.stc.STC_LEX_PYTHON) self.SetKeyWords(0, " ".join(keyword.kwlist))
self.SetLexer(wx.stc.STC_LEX_CPP) self.SetKeyWords(0, " ".join(SC3_KEYWORDS))
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
self.SetMargins(0,0)
self.SetMargins(1,0)
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
self.StyleSetSpec(stc.STC_STYLE_LINENUMBER, "back:
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
self.StyleSetSpec(stc.STC_P_DEFAULT, "fore:
self.StyleSetSpec(stc.STC_C_DEFAULT, "fore:
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
self.StyleSetSpec(stc.STC_P_COMMENTLINE, "fore:
self.StyleSetSpec(stc.STC_C_COMMENTLINE, "fore:
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
self.StyleSetSpec(stc.STC_P_NUMBER, "fore:
self.StyleSetSpec(stc.STC_C_NUMBER, "bold,fore:
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
self.StyleSetSpec(stc.STC_P_STRING, "fore:
self.StyleSetSpec(stc.STC_C_STRING, "italic,fore:
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
self.StyleSetSpec(stc.STC_P_CHARACTER, "fore:
self.StyleSetSpec(stc.STC_C_CHARACTER, "fore:
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
self.StyleSetSpec(stc.STC_P_WORD, "fore: self.StyleSetSpec(stc.STC_P_TRIPLE, "fore: self.StyleSetSpec(stc.STC_P_TRIPLEDOUBLE, "fore: self.StyleSetSpec(stc.STC_P_CLASSNAME, "fore: self.StyleSetSpec(stc.STC_P_DEFNAME, "fore:
self.StyleSetSpec(stc.STC_C_WORD, "fore:
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
self.StyleSetSpec(stc.STC_P_OPERATOR, "bold,size:%(size)d" % faces)
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
self.StyleSetSpec(stc.STC_P_IDENTIFIER, "fore: self.StyleSetSpec(stc.STC_P_COMMENTBLOCK, "fore:
self.StyleSetSpec(stc.STC_C_IDENTIFIER, "fore:
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
self.StyleSetSpec(stc.STC_P_STRINGEOL, "fore:
self.StyleSetSpec(stc.STC_C_STRINGEOL, "fore:
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
def OnKeyPressed(self, event): if self.CallTipActive(): self.CallTipCancel() key = event.KeyCode()
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
if charBefore and chr(charBefore) in "[]{}()" and styleBefore == stc.STC_P_OPERATOR:
if charBefore and chr(charBefore) in "[]{}()" and styleBefore == stc.STC_C_OPERATOR:
def OnUpdateUI(self, evt): # check for matching braces braceAtCaret = -1 braceOpposite = -1 charBefore = None caretPos = self.GetCurrentPos()
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
if charAfter and chr(charAfter) in "[]{}()" and styleAfter == stc.STC_P_OPERATOR:
if charAfter and chr(charAfter) in "[]{}()" and styleAfter == stc.STC_C_OPERATOR:
def OnUpdateUI(self, evt): # check for matching braces braceAtCaret = -1 braceOpposite = -1 charBefore = None caretPos = self.GetCurrentPos()
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
def OnCloseCodeWin(self,evt): activeWin = self.GetActiveChild( ) if activeWin == None: wx.MessageBox("ERROR : No document is active") elif not activeWin == self.logWin: if self.IsAllowedToCloseWindow(activeWin): activeWin.Destroy();
def OnOpenFile(self,evt): fileDlg = wx.FileDialog(self,style=wx.OPEN) if fileDlg.ShowModal( ) == wx.ID_OK: path = fileDlg.GetPath() self.OpenFile(path)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
self.OnSaveFileInWin(self,evt,activeWin)
self.OnSaveFileInWin(evt,activeWin)
def OnSaveFile(self,evt): activeWin = self.GetActiveChild( ); self.OnSaveFileInWin(self,evt,activeWin)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
def OnSaveFileInWin(self,evt,activeWin): if activeWin == None: # TODO : disable menu items dynamically instead wx.MessageBox("ERROR : No document is active") else: #fileDlg = wx.FileDialog(self,style=wx.SAVE) path = activeWin.originalFilePath if path == "": self.OnSaveFileAsInWin(evt,activeWin) else: file = open(path ,"w" ) content = activeWin.codeSubWin.GetText() file.write(content) file.close()
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
sel = string.strip(str(activeChild.GetSelectedText()))
if not activeChild == self.logWin: sel = string.strip(str(activeChild.GetSelectedText())) else : sel = ""
def GoToHelpFile(self): # TODO : test this : most help files don't open. remove trailing and leading spaces from sel, too, since wxTextCtrl is behaving strangely activeChild = self.GetActiveChild() sel = string.strip(str(activeChild.GetSelectedText())) foundFilePath = "" filePath = "" if sel != "": for helpFolder in [gAppHelpFolder,gHelpFolder]: for folderPath, foldersInPath, fileNamesInFolder in os.walk(helpFolder): # don't visit CVS directories if 'CVS' in foldersInPath: foldersInPath.remove('CVS') for fileName in fileNamesInFolder: filePath = os.path.join(folderPath, fileName) if fileName == sel + ".help.rtf": foundFilePath = filePath break if fileName == sel + ".rtf": foundFilePath = filePath break # for fileName # if file is found, let's break if foundFilePath != "": break # for folderPath, .... # if file is found, let's break if foundFilePath != "": break if foundFilePath == "": foundFilePath = os.path.join(gAppHelpFolder,"Help.help.rtf") self.OpenFile(foundFilePath)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
for helpFolder in [gAppHelpFolder,gHelpFolder]:
for helpFolder in [gHelpFolder]:
def GoToHelpFile(self): # TODO : test this : most help files don't open. remove trailing and leading spaces from sel, too, since wxTextCtrl is behaving strangely activeChild = self.GetActiveChild() sel = string.strip(str(activeChild.GetSelectedText())) foundFilePath = "" filePath = "" if sel != "": for helpFolder in [gAppHelpFolder,gHelpFolder]: for folderPath, foldersInPath, fileNamesInFolder in os.walk(helpFolder): # don't visit CVS directories if 'CVS' in foldersInPath: foldersInPath.remove('CVS') for fileName in fileNamesInFolder: filePath = os.path.join(folderPath, fileName) if fileName == sel + ".help.rtf": foundFilePath = filePath break if fileName == sel + ".rtf": foundFilePath = filePath break # for fileName # if file is found, let's break if foundFilePath != "": break # for folderPath, .... # if file is found, let's break if foundFilePath != "": break if foundFilePath == "": foundFilePath = os.path.join(gAppHelpFolder,"Help.help.rtf") self.OpenFile(foundFilePath)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
foundFilePath = os.path.join(gAppHelpFolder,"Help.help.rtf")
foundFilePath = os.path.join(gHelpFolder,"Help.help.rtf")
def GoToHelpFile(self): # TODO : test this : most help files don't open. remove trailing and leading spaces from sel, too, since wxTextCtrl is behaving strangely activeChild = self.GetActiveChild() sel = string.strip(str(activeChild.GetSelectedText())) foundFilePath = "" filePath = "" if sel != "": for helpFolder in [gAppHelpFolder,gHelpFolder]: for folderPath, foldersInPath, fileNamesInFolder in os.walk(helpFolder): # don't visit CVS directories if 'CVS' in foldersInPath: foldersInPath.remove('CVS') for fileName in fileNamesInFolder: filePath = os.path.join(folderPath, fileName) if fileName == sel + ".help.rtf": foundFilePath = filePath break if fileName == sel + ".rtf": foundFilePath = filePath break # for fileName # if file is found, let's break if foundFilePath != "": break # for folderPath, .... # if file is found, let's break if foundFilePath != "": break if foundFilePath == "": foundFilePath = os.path.join(gAppHelpFolder,"Help.help.rtf") self.OpenFile(foundFilePath)
50c444321a077c149eeb7545d767e753034d7fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/50c444321a077c149eeb7545d767e753034d7fb8/Psycollider.py
gHelpFolder = 'Help'
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
834d09fc9dfde3f24de1676683d68b32b2d08451 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/834d09fc9dfde3f24de1676683d68b32b2d08451/Psycollider.py
gHelpFolder = 'Help' gUserExtensionFolder = '~\\SuperCollider\\Extensions'
gHelpFolder = 'Help' gUserExtensionFolder = '~\\SuperCollider\\Extensions'
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
834d09fc9dfde3f24de1676683d68b32b2d08451 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/834d09fc9dfde3f24de1676683d68b32b2d08451/Psycollider.py
import PySCLang, os, string, keyword, sys
import wx.html as html import PySCLang import os, string, keyword, sys
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
a80838c2381f3fc8cfc375d205893d1fbbe163d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/a80838c2381f3fc8cfc375d205893d1fbbe163d0/Psycollider.py
ID_CloseCodeWin = wx.NewId()
ID_CloseCodeWin = wx.NewId()
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
a80838c2381f3fc8cfc375d205893d1fbbe163d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/a80838c2381f3fc8cfc375d205893d1fbbe163d0/Psycollider.py
ID_AccelF2 = wx.NewId() ID_AccelF2 = wx.NewId() ID_AccelF3 = wx.NewId() ID_AccelF4 = wx.NewId() ID_AccelF5 = wx.NewId() ID_AccelF6 = wx.NewId() ID_AccelF7 = wx.NewId() ID_AccelF8 = wx.NewId() ID_AccelF9 = wx.NewId() ID_AccelF10 = wx.NewId() ID_AccelF11 = wx.NewId() ID_AccelF12 = wx.NewId()
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
a80838c2381f3fc8cfc375d205893d1fbbe163d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/a80838c2381f3fc8cfc375d205893d1fbbe163d0/Psycollider.py
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
a80838c2381f3fc8cfc375d205893d1fbbe163d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/a80838c2381f3fc8cfc375d205893d1fbbe163d0/Psycollider.py
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
a80838c2381f3fc8cfc375d205893d1fbbe163d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/a80838c2381f3fc8cfc375d205893d1fbbe163d0/Psycollider.py
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
a80838c2381f3fc8cfc375d205893d1fbbe163d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/a80838c2381f3fc8cfc375d205893d1fbbe163d0/Psycollider.py
self.SetEdgeMode(stc.STC_EDGE_BACKGROUND) self.SetEdgeColumn(78)
self.SetUseAntiAliasing(True)
def __init__ (self,parent): wx.stc.StyledTextCtrl.__init__(self,parent) font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, "Courier New") self.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font) self.Bind(wx.EVT_CHAR, self.OnChar) self.SetModEventMask(wx.stc.STC_MOD_INSERTTEXT | wx.stc.STC_MOD_DELETETEXT | wx.stc.STC_PERFORMED_USER) self.Bind(wx.stc.EVT_STC_CHANGE, self.OnStcChange) self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN) self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
a80838c2381f3fc8cfc375d205893d1fbbe163d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/a80838c2381f3fc8cfc375d205893d1fbbe163d0/Psycollider.py
def FoldAll(self): lineCount = self.GetLineCount() expanding = True
a80838c2381f3fc8cfc375d205893d1fbbe163d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/a80838c2381f3fc8cfc375d205893d1fbbe163d0/Psycollider.py
menu2 = wx.Menu() menu2.Append(ID_AccelF2, "Simulate\tF&2") menu2.Append(ID_AccelF3, "Simulate\tF&3") menu2.Append(ID_AccelF4, "Simulate\tF&4") menu2.Append(ID_AccelF5, "Simulate\tF&5") menu2.Append(ID_AccelF6, "Simulate\tF&6") menu2.Append(ID_AccelF7, "Simulate\tF&7") menu2.Append(ID_AccelF8, "Simulate\tF&8") menu2.Append(ID_AccelF9, "Simulate\tF&9") menu2.Append(ID_AccelF10, "Simulate\tF10") menu2.Append(ID_AccelF11, "Simulate\tF11") menu2.Append(ID_AccelF12, "Simulate\tF12")
def __init__ (self,parent,ID,title,pos=wx.DefaultPosition,size=wx.DefaultSize, style = wx.DEFAULT_FRAME_STYLE | wx.VSCROLL | wx.HSCROLL, name = "frame"): wx.MDIParentFrame.__init__(self,parent,ID,title,pos,size,style) self.winCount = 0
a80838c2381f3fc8cfc375d205893d1fbbe163d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/a80838c2381f3fc8cfc375d205893d1fbbe163d0/Psycollider.py