)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"ea1da8933333f0b0c5620f6fbdffbb123c14540b","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"1) Create a lock with a default blocking value that will be used by this"},{"line_number":17,"context_line":"object in all acquire operations (if there is no override)"},{"line_number":18,"context_line":"    lock \u003d FileLock(path, 10.0)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"2) Pass a default blocking value to the get_lock method that will be"},{"line_number":21,"context_line":"used by returned lock in all acquire operations (if there is no"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9a41bdd9_20cecd83","line":18,"updated":"2015-07-17 14:53:53.000000000","message":"Sounds like something an app could def a function for if it needs consistency.","commit_id":"2b36d990a2ed5a5efb0a9c4a08dd653a07396bed"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"ea1da8933333f0b0c5620f6fbdffbb123c14540b","unresolved":false,"context_lines":[{"line_number":21,"context_line":"used by returned lock in all acquire operations (if there is no"},{"line_number":22,"context_line":"override)"},{"line_number":23,"context_line":"    coord.get_lock(name, False)"},{"line_number":24,"context_line":"    coord.get_lock(name, 10.0)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"2) Create a context manager with a specific blocking value that"},{"line_number":27,"context_line":"overrides default blocking value and will not be used in any other"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9a41bdd9_a0b97dee","line":24,"updated":"2015-07-17 14:53:53.000000000","message":"That sounds like a lambda/closure problem?","commit_id":"2b36d990a2ed5a5efb0a9c4a08dd653a07396bed"}],"tooz/locking.py":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"4fc4f8f80eecd576d2b06d1930fb1af178d3a6e7","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from tooz import coordination"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"class LockProxy(object):"},{"line_number":26,"context_line":"    def __init__(self, lock, blocking\u003dTrue):"},{"line_number":27,"context_line":"        self.lock \u003d lock"},{"line_number":28,"context_line":"        self.blocking \u003d blocking"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_85ffca00","line":25,"updated":"2015-08-04 04:23:01.000000000","message":"Perhaps also name this:\n\n  class _LockProxy(object):\n\nThat way it\u0027s obvious nobody should be touching this from outside tooz.","commit_id":"dabe38f5585bd2abfc3e9aa4f2eb6a721128af64"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"8403ecaa4dbe031a05c64ddda4a4797cd6e12c6a","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from tooz import coordination"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"class LockProxy(object):"},{"line_number":26,"context_line":"    def __init__(self, lock, blocking\u003dTrue):"},{"line_number":27,"context_line":"        self.lock \u003d lock"},{"line_number":28,"context_line":"        self.blocking \u003d blocking"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_f496194b","line":25,"in_reply_to":"1a4dcd0f_85ffca00","updated":"2015-08-11 15:21:38.000000000","message":"Done","commit_id":"dabe38f5585bd2abfc3e9aa4f2eb6a721128af64"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"97a0f7db74752a63ee239662ed95cc9fb134fa73","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        self.blocking \u003d blocking"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def __enter__(self):"},{"line_number":31,"context_line":"        self.lock.__enter__(self.blocking)"},{"line_number":32,"context_line":"        return self"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def __exit__(self, exc_type, exc_val, exc_tb):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_9b97f539","line":31,"updated":"2015-07-31 14:11:52.000000000","message":"I think you need to return that rather than self otherwise:\n\nwith mylock(True) as x:\n    x.release()\n\nwould fail AFAIU.\n\n(and you may want to add a test to prove that works? :)","commit_id":"dabe38f5585bd2abfc3e9aa4f2eb6a721128af64"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"8403ecaa4dbe031a05c64ddda4a4797cd6e12c6a","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        self.blocking \u003d blocking"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def __enter__(self):"},{"line_number":31,"context_line":"        self.lock.__enter__(self.blocking)"},{"line_number":32,"context_line":"        return self"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def __exit__(self, exc_type, exc_val, exc_tb):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_3457a15b","line":31,"in_reply_to":"3a50d1a3_9b97f539","updated":"2015-08-11 15:21:38.000000000","message":"Yes, it should work as you say.","commit_id":"dabe38f5585bd2abfc3e9aa4f2eb6a721128af64"}]}
