
from __future__ import absolute_import

from flask import Blueprint, jsonify

from me_api.configs import Config


me = Blueprint('me', __name__)


@me.route('/')
def index():
    routers = []
    for module in Config.modules['modules'].values():
        routers.append(module['path'])
    return jsonify(me=Config.me, routers=routers)


from __future__ import absolute_import

from flask import Blueprint, jsonify

from me_api.configs import Config


me = Blueprint('me', __name__)


@me.route('/')
def index():
    routers = [module_config['path'] for module_config in
               Config.modules['modules'].values()]
    return jsonify(me=Config.me, routers=routers)

Improve the way that get all the routers
Improve the way that get all the routers

  
  from __future__ import absolute_import
  
  from flask import Blueprint, jsonify
  
  from me_api.configs import Config
  
  
  me = Blueprint('me', __name__)
  
  
  @me.route('/')
  def index():
-     routers = []
+     routers = [module_config['path'] for module_config in
-     for module in Config.modules['modules'].values():
+                Config.modules['modules'].values()]
-         routers.append(module['path'])
      return jsonify(me=Config.me, routers=routers)
  
Improve the way that get all the routers
## Code Before:

from __future__ import absolute_import

from flask import Blueprint, jsonify

from me_api.configs import Config


me = Blueprint('me', __name__)


@me.route('/')
def index():
    routers = []
    for module in Config.modules['modules'].values():
        routers.append(module['path'])
    return jsonify(me=Config.me, routers=routers)

## Instruction:
Improve the way that get all the routers
## Code After:

from __future__ import absolute_import

from flask import Blueprint, jsonify

from me_api.configs import Config


me = Blueprint('me', __name__)


@me.route('/')
def index():
    routers = [module_config['path'] for module_config in
               Config.modules['modules'].values()]
    return jsonify(me=Config.me, routers=routers)
