From a1589e75358558eada7ffc2efc7e3fa7160d233e Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Mon, 25 Sep 2017 13:50:49 +0200 Subject: Reformat codebase and fix spelling errors --- opendc/api/v1/simulations/endpoint.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'opendc/api/v1/simulations/endpoint.py') diff --git a/opendc/api/v1/simulations/endpoint.py b/opendc/api/v1/simulations/endpoint.py index ff669290..a8637728 100644 --- a/opendc/api/v1/simulations/endpoint.py +++ b/opendc/api/v1/simulations/endpoint.py @@ -9,6 +9,7 @@ from opendc.models.user import User from opendc.util import database, exceptions from opendc.util.rest import Response + def POST(request): """Create a new simulation, and return that new simulation.""" @@ -16,7 +17,7 @@ def POST(request): try: request.check_required_parameters( - body = { + body={ 'simulation': { 'name': 'string' } @@ -42,9 +43,9 @@ def POST(request): # Instantiate an Authorization and insert it into the database authorization = Authorization( - user_id = User.from_google_id(request.google_id).id, - simulation_id = simulation.id, - authorization_level = 'OWN' + user_id=User.from_google_id(request.google_id).id, + simulation_id=simulation.id, + authorization_level='OWN' ) authorization.insert() @@ -52,8 +53,8 @@ def POST(request): # Instantiate a Path and insert it into the database path = Path( - simulation_id = simulation.id, - datetime_created = database.datetime_to_string(datetime.now()) + simulation_id=simulation.id, + datetime_created=database.datetime_to_string(datetime.now()) ) path.insert() @@ -61,8 +62,8 @@ def POST(request): # Instantiate a Datacenter and insert it into the database datacenter = Datacenter( - starred = 0, - simulation_id = simulation.id + starred=0, + simulation_id=simulation.id ) datacenter.insert() @@ -70,9 +71,9 @@ def POST(request): # Instantiate a Section and insert it into the database section = Section( - path_id = path.id, - datacenter_id = datacenter.id, - start_tick = 0 + path_id=path.id, + datacenter_id=datacenter.id, + start_tick=0 ) section.insert() -- cgit v1.2.3