43 if start[1] > end_col and not (
44 over_indent == 4 and indent_next):
45 return(0, "E121 continuation line over-"
46 "indented for visual indent")
49 print "OK", ("visual",
52 print "Okay", ("visual",
78 # Aligned with opening delimiter
79 foo = long_function_name(var_one, var_two,
83 # Extra indentation is not necessary.
84 foo = long_function_name(
137 def long_function_name(
138 var_one, var_two, var_three,
142 if ((row < 0 or self.moduleCount <= row or
143 col < 0 or self.moduleCount <= col)):
144 raise Exception("%s,%s - %s" % (row, col, self.moduleCount))
176 "visual indentation is not a multiple of four",)
181 start, 'E121 lines starting with a '
182 'closing bracket should be indented '
183 "to match that of the opening "
187 # you want vertical alignment, so use a parens
188 if ((foo.bar("baz") and
193 # also ok, but starting to look like LISP
194 if ((foo.bar("baz") and
208 if length > options.max_line_length:
209 return options.max_line_length, \
210 "E501 line too long (%d characters)" % length
216 print 'l.{line}\t{pos}\t{name}\t{text}'.format(
219 name=tokenize.tok_name[token[0]],
223 print('%-7d %s per second (%d total)' % (
224 options.counters[key] / elapsed, key,
225 options.counters[key]))
228 if os.path.exists(os.path.join(path, PEP8_BIN)):
229 cmd = ([os.path.join(path, PEP8_BIN)] +
230 self._pep8_options(targetfile))
233 fixed = (re.sub(r'\t+', ' ', target[c::-1], 1)[::-1] +
237 re.sub(r'\t+', ' ', target[c::-1], 1)[::-1] +
242 if foo is None and bar is "frop" and \
247 """This is a multi-line
252 # is this actually readable? :)
253 multiline_literal = """
258 multiline_literal = (
265 multiline_literal = (
276 multiline_visual = ("""
285 rv.update(dict.fromkeys((
286 'qualif_nr', 'reasonComment_en', 'reasonComment_fr',
287 'reasonComment_de', 'reasonComment_it'), '?'))
289 rv.update(dict.fromkeys(('qualif_nr', 'reasonComment_en',
290 'reasonComment_fr', 'reasonComment_de',
291 'reasonComment_it'), '?'))
293 rv.update(dict.fromkeys(('qualif_nr', 'reasonComment_en', 'reasonComment_fr',
294 'reasonComment_de', 'reasonComment_it'), '?'))
297 rv.update(dict.fromkeys(
298 ('qualif_nr', 'reasonComment_en', 'reasonComment_fr',
299 'reasonComment_de', 'reasonComment_it'), '?'
301 'alpha': 4, 'beta': 53242234, 'gamma': 17,
307 'qualif_nr', 'reasonComment_en', 'reasonComment_fr',
308 'reasonComment_de', 'reasonComment_it'), '?'),
311 'alpha': 4, 'beta': 53242234, 'gamma': 17,
319 event_obj.write(cursor, user_id, {
325 event_obj.write(cursor, user_id, {
328 'data': {'aaa': 1, 'bbb': 2},
331 event_obj.write(cursor, user_id, {
339 event_obj.write(cursor, user_id, {
342 'data': {'timestamp': now, 'content': {
349 def qualify_by_address(
350 self, cr, uid, ids, context=None,
351 params_to_check=frozenset(QUALIF_BY_ADDRESS_PARAM)):
352 """ This gets called by the web server """
355 def qualify_by_address(self, cr, uid, ids, context=None,
356 params_to_check=frozenset(QUALIF_BY_ADDRESS_PARAM)):
357 """ This gets called by the web server """
360 _ipv4_re = re.compile('^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.'
361 '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.'
362 '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.'
363 '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$')
367 AAA """ + status_2_string)
375 username: "%(username)s"
394 """Convert the characters &<>'" in string s to HTML-safe sequences.
395 Convert newline to <br> too."""
396 return unicode((s or '').replace('&', '&')
397 .replace('>', '>')
398 .replace('<', '<')
399 .replace("'", ''')
400 .replace('"', '"')
401 .replace('\n', '<br>\n'))
404 parser.add_option('--count', action='store_true',
405 help="print total number of errors and warnings "
406 "to standard error and set exit code to 1 if "
409 parser.add_option('--exclude', metavar='patterns', default=DEFAULT_EXCLUDE,
410 help="exclude files or directories which match these "
411 "comma separated patterns (default: %s)" %
414 add_option('--count',
415 help="print total number of errors "
416 "to standard error total is not null")
418 add_option('--count',
419 help="print total number of errors "
427 help = ("print total number of errors " +
430 help = "print total number of errors " \
433 help = u"print total number of errors " \
436 help = ur"print total number of errors " \
437 ur"to standard error"
439 help = b"print total number of errors " \
442 help = br"print total number of errors " \
443 br"to standard error"
445 d = dict('foo', help="exclude files or directories which match these "
446 "comma separated patterns (default: %s)" %
449 d = dict('foo', help=u"exclude files or directories which match these "
450 u"comma separated patterns (default: %s)" %
453 d = dict('foo', help=b"exclude files or directories which match these "
454 b"comma separated patterns (default: %s)" %
457 d = dict('foo', help=br"exclude files or directories which match these "
458 br"comma separated patterns (default: %s)" %
462 help="exclude files or directories which match these "
463 "comma separated patterns (default: %s)" %
467 help="exclude files or directories which match these "
468 "comma separated patterns (default: %s, %s)" %
469 (DEFAULT_EXCLUDE, DEFAULT_IGNORE)
473 help="exclude files or directories which match these "
474 "comma separated patterns (default: %s, %s)" %
475 # who knows what might happen here?
476 (DEFAULT_EXCLUDE, DEFAULT_IGNORE)
479 # parens used to allow the indenting.
482 "long": ("the quick brown fox jumps over the lazy dog before doing a "
484 "long key that tends to happen more when you're indented": (
485 "stringwithalongtoken you don't want to break"
489 # another accepted form
492 "long": "the quick brown fox jumps over the lazy dog before doing "
494 ("long key that tends to happen more "
495 "when you're indented"): "stringwithalongtoken you don't want to break",
497 # confusing but accepted... don't do that
500 "long": "the quick brown fox jumps over the lazy dog before doing a "
502 "long key that tends to happen more "
503 "when you're indented": "stringwithalongtoken you don't want to break",
508 help="exclude files or directories which match these "
509 "comma separated patterns (default: %s)" %
513 help="exclude files or directories which match these "
514 "comma separated patterns (default: %s)" % DEFAULT_EXCLUDE,
515 foobar="this clearly should work, because it is at "
516 "the right indent level",
519 rv.update(dict.fromkeys(
520 ('qualif_nr', 'reasonComment_en', 'reasonComment_fr',
521 'reasonComment_de', 'reasonComment_it'),
523 context={'alpha': 4, 'beta': 53242234, 'gamma': 17})
530 If you would like to see debugging output,
541 12, # this is a multi-line inline
558 result = some_function_that_takes_arguments(
563 result = some_function_that_takes_arguments('a', 'b', 'c',
593 def example_issue254():
597 # First, look at all the node's current children.
598 for child in node.children
600 for replacement in replace(child)
602 dict(name=token.undefined)
607 return [node.copy(properties=dict(
608 (key, val if val is not None else token.undefined)
609 for key, val in node.items()
614 return [node.copy(properties=dict(
615 (key, val if val is not None else token.undefined)
616 for key, val in node.items()
623 # issue 144, finally!
625 "long key that tends to happen more when you're indented":
626 "stringwithalongtoken you don't want to break",
639 mv ./build/ ./{build}/%(revision)s/