Skip to content

Commit

Permalink
Make flake8 happy
Browse files Browse the repository at this point in the history
  • Loading branch information
wbond committed Jun 4, 2019
1 parent 71f13d1 commit fdc5691
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions pybars/_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ def add_partial(self, symbol, arguments):
positional_args = 0
if arguments:
for argument in arguments:
kwmatch = re.match('(\w+)=(.+)$', argument)
kwmatch = re.match(r'(\w+)=(.+)$', argument)
if kwmatch:
if not overrides:
overrides = {}
Expand Down Expand Up @@ -788,10 +788,10 @@ def _extract_word(self, source, position):
:return:
The word
"""
boundry = re.search('{{|{|\s|$', source[:position][::-1])
boundry = re.search(r'{{|{|\s|$', source[:position][::-1])
start_offset = boundry.end() if boundry.group(0).startswith('{') else boundry.start()

boundry = re.search('}}|}|\s|$', source[position:])
boundry = re.search(r'}}|}|\s|$', source[position:])
end_offset = boundry.end() if boundry.group(0).startswith('}') else boundry.start()

return source[position - start_offset:position + end_offset]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# E128 continuation line under-indented for visual indent
# E131 continuation line unaligned for hanging indent
# E123 closing bracket does not match indentation of opening bracket's line
ignore = E123, E128, E131
ignore = E123, E128, E131, W503

exclude = libs
max-line-length = 160
Expand Down
14 changes: 7 additions & 7 deletions tests/test_acceptance.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,9 +724,9 @@ def test_parent_lookup(self):
def test_helper_with_complex_lookup(self):

def link(this, prefix):
return (u"<a href='" + prefix + u"/" +
this.get('url') + u"'>" +
this.get('text') + u"</a>")
return (u"<a href='" + prefix + u"/"
+ this.get('url') + u"'>"
+ this.get('text') + u"</a>")

helpers = {'link': link}

Expand Down Expand Up @@ -1056,8 +1056,8 @@ def test_nested_block_helpers(self):

def link(this, options):
return (
"<a href='" + this['name'] + "'>" +
str_class(options['fn'](this)) + "</a>")
"<a href='" + this['name'] + "'>"
+ str_class(options['fn'](this)) + "</a>")

def form(this, options, context):
return "<form>" + str_class(options['fn'](context)) + "</form>"
Expand Down Expand Up @@ -1510,8 +1510,8 @@ def hello(this, param, times, bool1, bool2):
self.assertEqual(True, bool1)
self.assertEqual(False, bool2)
self.assertEqual(12, times)
return ("Hello " + param + " " + str_class(times) + " times: " +
str_class(bool1) + " " + str_class(bool2))
return ("Hello " + param + " " + str_class(times) + " times: "
+ str_class(bool1) + " " + str_class(bool2))

helpers = {'hello': hello}

Expand Down

0 comments on commit fdc5691

Please sign in to comment.