Package coprs :: Package views :: Package apiv3_ns :: Module apiv3_mock_chroots
[hide private]
[frames] | no frames]

Source Code for Module coprs.views.apiv3_ns.apiv3_mock_chroots

 1  import flask 
 2  from html2text import html2text 
 3  from coprs.views.apiv3_ns import apiv3_ns 
 4  from coprs.logic.coprs_logic import MockChrootsLogic 
5 6 7 @apiv3_ns.route("/mock-chroots/list") 8 -def list_chroots():
9 chroots = MockChrootsLogic.active_names_with_comments() 10 response = {} 11 for chroot, comment in chroots: 12 if comment: 13 response[chroot] = html2text(comment).strip("\n") 14 else: 15 response[chroot] = "" 16 17 return flask.jsonify(response)
18