bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
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...
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 if t.prec.line == t.line and t.prec.end == t.col: w = 'Missing space before `%s\' (col %d): %s' warnings.append((t....
6,000
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...
def check_singlular_opening_braces(tokens, lines, warnings): "Check for inappropriate { on a separate line" for t in 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 se...
6,001
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...
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 if t.line > t.prec.line and t.prec.typ == Token.punct \ and t.prec.string == ')': w = 'Opening brace on a s...
6,002
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...
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 t in 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 =...
6,003
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...
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 if t.succ.line == t.line and t.end == t...
6,004
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 ...
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 try: succ = tokens[i+1] except IndexError: break if succ.line == t.line: w = 'More than one statement on a line (col %d): %s' warni...
6,005
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 ...
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 if t.succ.line == t.line: w = 'More than one statement on a line (col %d): %s' warnings.append((t.line, w % (succ.col...
6,006
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 ...
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 ...
6,007
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 ==...
def check_oneliners(tokens, lines, warnings): "Check for if, else, statements on the same line." for t in 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 a...
6,008
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 ==...
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 = t.succ if succ.typ == Token.punct and succ.string == '{': succ = tokens[i+2] if succ.line > t.line: continue if succ.typ == Toke...
6,009
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 ==...
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 = succ.succ if succ.line > t.line: continue if succ.typ == T...
6,010
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 ==...
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 ==...
6,011
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 ==...
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 ==...
6,012
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 ==...
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 ==...
6,013
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 ==...
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 ==...
6,014
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 ==...
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 ==...
6,015
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...
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 t in tokens: if t...
6,016
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...
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...
6,017
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 ...
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 t in tokens: if t.bracelevel == 0: continue if t.typ != Token.punct or t.string !=...
6,018
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 ...
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 ...
6,019
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 ...
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 ...
6,020
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...
def check_return_case_parentheses(tokens, lines, warnings): keywlist = 'return', 'case', 'goto' keywords = dict([(x, 1) for x in keywlist]) for t in 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)' war...
6,021
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...
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 t.prec.string not in keywords: continue if t.matching.succ.typ != Token.punct or t.matching.s...
6,022
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 ...
def check_boolean_comparisons(tokens, lines, warnings): keywlist = 'TRUE', 'FALSE' keywords = dict([(x, 1) for x in keywlist]) 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 != '=='): continue w = 'Comparison to TRUE or FALSE (col ...
6,023
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...
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 p.matching = t t.parenlevel = len(stack...
6,024
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...
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...
6,025
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 ...
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 ...
6,026
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...
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 and t.succ.line == t.line: w = 'More than one statement on a line (col %d): %s' warnings.append((t.line, w % (t.succ.col,...
6,027
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...
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...
6,028
command -nargs=+ HiLink hi def link <args>
command -nargs=+ HiLink hi def link <args>
6,029
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...
def _read_dfield(fh, data, base): c = fh.read(1) if not c: return False if c != '[': fh.seek(-1, 1) return False 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, 'y...
6,030
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...
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...
6,031
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...
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: install rules, filled from lib_LTLIBRARIES, fooinclude_HEADERS LIB_OBJECTS: this varia...
6,032
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...
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...
6,033
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 ...
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 ...
6,034
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 ...
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\$(DATA_TYPE)"' % x) for x in lst] inst_part = '\n\t'.join(['install-data: data'] + inst_part) return list_part + '\n\n' + inst_...
6,035
def DBPRINT(*args): print ' '.join(args)
def DBPRINT(*args): print ' '.join(args)
6,036
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...
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...
6,037
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...
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...
6,038
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...
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...
6,039
def setUp(self): self.url = ref_proftp try: fo = urllib2.urlopen(self.url).close() except IOError: raise self.skip()
def setUp(self): self.url = ref_proftp try: fo = urllib2.urlopen(self.url).close() except IOError: self.skip()
6,040
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=...
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>" or None if no range is needed. """ 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],ra...
6,041
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=...
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=...
6,042
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...
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...
6,043
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...
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...
6,044
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...
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...
6,045
def _parse_url(self,url): """break up the url into its component parts
def _parse_url(self,url): """break up the url into its component parts
6,046
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...
defself.cache_openers = True _set_defaults(self):self.cache_openers = True """Setself.cache_openers = True allself.cache_openers = True optionsself.cache_openers = True toself.cache_openers = True theirself.cache_openers = True defaultself.cache_openers = True values.self.cache_openers = True Whenself.cache_op...
6,047
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...
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...
6,048
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...
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...
6,049
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...
def retryfunc(opts, url, limit): fo = URLGrabberFileObject(url, filename=None, opts=opts) s = '' try: if limit is None: s = fo.read() else: 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(fun...
6,050
def _parse_url(self,url): """break up the url into its component parts
def _parse_url(self,url): """break up the url into its component parts
6,051
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...
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...
6,052
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
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
6,053
def _parse_url(self,url): """break up the url into its component parts
def _parse_url(self,url): """break up the url into its component parts
6,054
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...
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...
6,055
def do_open(self, http_class, req): host = req.get_host() if not host: raise urllib2.URLError('no host given')
def do_open(self, http_class, req): host = req.get_host() if not host: raise urllib2.URLError('no host given')
6,056
def info(self): return self.msg
def info(self): return self.msg
6,057
def _(st): return st
def _(st): return st
6,058
def _(st): return st
def _(st): return st
6,059
def _(st): return st
def _(st): return st
6,060
def _(st): return st
def _(st): return st
6,061
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
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
6,062
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
#TODO:selection"Object-Method"andchoosingalt+jwillopentheclassdeffileforTHATmethod
6,063
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
6,064
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)
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)
6,065
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_...
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_...
6,066
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_...
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_...
6,067
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_...
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_...
6,068
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_...
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_...
6,069
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_...
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_...
6,070
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_...
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_...
6,071
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_...
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_...
6,072
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_...
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_...
6,073
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_...
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_...
6,074
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_...
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_...
6,075
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_...
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_...
6,076
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_...
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_...
6,077
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_...
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_...
6,078
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_...
def__init__(self,parent):wx.stc.StyledTextCtrl.__init__(self,parent)font=wx.Font(10,wx.MODERN,wx.NORMAL,wx.NORMAL,False,"CourierNew")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.B...
6,079
def OnKeyPressed(self, event): if self.CallTipActive(): self.CallTipCancel() key = event.KeyCode()
defOnKeyPressed(self,event):ifself.CallTipActive():self.CallTipCancel()key=event.KeyCode()
6,080
def OnUpdateUI(self, evt): # check for matching braces braceAtCaret = -1 braceOpposite = -1 charBefore = None caretPos = self.GetCurrentPos()
def OnUpdateUI(self, evt): # check for matching braces braceAtCaret = -1 braceOpposite = -1 charBefore = None caretPos = self.GetCurrentPos()
6,081
def OnUpdateUI(self, evt): # check for matching braces braceAtCaret = -1 braceOpposite = -1 charBefore = None caretPos = self.GetCurrentPos()
def OnUpdateUI(self, evt): # check for matching braces braceAtCaret = -1 braceOpposite = -1 charBefore = None caretPos = self.GetCurrentPos()
6,082
def OnOpenFile(self,evt): fileDlg = wx.FileDialog(self,style=wx.OPEN) if fileDlg.ShowModal( ) == wx.ID_OK: path = fileDlg.GetPath() self.OpenFile(path)
def 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(); OnOpenFile(self,evt): def OnCloseCodeWin(self,evt): activeWin = self.GetActiveChi...
6,083
def OnSaveFile(self,evt): activeWin = self.GetActiveChild( ); self.OnSaveFileInWin(self,evt,activeWin)
def OnSaveFile(self,evt): activeWin = self.GetActiveChild( ); self.OnSaveFileInWin(self,evt,activeWin)
6,084
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 ,...
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 ,...
6,085
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...
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() if not activeChild == self.logWin: sel = string.strip(str(activeChild.GetSelectedText())) else : sel = "" foundFilePath = ...
6,086
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...
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...
6,087
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...
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...
6,088
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
6,089
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
6,090
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
6,091
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
6,092
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
6,093
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
#TODO:selection"Object-Method"andchoosingalt+jwillopentheclassdeffileforTHATmethod
6,094
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
6,095
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
# TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method
6,096
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_...
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_...
6,097
def FoldAll(self): lineCount = self.GetLineCount() expanding = True
defFoldAll(self):lineCount=self.GetLineCount()expanding=True
6,098
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
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
6,099