)]}'
{"horizon/utils/filters.py":[{"author":{"_account_id":8984,"name":"George Peristerakis","email":"gperiste@redhat.com","username":"peristeri"},"change_message_id":"4e727269525fdd510017ad5de166d9df9cdb2fd5","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    if isinstance(dt, datetime.datetime) or isinstance(dt, datetime.date):"},{"line_number":54,"context_line":"        return timesince(dt)"},{"line_number":55,"context_line":"    else:"},{"line_number":56,"context_line":"        return default"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"@register.filter"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2BuRc%3D","line":56,"updated":"2014-03-24 20:26:51.000000000","message":"I was wandering if this snippet would be clearer:\n\ntry:\n    return timesince(dt)\nexcept AttributeError:\n    return default if default else _(\"Never\")","commit_id":"74265c81e270e3c09743d8f7fe563384592c3919"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"489dcd5a4df5f5b5bcf0941678534d15cc13c35e","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    if isinstance(dt, datetime.datetime) or isinstance(dt, datetime.date):"},{"line_number":54,"context_line":"        return timesince(dt)"},{"line_number":55,"context_line":"    else:"},{"line_number":56,"context_line":"        return default"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"@register.filter"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2Bgmk%3D","line":56,"in_reply_to":"AAAAWH%2F%2BlkY%3D","updated":"2014-03-26 10:15:24.000000000","message":"After thinking about it more, I would prefer to keep the type check here in order to keep control over when to return the default string. Relying on the AttributeError is relying on an implementation detail of the Django method, not a guaranteed API. They may change their timesince implementation to handle unexpected output more gracefully in the future.","commit_id":"74265c81e270e3c09743d8f7fe563384592c3919"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"11a1835fadfceca61546ae3b93a184f2d33ffd74","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    if isinstance(dt, datetime.datetime) or isinstance(dt, datetime.date):"},{"line_number":54,"context_line":"        return timesince(dt)"},{"line_number":55,"context_line":"    else:"},{"line_number":56,"context_line":"        return default"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"@register.filter"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2BlkY%3D","line":56,"in_reply_to":"AAAAWH%2F%2BuRc%3D","updated":"2014-03-25 18:26:06.000000000","message":"+1, we should avoid explicit type checking when possible.","commit_id":"74265c81e270e3c09743d8f7fe563384592c3919"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"06104ccf5b1b1480a5c8d328e80b73058142deda","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    if isinstance(dt, datetime.datetime) or isinstance(dt, datetime.date):"},{"line_number":51,"context_line":"        return timesince(dt)"},{"line_number":52,"context_line":"    else:"},{"line_number":53,"context_line":"        return default if default else _(\"Never\")"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"@register.filter"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2BgNk%3D","line":53,"updated":"2014-03-26 11:11:34.000000000","message":"How about this:\n\n default \u003d default or _(\"Never\")\n\n try:\n     return timesince(dt) or default\n except AttributeError:\n     return default\n\nIt will still work if the timesince implementation is changed to handle invalid input more gracefully (returning None, or empty string, etc, instead of raising an exception). It can only break if a different exception than AttributeError is raised.\n\nNot insisting on it though, so if you want to keep type checking go ahead. In that case, it is sufficient to check for datetime.date, since datetime.datetime is a subclass of datetime.date (and isinstance() handles inheritance).","commit_id":"9951dbd0e4a02f953409d391f70ac6545b54bdc6"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"3a0dfcb6c356b90a6f7cedc3ea085a15100ca713","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    if isinstance(dt, datetime.datetime) or isinstance(dt, datetime.date):"},{"line_number":51,"context_line":"        return timesince(dt)"},{"line_number":52,"context_line":"    else:"},{"line_number":53,"context_line":"        return default if default else _(\"Never\")"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"@register.filter"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2Bf84%3D","line":53,"in_reply_to":"AAAAWH%2F%2BgNk%3D","updated":"2014-03-26 11:40:40.000000000","message":"Thanks for the subclass information, I\u0027ll update accordingly! Timesince isn\u0027t explicitly returning the AttributeError so I\u0027d really prefer not to rely on it.","commit_id":"9951dbd0e4a02f953409d391f70ac6545b54bdc6"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"4e532f780f8c5b516aa98664591a6288b5bb554b","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    When *default* is None, \"Never\" is returned."},{"line_number":49,"context_line":"    \"\"\""},{"line_number":50,"context_line":"    if default is None:"},{"line_number":51,"context_line":"        default \u003d _(\"Never\")"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    if isinstance(dt, datetime.date):"},{"line_number":54,"context_line":"        return timesince(dt)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAWH%2F%2BNkg%3D","line":51,"updated":"2014-03-28 11:39:59.000000000","message":"A single word is sometimes difficult to translate, but I understand there is no general default phrase for this case. I commented in heat code.","commit_id":"ff7049432b7ea50e7e4e10a3de697661a3b91c67"}],"openstack_dashboard/dashboards/project/stacks/templates/stacks/_detail_overview.html":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"4e532f780f8c5b516aa98664591a6288b5bb554b","unresolved":false,"context_lines":[{"line_number":20,"context_line":"  \u003chr class\u003d\"header_rule\"\u003e"},{"line_number":21,"context_line":"  \u003cdl\u003e"},{"line_number":22,"context_line":"    \u003cdt\u003e{% trans \"Created\" %}\u003c/dt\u003e"},{"line_number":23,"context_line":"    \u003cdd\u003e{{ stack.creation_time|parse_isotime|timesince_or_never }}\u003c/dd\u003e"},{"line_number":24,"context_line":"    \u003cdt\u003e{% trans \"Last Updated\" %}\u003c/dt\u003e"},{"line_number":25,"context_line":"    \u003cdd\u003e{{ stack.updated_time|parse_isotime|timesince_or_never }}\u003c/dd\u003e"},{"line_number":26,"context_line":"    \u003cdt\u003e{% trans \"Status\" %}\u003c/dt\u003e"}],"source_content_type":"text/html","patch_set":4,"id":"AAAAWH%2F%2BNhM%3D","line":23,"updated":"2014-03-28 11:39:59.000000000","message":"Can you use \"-\" (or \"None\") as the default value here?\n\nFrom the point of view of Japanese translation, we would like to assign different words to \"Never\" for created and updated. Otherwise, the translation string for \"Never\" will be \"-\" or \"None\".","commit_id":"ff7049432b7ea50e7e4e10a3de697661a3b91c67"}]}
