Skip to content

Commit 0507550

Browse files
Merge pull request #781 from hugapi/jtyler/black-style
black style reformat (with 100 line length)
2 parents 84e4f51 + d2228b7 commit 0507550

File tree

112 files changed

+3812
-2797
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+3812
-2797
lines changed

benchmarks/http/bobo_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import bobo
22

33

4-
@bobo.query('/text', content_type='text/plain')
4+
@bobo.query("/text", content_type="text/plain")
55
def text():
6-
return 'Hello, world!'
6+
return "Hello, world!"
77

88

99
app = bobo.Application(bobo_resources=__name__)

benchmarks/http/bottle_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
app = bottle.Bottle()
44

55

6-
@app.route('/text')
6+
@app.route("/text")
77
def text():
8-
return 'Hello, world!'
8+
return "Hello, world!"

benchmarks/http/cherrypy_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33

44
class Root(object):
5-
65
@cherrypy.expose
76
def text(self):
8-
return 'Hello, world!'
7+
return "Hello, world!"
98

109

1110
app = cherrypy.tree.mount(Root())

benchmarks/http/falcon_test.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33

44
class Resource(object):
5-
65
def on_get(self, req, resp):
76
resp.status = falcon.HTTP_200
8-
resp.content_type = 'text/plain'
9-
resp.body = 'Hello, world!'
7+
resp.content_type = "text/plain"
8+
resp.body = "Hello, world!"
109

1110

1211
app = falcon.API()
13-
app.add_route('/text', Resource())
12+
app.add_route("/text", Resource())

benchmarks/http/flask_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
app = flask.Flask(__name__)
44

55

6-
@app.route('/text')
6+
@app.route("/text")
77
def text():
8-
return 'Hello, world!'
8+
return "Hello, world!"

benchmarks/http/hug_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import hug
22

33

4-
@hug.get('/text', output_format=hug.output_format.text, parse_body=False)
4+
@hug.get("/text", output_format=hug.output_format.text, parse_body=False)
55
def text():
6-
return 'Hello, World!'
6+
return "Hello, World!"
77

88

99
app = hug.API(__name__).http.server()

benchmarks/http/muffin_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import muffin
22

3-
app = muffin.Application('web')
3+
app = muffin.Application("web")
44

55

6-
@app.register('/text')
6+
@app.register("/text")
77
def text(request):
8-
return 'Hello, World!'
8+
return "Hello, World!"

benchmarks/http/pyramid_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
from pyramid.config import Configurator
33

44

5-
@view_config(route_name='text', renderer='string')
5+
@view_config(route_name="text", renderer="string")
66
def text(request):
7-
return 'Hello, World!'
7+
return "Hello, World!"
88

99

1010
config = Configurator()
1111

12-
config.add_route('text', '/text')
12+
config.add_route("text", "/text")
1313

1414
config.scan()
1515
app = config.make_wsgi_app()

benchmarks/http/tornado_test.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66

77
class TextHandler(tornado.web.RequestHandler):
88
def get(self):
9-
self.write('Hello, world!')
9+
self.write("Hello, world!")
1010

1111

12-
application = tornado.web.Application([
13-
(r"/text", TextHandler),
14-
])
12+
application = tornado.web.Application([(r"/text", TextHandler)])
1513

1614
if __name__ == "__main__":
1715
application.listen(8000)

benchmarks/internal/argument_populating.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
from hug.decorators import auto_kwargs
44
from hug.introspect import generate_accepted_kwargs
55

6-
DATA = {'request': None}
6+
DATA = {"request": None}
77

88

99
class Timer(object):
10-
1110
def __init__(self, name):
1211
self.name = name
1312

@@ -26,25 +25,25 @@ def my_method_with_kwargs(name, request=None, **kwargs):
2625
pass
2726

2827

29-
with Timer('generate_kwargs'):
30-
accept_kwargs = generate_accepted_kwargs(my_method, ('request', 'response', 'version'))
28+
with Timer("generate_kwargs"):
29+
accept_kwargs = generate_accepted_kwargs(my_method, ("request", "response", "version"))
3130

3231
for test in range(100000):
3332
my_method(test, **accept_kwargs(DATA))
3433

3534

36-
with Timer('auto_kwargs'):
35+
with Timer("auto_kwargs"):
3736
wrapped_method = auto_kwargs(my_method)
3837

3938
for test in range(100000):
4039
wrapped_method(test, **DATA)
4140

4241

43-
with Timer('native_kwargs'):
42+
with Timer("native_kwargs"):
4443
for test in range(100000):
4544
my_method_with_kwargs(test, **DATA)
4645

4746

48-
with Timer('no_kwargs'):
47+
with Timer("no_kwargs"):
4948
for test in range(100000):
5049
my_method(test, request=None)

0 commit comments

Comments
 (0)