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' warn...
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...
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...
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.li...
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.li...
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 ...
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 ...
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 ...
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 ==...
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 ==...
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 ==...
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 ==...
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 ==...
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 ==...
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 ==...
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 ==...
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...
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...
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 ...
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 ...
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 ...
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...
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...
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 ...
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 = l...
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 = l...
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 ...
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.li...
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 th...
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', dfi...
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 s...
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 varia...
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 varia...
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 ...
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 ...
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.pr...
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.pr...
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.pr...
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=...
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=...
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...
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' fo...
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 URLGrabErr...
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 s...
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.pr...
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 filena...
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() r...
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 = url...
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...
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_...
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_...
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_...
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_...
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_...
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_...
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_...
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_...
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_...
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_...
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_...
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_...
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_...
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_...
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 ,...
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 [g...
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 [g...
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 [g...
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_...
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.Ap...
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