{"action":"created","issue":{"url":"https://api.github.com/repos/clach04/prettytable/issues/57","repository_url":"https://api.github.com/repos/clach04/prettytable","labels_url":"https://api.github.com/repos/clach04/prettytable/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/clach04/prettytable/issues/57/comments","events_url":"https://api.github.com/repos/clach04/prettytable/issues/57/events","html_url":"https://github.com/clach04/prettytable/issues/57","id":137510547,"number":57,"title":"Add date formatting for datetime etc instances","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars0.githubusercontent.com/u/9614759?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"id":334236691,"url":"https://api.github.com/repos/clach04/prettytable/labels/Priority-Medium","name":"Priority-Medium","color":"ededed","default":false},{"id":334236701,"url":"https://api.github.com/repos/clach04/prettytable/labels/Type-Defect","name":"Type-Defect","color":"ededed","default":false},{"id":334236693,"url":"https://api.github.com/repos/clach04/prettytable/labels/auto-migrated","name":"auto-migrated","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-03-01T08:46:09Z","updated_at":"2018-05-16T23:50:32Z","closed_at":null,"author_association":"NONE","body":"```\nIt's useful to be able to specify a format for datetime values. I've attached a \ndiff that provides this functionality, basically by copying the float and int \nformatting. It's applied to any object with a \"strftime\" method, which catches \ndate, time and datetime.\n\nThe validation of the format is pretty minimal, because you can put basically \nanything in a strftime format. I wondered whether it was worth it, but I left \nit as it's easier to extend the checks in the future if needed.\n```\n\nOriginal issue reported on code.google.com by `p.f.mo...@gmail.com` on 28 Aug 2014 at 1:31\n\nAttachments:\n- [prettytable.diff](https://storage.googleapis.com/google-code-attachments/prettytable/issue-57/comment-0/prettytable.diff)\n"},"comment":{"url":"https://api.github.com/repos/clach04/prettytable/issues/comments/389700900","html_url":"https://github.com/clach04/prettytable/issues/57#issuecomment-389700900","issue_url":"https://api.github.com/repos/clach04/prettytable/issues/57","id":389700900,"user":{"login":"ayushiagarwal","id":13897163,"avatar_url":"https://avatars1.githubusercontent.com/u/13897163?v=4","gravatar_id":"","url":"https://api.github.com/users/ayushiagarwal","html_url":"https://github.com/ayushiagarwal","followers_url":"https://api.github.com/users/ayushiagarwal/followers","following_url":"https://api.github.com/users/ayushiagarwal/following{/other_user}","gists_url":"https://api.github.com/users/ayushiagarwal/gists{/gist_id}","starred_url":"https://api.github.com/users/ayushiagarwal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayushiagarwal/subscriptions","organizations_url":"https://api.github.com/users/ayushiagarwal/orgs","repos_url":"https://api.github.com/users/ayushiagarwal/repos","events_url":"https://api.github.com/users/ayushiagarwal/events{/privacy}","received_events_url":"https://api.github.com/users/ayushiagarwal/received_events","type":"User","site_admin":false},"created_at":"2018-05-16T23:50:32Z","updated_at":"2018-05-16T23:50:32Z","author_association":"NONE","body":"Datetime.datetime is not supported by pretty table . When I try to use datetime.datetime datatte in pretty table it gives an error:\r\n\r\nanaconda3/lib/python3.5/site-packages/prettytable.py in get_html_string(self, **kwargs)\r\n   1184             string = self._get_formatted_html_string(options)\r\n   1185         else:\r\n-> 1186             string = self._get_simple_html_string(options)\r\n   1187 \r\n   1188         return string\r\n\r\nanaconda3/lib/python3.5/site-packages/prettytable.py in _get_simple_html_string(self, options)\r\n   1214 \r\n   1215         # Data\r\n-> 1216         rows = self._get_rows(options)\r\n   1217         formatted_rows = self._format_rows(rows, options)\r\n   1218         for row in formatted_rows:\r\n\r\nanaconda3/lib/python3.5/site-packages/prettytable.py in _get_rows(self, options)\r\n    924 \r\n    925         # Make a copy of only those rows in the slice range\r\n--> 926         rows = copy.deepcopy(self._rows[options[\"start\"]:options[\"end\"]])\r\n    927         # Sort if necessary\r\n    928         if options[\"sortby\"]:\r\n\r\nanaconda3/lib/python3.5/copy.py in deepcopy(x, memo, _nil)\r\n    153     copier = _deepcopy_dispatch.get(cls)\r\n    154     if copier:\r\n--> 155         y = copier(x, memo)\r\n    156     else:\r\n    157         try:\r\n\r\nanaconda3/lib/python3.5/copy.py in _deepcopy_list(x, memo)\r\n    216     memo[id(x)] = y\r\n    217     for a in x:\r\n--> 218         y.append(deepcopy(a, memo))\r\n    219     return y\r\n    220 d[list] = _deepcopy_list\r\n\r\nanaconda3/lib/python3.5/copy.py in deepcopy(x, memo, _nil)\r\n    153     copier = _deepcopy_dispatch.get(cls)\r\n    154     if copier:\r\n--> 155         y = copier(x, memo)\r\n    156     else:\r\n    157         try:\r\n\r\nanaconda3/lib/python3.5/copy.py in _deepcopy_list(x, memo)\r\n    216     memo[id(x)] = y\r\n    217     for a in x:\r\n--> 218         y.append(deepcopy(a, memo))\r\n    219     return y\r\n    220 d[list] = _deepcopy_list\r\n\r\nanaconda3/lib/python3.5/copy.py in deepcopy(x, memo, _nil)\r\n    180                             raise Error(\r\n    181                                 \"un(deep)copyable object of type %s\" % cls)\r\n--> 182                 y = _reconstruct(x, rv, 1, memo)\r\n    183 \r\n    184     # If is its own copy, don't memoize.\r\n\r\nlib/python3.5/copy.py in _reconstruct(x, info, deep, memo)\r\n    289         dictiter = None\r\n    290     if deep:\r\n--> 291         args = deepcopy(args, memo)\r\n    292     y = callable(*args)\r\n    293     memo[id(x)] = y\r\n\r\nanaconda3/lib/python3.5/copy.py in deepcopy(x, memo, _nil)\r\n    153     copier = _deepcopy_dispatch.get(cls)\r\n    154     if copier:\r\n--> 155         y = copier(x, memo)\r\n    156     else:\r\n    157         try:\r\nanaconda3/lib/python3.5/copy.py in _deepcopy_tuple(x, memo)\r\n    221 \r\n    222 def _deepcopy_tuple(x, memo):\r\n--> 223     y = [deepcopy(a, memo) for a in x]\r\n    224     # We're not going to put the tuple in the memo, but it's still important we\r\n    225     # check for it, in case the tuple contains recursive mutable structures.\r\n\r\nanaconda3/lib/python3.5/copy.py in <listcomp>(.0)\r\n    221 \r\n    222 def _deepcopy_tuple(x, memo):\r\n--> 223     y = [deepcopy(a, memo) for a in x]\r\n    224     # We're not going to put the tuple in the memo, but it's still important we\r\n    225     # check for it, in case the tuple contains recursive mutable structures.\r\n\r\nanaconda3/lib/python3.5/copy.py in deepcopy(x, memo, _nil)\r\n    180                             raise Error(\r\n    181                                 \"un(deep)copyable object of type %s\" % cls)\r\n--> 182                 y = _reconstruct(x, rv, 1, memo)\r\n    183 \r\n    184     # If is its own copy, don't memoize.\r\n\r\nanaconda3/lib/python3.5/copy.py in _reconstruct(x, info, deep, memo)\r\n    290     if deep:\r\n    291         args = deepcopy(args, memo)\r\n--> 292     y = callable(*args)\r\n    293     memo[id(x)] = y\r\n    294 \r\n\r\nTypeError: __init__() missing 3 required positional arguments: 'sign', 'hours', and 'minutes'\r\n\r\nAny solutions or work around for the problem?\r\n"}}
{"actor":{"display_login":"ayushiagarwal"}}