{"action":"created","comment":{"url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/pulls/comments/83873715","pull_request_review_id":4677793,"id":83873715,"diff_hunk":"@@ -287,16 +381,23 @@ def ticket_from_message(message, queue, quiet):\n     if t.status == Ticket.REOPENED_STATUS:\n         f.new_status = Ticket.REOPENED_STATUS\n         f.title = _('Ticket Re-Opened by E-Mail Received from %(sender_email)s' % {'sender_email': sender_email})\n-    \n+\n     f.save()\n+    logger.debug(\"Created new FollowUp for Ticket\")\n \n-    if not quiet:\n-        print((\" [%s-%s] %s\" % (t.queue.slug, t.id, t.title,)).encode('ascii', 'replace'))\n+    if six.PY2:\n+        logger.info((\"[%s-%s] %s\" % (t.queue.slug, t.id, t.title,)).encode('ascii', 'replace'))\n+    elif six.PY3:\n+        logger.info(\"[%s-%s] %s\" % (t.queue.slug, t.id, t.title,))\n \n     for file in files:\n         if file['content']:\n-            filename = file['filename'].encode('ascii', 'replace').replace(' ', '_')\n+            if six.PY2:","path":"helpdesk/management/commands/get_email.py","position":323,"original_position":323,"commit_id":"f313b5c3747e4a49549d4f20677b9929017f8503","original_commit_id":"f313b5c3747e4a49549d4f20677b9929017f8503","user":{"login":"flinz","id":97735,"avatar_url":"https://avatars.githubusercontent.com/u/97735?v=3","gravatar_id":"","url":"https://api.github.com/users/flinz","html_url":"https://github.com/flinz","followers_url":"https://api.github.com/users/flinz/followers","following_url":"https://api.github.com/users/flinz/following{/other_user}","gists_url":"https://api.github.com/users/flinz/gists{/gist_id}","starred_url":"https://api.github.com/users/flinz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flinz/subscriptions","organizations_url":"https://api.github.com/users/flinz/orgs","repos_url":"https://api.github.com/users/flinz/repos","events_url":"https://api.github.com/users/flinz/events{/privacy}","received_events_url":"https://api.github.com/users/flinz/received_events","type":"User","site_admin":false},"body":"Same here: Can we use django.utils.six instead?","created_at":"2016-10-18T14:57:54Z","updated_at":"2016-10-18T15:00:23Z","html_url":"https://github.com/django-helpdesk/django-helpdesk/pull/420#discussion_r83873715","pull_request_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/pulls/420","_links":{"self":{"href":"https://api.github.com/repos/django-helpdesk/django-helpdesk/pulls/comments/83873715"},"html":{"href":"https://github.com/django-helpdesk/django-helpdesk/pull/420#discussion_r83873715"},"pull_request":{"href":"https://api.github.com/repos/django-helpdesk/django-helpdesk/pulls/420"}}},"pull_request":{"url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/pulls/420","id":85329969,"html_url":"https://github.com/django-helpdesk/django-helpdesk/pull/420","diff_url":"https://github.com/django-helpdesk/django-helpdesk/pull/420.diff","patch_url":"https://github.com/django-helpdesk/django-helpdesk/pull/420.patch","issue_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/issues/420","number":420,"state":"open","locked":false,"title":"get_email local mail directory, logging support, Python3 via six","user":{"login":"gwasser","id":4760531,"avatar_url":"https://avatars.githubusercontent.com/u/4760531?v=3","gravatar_id":"","url":"https://api.github.com/users/gwasser","html_url":"https://github.com/gwasser","followers_url":"https://api.github.com/users/gwasser/followers","following_url":"https://api.github.com/users/gwasser/following{/other_user}","gists_url":"https://api.github.com/users/gwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/gwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwasser/subscriptions","organizations_url":"https://api.github.com/users/gwasser/orgs","repos_url":"https://api.github.com/users/gwasser/repos","events_url":"https://api.github.com/users/gwasser/events{/privacy}","received_events_url":"https://api.github.com/users/gwasser/received_events","type":"User","site_admin":false},"body":"Can now set a local directory to poll for email, not just remote POP3/IMAP (more options!). My IT department sets up mail to get dumped in a folder on the server, so just have to parse it. Maybe this is useful to others. Ticketing systems like JIRA check local directories too, so seems common use case. The directory can be set by the user in the Queue admin page.\r\n\r\nAdditionally, I replaced the print() statements with logging statements. Logging will be printed to console unless --quiet option is enabled. By default, logging to file is turned off but user can set the log file directory in the Queue admin page now.\r\n\r\nUsed python-six to add python3 compatibility along side existing python2. This may go toward addressing #376 but I haven't tested the POP3/IMAP support yet. I can say that it *does* successfully process mail from a local directory on Python 3.5 though, so the logic is good other than the potential socket issue.","created_at":"2016-09-15T00:44:43Z","updated_at":"2016-10-18T15:00:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e986d754c30338bda64531249788ddaa7908568a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/pulls/420/commits","review_comments_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/pulls/420/comments","review_comment_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/issues/420/comments","statuses_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/statuses/f313b5c3747e4a49549d4f20677b9929017f8503","head":{"label":"gwasser:mailparse","ref":"mailparse","sha":"f313b5c3747e4a49549d4f20677b9929017f8503","user":{"login":"gwasser","id":4760531,"avatar_url":"https://avatars.githubusercontent.com/u/4760531?v=3","gravatar_id":"","url":"https://api.github.com/users/gwasser","html_url":"https://github.com/gwasser","followers_url":"https://api.github.com/users/gwasser/followers","following_url":"https://api.github.com/users/gwasser/following{/other_user}","gists_url":"https://api.github.com/users/gwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/gwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwasser/subscriptions","organizations_url":"https://api.github.com/users/gwasser/orgs","repos_url":"https://api.github.com/users/gwasser/repos","events_url":"https://api.github.com/users/gwasser/events{/privacy}","received_events_url":"https://api.github.com/users/gwasser/received_events","type":"User","site_admin":false},"repo":{"id":51379598,"name":"django-helpdesk","full_name":"gwasser/django-helpdesk","owner":{"login":"gwasser","id":4760531,"avatar_url":"https://avatars.githubusercontent.com/u/4760531?v=3","gravatar_id":"","url":"https://api.github.com/users/gwasser","html_url":"https://github.com/gwasser","followers_url":"https://api.github.com/users/gwasser/followers","following_url":"https://api.github.com/users/gwasser/following{/other_user}","gists_url":"https://api.github.com/users/gwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/gwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwasser/subscriptions","organizations_url":"https://api.github.com/users/gwasser/orgs","repos_url":"https://api.github.com/users/gwasser/repos","events_url":"https://api.github.com/users/gwasser/events{/privacy}","received_events_url":"https://api.github.com/users/gwasser/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gwasser/django-helpdesk","description":"A Django application to manage tickets for an internal helpdesk. Formerly known as Jutda Helpdesk.","fork":true,"url":"https://api.github.com/repos/gwasser/django-helpdesk","forks_url":"https://api.github.com/repos/gwasser/django-helpdesk/forks","keys_url":"https://api.github.com/repos/gwasser/django-helpdesk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gwasser/django-helpdesk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gwasser/django-helpdesk/teams","hooks_url":"https://api.github.com/repos/gwasser/django-helpdesk/hooks","issue_events_url":"https://api.github.com/repos/gwasser/django-helpdesk/issues/events{/number}","events_url":"https://api.github.com/repos/gwasser/django-helpdesk/events","assignees_url":"https://api.github.com/repos/gwasser/django-helpdesk/assignees{/user}","branches_url":"https://api.github.com/repos/gwasser/django-helpdesk/branches{/branch}","tags_url":"https://api.github.com/repos/gwasser/django-helpdesk/tags","blobs_url":"https://api.github.com/repos/gwasser/django-helpdesk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gwasser/django-helpdesk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gwasser/django-helpdesk/git/refs{/sha}","trees_url":"https://api.github.com/repos/gwasser/django-helpdesk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gwasser/django-helpdesk/statuses/{sha}","languages_url":"https://api.github.com/repos/gwasser/django-helpdesk/languages","stargazers_url":"https://api.github.com/repos/gwasser/django-helpdesk/stargazers","contributors_url":"https://api.github.com/repos/gwasser/django-helpdesk/contributors","subscribers_url":"https://api.github.com/repos/gwasser/django-helpdesk/subscribers","subscription_url":"https://api.github.com/repos/gwasser/django-helpdesk/subscription","commits_url":"https://api.github.com/repos/gwasser/django-helpdesk/commits{/sha}","git_commits_url":"https://api.github.com/repos/gwasser/django-helpdesk/git/commits{/sha}","comments_url":"https://api.github.com/repos/gwasser/django-helpdesk/comments{/number}","issue_comment_url":"https://api.github.com/repos/gwasser/django-helpdesk/issues/comments{/number}","contents_url":"https://api.github.com/repos/gwasser/django-helpdesk/contents/{+path}","compare_url":"https://api.github.com/repos/gwasser/django-helpdesk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gwasser/django-helpdesk/merges","archive_url":"https://api.github.com/repos/gwasser/django-helpdesk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gwasser/django-helpdesk/downloads","issues_url":"https://api.github.com/repos/gwasser/django-helpdesk/issues{/number}","pulls_url":"https://api.github.com/repos/gwasser/django-helpdesk/pulls{/number}","milestones_url":"https://api.github.com/repos/gwasser/django-helpdesk/milestones{/number}","notifications_url":"https://api.github.com/repos/gwasser/django-helpdesk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gwasser/django-helpdesk/labels{/name}","releases_url":"https://api.github.com/repos/gwasser/django-helpdesk/releases{/id}","deployments_url":"https://api.github.com/repos/gwasser/django-helpdesk/deployments","created_at":"2016-02-09T16:27:28Z","updated_at":"2016-08-08T02:16:23Z","pushed_at":"2016-09-27T21:31:41Z","git_url":"git://github.com/gwasser/django-helpdesk.git","ssh_url":"git@github.com:gwasser/django-helpdesk.git","clone_url":"https://github.com/gwasser/django-helpdesk.git","svn_url":"https://github.com/gwasser/django-helpdesk","homepage":"","size":5247,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"django-helpdesk:master","ref":"master","sha":"baab36653e80a439e07978718c43c89e5c63e397","user":{"login":"django-helpdesk","id":22762644,"avatar_url":"https://avatars.githubusercontent.com/u/22762644?v=3","gravatar_id":"","url":"https://api.github.com/users/django-helpdesk","html_url":"https://github.com/django-helpdesk","followers_url":"https://api.github.com/users/django-helpdesk/followers","following_url":"https://api.github.com/users/django-helpdesk/following{/other_user}","gists_url":"https://api.github.com/users/django-helpdesk/gists{/gist_id}","starred_url":"https://api.github.com/users/django-helpdesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django-helpdesk/subscriptions","organizations_url":"https://api.github.com/users/django-helpdesk/orgs","repos_url":"https://api.github.com/users/django-helpdesk/repos","events_url":"https://api.github.com/users/django-helpdesk/events{/privacy}","received_events_url":"https://api.github.com/users/django-helpdesk/received_events","type":"Organization","site_admin":false},"repo":{"id":985638,"name":"django-helpdesk","full_name":"django-helpdesk/django-helpdesk","owner":{"login":"django-helpdesk","id":22762644,"avatar_url":"https://avatars.githubusercontent.com/u/22762644?v=3","gravatar_id":"","url":"https://api.github.com/users/django-helpdesk","html_url":"https://github.com/django-helpdesk","followers_url":"https://api.github.com/users/django-helpdesk/followers","following_url":"https://api.github.com/users/django-helpdesk/following{/other_user}","gists_url":"https://api.github.com/users/django-helpdesk/gists{/gist_id}","starred_url":"https://api.github.com/users/django-helpdesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django-helpdesk/subscriptions","organizations_url":"https://api.github.com/users/django-helpdesk/orgs","repos_url":"https://api.github.com/users/django-helpdesk/repos","events_url":"https://api.github.com/users/django-helpdesk/events{/privacy}","received_events_url":"https://api.github.com/users/django-helpdesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django-helpdesk/django-helpdesk","description":"A Django application to manage tickets for an internal helpdesk. Formerly known as Jutda Helpdesk.","fork":false,"url":"https://api.github.com/repos/django-helpdesk/django-helpdesk","forks_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/forks","keys_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/teams","hooks_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/hooks","issue_events_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/issues/events{/number}","events_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/events","assignees_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/assignees{/user}","branches_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/branches{/branch}","tags_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/tags","blobs_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/git/refs{/sha}","trees_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/statuses/{sha}","languages_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/languages","stargazers_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/stargazers","contributors_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/contributors","subscribers_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/subscribers","subscription_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/subscription","commits_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/commits{/sha}","git_commits_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/git/commits{/sha}","comments_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/comments{/number}","issue_comment_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/issues/comments{/number}","contents_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/contents/{+path}","compare_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/merges","archive_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/downloads","issues_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/issues{/number}","pulls_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/pulls{/number}","milestones_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/milestones{/number}","notifications_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/labels{/name}","releases_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/releases{/id}","deployments_url":"https://api.github.com/repos/django-helpdesk/django-helpdesk/deployments","created_at":"2010-10-14T00:59:09Z","updated_at":"2016-10-18T13:34:07Z","pushed_at":"2016-10-18T13:39:32Z","git_url":"git://github.com/django-helpdesk/django-helpdesk.git","ssh_url":"git@github.com:django-helpdesk/django-helpdesk.git","clone_url":"https://github.com/django-helpdesk/django-helpdesk.git","svn_url":"https://github.com/django-helpdesk/django-helpdesk","homepage":"","size":6847,"stargazers_count":608,"watchers_count":608,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":258,"mirror_url":null,"open_issues_count":66,"forks":258,"open_issues":66,"watchers":608,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django-helpdesk/django-helpdesk/pulls/420"},"html":{"href":"https://github.com/django-helpdesk/django-helpdesk/pull/420"},"issue":{"href":"https://api.github.com/repos/django-helpdesk/django-helpdesk/issues/420"},"comments":{"href":"https://api.github.com/repos/django-helpdesk/django-helpdesk/issues/420/comments"},"review_comments":{"href":"https://api.github.com/repos/django-helpdesk/django-helpdesk/pulls/420/comments"},"review_comment":{"href":"https://api.github.com/repos/django-helpdesk/django-helpdesk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django-helpdesk/django-helpdesk/pulls/420/commits"},"statuses":{"href":"https://api.github.com/repos/django-helpdesk/django-helpdesk/statuses/f313b5c3747e4a49549d4f20677b9929017f8503"}}}}
{"actor":{"display_login":"flinz"}}