)]}'
{"keystone/common/sql/core.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"53a1d1f19df097fac56ba6bbfa1c0cead7ce71a2","unresolved":false,"context_lines":[{"line_number":102,"context_line":"    GLOBAL_ENGINE \u003d engine"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    for cb in GLOBAL_ENGINE_CALLBACKS:"},{"line_number":105,"context_line":"        cb()"},{"line_number":106,"context_line":"    GLOBAL_ENGINE_CALLBACKS \u003d []"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2F6c8%3D","line":105,"updated":"2013-05-20 13:59:20.000000000","message":"What is \u0027cb()\u0027 calling into?","commit_id":"d0491e5dd93517cad66cdb4f614825eb44970d0d"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"cc7b520c8391c9139e196a044ea5f4403c19ae22","unresolved":false,"context_lines":[{"line_number":102,"context_line":"    GLOBAL_ENGINE \u003d engine"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    for cb in GLOBAL_ENGINE_CALLBACKS:"},{"line_number":105,"context_line":"        cb()"},{"line_number":106,"context_line":"    GLOBAL_ENGINE_CALLBACKS \u003d []"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2F3NA%3D","line":105,"in_reply_to":"AAAAPH%2F%2F5KY%3D","updated":"2013-05-21 13:54:52.000000000","message":"That\u0027s a good question. At first glance and seeing \u0027cb()\u0027 I start looking for that somewhere else in the file to see what it does and if anything else uses it. I think a comment here should be sufficient in saying \u0027cb() calls into whatever  function/functor was registered on register_engine_callback\u0027. That way others will know where it is coming from. It might be somewhat elementary but it could help readability in the future for someone else.","commit_id":"d0491e5dd93517cad66cdb4f614825eb44970d0d"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"ba53fe1d89fc4a65abf05610e8642ff9590db58a","unresolved":false,"context_lines":[{"line_number":102,"context_line":"    GLOBAL_ENGINE \u003d engine"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    for cb in GLOBAL_ENGINE_CALLBACKS:"},{"line_number":105,"context_line":"        cb()"},{"line_number":106,"context_line":"    GLOBAL_ENGINE_CALLBACKS \u003d []"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2F5KY%3D","line":105,"in_reply_to":"AAAAPH%2F%2F6c8%3D","updated":"2013-05-20 20:43:18.000000000","message":"It\u0027s calling whatever function/functor was registered on register_engine_callback. Should I add a comment? And if so, what should it say?","commit_id":"d0491e5dd93517cad66cdb4f614825eb44970d0d"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"586498c8fbbe719ee9ebf5c1458d3f7678f47428","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"# maintain a single engine reference for sqlalchemy engine"},{"line_number":38,"context_line":"GLOBAL_ENGINE \u003d None"},{"line_number":39,"context_line":"GLOBAL_ENGINE_CALLBACKS \u003d []"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"ModelBase \u003d declarative.declarative_base()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2FtEU%3D","line":39,"updated":"2013-05-24 22:40:44.000000000","message":"this could be a set, but that only protects the caller from themselves","commit_id":"3cee486ef2feb9b99bf28b332af819b94bd7aadb"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"669f8802adc234d465915cd6d5f017ea2e7e328c","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"# maintain a single engine reference for sqlalchemy engine"},{"line_number":38,"context_line":"GLOBAL_ENGINE \u003d None"},{"line_number":39,"context_line":"GLOBAL_ENGINE_CALLBACKS \u003d []"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"ModelBase \u003d declarative.declarative_base()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2FjUE%3D","line":39,"in_reply_to":"AAAAPH%2F%2FtEU%3D","updated":"2013-05-30 17:56:17.000000000","message":"it\u0027s a little more explicit to use a set, so I changed it in the next patch set.","commit_id":"3cee486ef2feb9b99bf28b332af819b94bd7aadb"},{"author":{"_account_id":1916,"name":"Guang Yee","email":"gyee@suse.com","username":"guang-yee"},"change_message_id":"87e84ee7d97f22258260a3e11f0f2b170788b9bb","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":"ModelBase.__init__ \u003d initialize_decorator(ModelBase.__init__)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"def set_global_engine(engine):"},{"line_number":99,"context_line":"    global GLOBAL_ENGINE"},{"line_number":100,"context_line":"    global GLOBAL_ENGINE_CALLBACKS"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2FwVY%3D","line":97,"updated":"2013-06-22 00:54:14.000000000","message":"May want to document the callback mechanism here so user understand that the callback is called only once when the engine changes. Also, they\u0027ll need to re-register for a new engine callback.","commit_id":"80be4bb20128ae3ad1c29366ee87fb1ba5650156"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"38e48f0a4016e9841229163969602ff09be149d6","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":"ModelBase.__init__ \u003d initialize_decorator(ModelBase.__init__)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"def set_global_engine(engine):"},{"line_number":99,"context_line":"    global GLOBAL_ENGINE"},{"line_number":100,"context_line":"    global GLOBAL_ENGINE_CALLBACKS"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2FmoA%3D","line":97,"in_reply_to":"AAAAPn%2F%2FwVY%3D","updated":"2013-06-26 22:31:42.000000000","message":"Done. Wrote some docstrings.","commit_id":"80be4bb20128ae3ad1c29366ee87fb1ba5650156"},{"author":{"_account_id":1916,"name":"Guang Yee","email":"gyee@suse.com","username":"guang-yee"},"change_message_id":"87e84ee7d97f22258260a3e11f0f2b170788b9bb","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"def set_global_engine(engine):"},{"line_number":99,"context_line":"    global GLOBAL_ENGINE"},{"line_number":100,"context_line":"    global GLOBAL_ENGINE_CALLBACKS"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    GLOBAL_ENGINE \u003d engine"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2FwVU%3D","line":100,"updated":"2013-06-22 00:54:14.000000000","message":"if GLOBLAL_ENGINE !\u003d engine:\n\nwhat if someone calls this with the same engine?","commit_id":"80be4bb20128ae3ad1c29366ee87fb1ba5650156"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"38e48f0a4016e9841229163969602ff09be149d6","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"def set_global_engine(engine):"},{"line_number":99,"context_line":"    global GLOBAL_ENGINE"},{"line_number":100,"context_line":"    global GLOBAL_ENGINE_CALLBACKS"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    GLOBAL_ENGINE \u003d engine"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2Fmns%3D","line":100,"in_reply_to":"AAAAPn%2F%2FwVU%3D","updated":"2013-06-26 22:31:42.000000000","message":"Done. Added a unit test to show that it now doesn\u0027t call the callbacks if the engine is the same.","commit_id":"80be4bb20128ae3ad1c29366ee87fb1ba5650156"},{"author":{"_account_id":1916,"name":"Guang Yee","email":"gyee@suse.com","username":"guang-yee"},"change_message_id":"87e84ee7d97f22258260a3e11f0f2b170788b9bb","unresolved":false,"context_lines":[{"line_number":104,"context_line":"    cbs \u003d GLOBAL_ENGINE_CALLBACKS"},{"line_number":105,"context_line":"    GLOBAL_ENGINE_CALLBACKS \u003d set()"},{"line_number":106,"context_line":"    for cb in cbs:"},{"line_number":107,"context_line":"        cb()"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"def register_global_engine_callback(cb_fn):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2FwWM%3D","line":107,"updated":"2013-06-22 00:54:14.000000000","message":"may want to do a try-except here in case a callback don\u0027t play nice","commit_id":"80be4bb20128ae3ad1c29366ee87fb1ba5650156"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"38e48f0a4016e9841229163969602ff09be149d6","unresolved":false,"context_lines":[{"line_number":104,"context_line":"    cbs \u003d GLOBAL_ENGINE_CALLBACKS"},{"line_number":105,"context_line":"    GLOBAL_ENGINE_CALLBACKS \u003d set()"},{"line_number":106,"context_line":"    for cb in cbs:"},{"line_number":107,"context_line":"        cb()"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"def register_global_engine_callback(cb_fn):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2Fmg0%3D","line":107,"in_reply_to":"AAAAPn%2F%2FwWM%3D","updated":"2013-06-26 22:31:42.000000000","message":"Done. Added a unit test to show that if the callback function raises then it\u0027s ignored.","commit_id":"80be4bb20128ae3ad1c29366ee87fb1ba5650156"}]}
