{"action":"created","comment":{"url":"https://api.github.com/repos/aeroniero33/gentoo-keys/pulls/comments/73919413","id":73919413,"diff_hunk":"@@ -67,22 +70,25 @@ def _generate_template(self, template_path, keyprints, specprint):\n \n     def _is_expiring(self):\n         is_expiring = False\n-        if self.pub.days < 180 and self.pub.days > -180:\n+        days_limit = self.config.get_key('days_limit')\n+        if self.pub.days < days_limit and self.pub.days > days_limit*(-1):\n             is_expiring = True\n         else:\n             for subkey in self.sub:\n-                if subkey.days < 180 and subkey.days > -180:\n+                if subkey.days < days_limit and subkey.days > days_limit*(-1):\n                     is_expiring = True\n                     break\n         return is_expiring\n \n     def email_reminder(self, keyprints, specprint):\n         is_expiring = self._is_expiring()\n+        config_dir = self.config.get_key('userconfigdir')\n+        template_dir = os.path.join(config_dir + '/templates')\n+        self.logger.debug(\"User template path is:\" + template_dir)\n         if self.uid and is_expiring:\n             template_path = '/usr/share/gkeys/templates/email_template'\n-            if os.path.exists('/home/aeroniero/.config/gkeys/templates/email_template'):\n-                template_path = '/home/aeroniero/.config/gkeys/templates/email_template'\n-            elif os.path.exists('/var/lib/gentoo/gkeys/templates/email_template'):\n-                template_path = '/var/lib/gentoo/gkeys/templates/email_template'\n+            if os.path.exists(template_dir + '/email_template'):\n+                template_path = template_dir + '/email_template'","path":"gkeys/gkeys/email_reminders.py","position":null,"original_position":58,"commit_id":"d4ecb049f9be0ca63392b1295e8a3e817f7d73a6","original_commit_id":"d4ecb049f9be0ca63392b1295e8a3e817f7d73a6","user":{"login":"dol-sen","id":950866,"avatar_url":"https://avatars.githubusercontent.com/u/950866?v=3","gravatar_id":"","url":"https://api.github.com/users/dol-sen","html_url":"https://github.com/dol-sen","followers_url":"https://api.github.com/users/dol-sen/followers","following_url":"https://api.github.com/users/dol-sen/following{/other_user}","gists_url":"https://api.github.com/users/dol-sen/gists{/gist_id}","starred_url":"https://api.github.com/users/dol-sen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dol-sen/subscriptions","organizations_url":"https://api.github.com/users/dol-sen/orgs","repos_url":"https://api.github.com/users/dol-sen/repos","events_url":"https://api.github.com/users/dol-sen/events{/privacy}","received_events_url":"https://api.github.com/users/dol-sen/received_events","type":"User","site_admin":false},"body":"you are still hard-coding the template to use, that too should be a config value.  Also the class should be initialized with the template to use.\r\n\r\n\r\nFurther...  Like I said in my first comments...  Thsi Emailer should be for email handling, not checking to see if it should make the email if it is expiring within so many days...  All that is already part of the scpec-check action.  the spec-check action code should only run the emailer class instance for keys that meet the spec-check email option requirement.  Emailer class is generic in that it could care less what template it uses and what data it gets to fill teh template with other than the data meets the template requirements and it has a valid email address to send it to.","created_at":"2016-08-08T17:42:31Z","updated_at":"2016-08-08T17:42:31Z","html_url":"https://github.com/aeroniero33/gentoo-keys/pull/1#discussion_r73919413","pull_request_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/aeroniero33/gentoo-keys/pulls/comments/73919413"},"html":{"href":"https://github.com/aeroniero33/gentoo-keys/pull/1#discussion_r73919413"},"pull_request":{"href":"https://api.github.com/repos/aeroniero33/gentoo-keys/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/aeroniero33/gentoo-keys/pulls/1","id":80415149,"html_url":"https://github.com/aeroniero33/gentoo-keys/pull/1","diff_url":"https://github.com/aeroniero33/gentoo-keys/pull/1.diff","patch_url":"https://github.com/aeroniero33/gentoo-keys/pull/1.patch","issue_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/issues/1","number":1,"state":"open","locked":false,"title":"Email reminders","user":{"login":"aeroniero33","id":5175537,"avatar_url":"https://avatars.githubusercontent.com/u/5175537?v=3","gravatar_id":"","url":"https://api.github.com/users/aeroniero33","html_url":"https://github.com/aeroniero33","followers_url":"https://api.github.com/users/aeroniero33/followers","following_url":"https://api.github.com/users/aeroniero33/following{/other_user}","gists_url":"https://api.github.com/users/aeroniero33/gists{/gist_id}","starred_url":"https://api.github.com/users/aeroniero33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aeroniero33/subscriptions","organizations_url":"https://api.github.com/users/aeroniero33/orgs","repos_url":"https://api.github.com/users/aeroniero33/repos","events_url":"https://api.github.com/users/aeroniero33/events{/privacy}","received_events_url":"https://api.github.com/users/aeroniero33/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-08T08:54:13Z","updated_at":"2016-08-08T17:42:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"616371343e95bc61b538998d246d96e0cccc031f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/pulls/1/commits","review_comments_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/pulls/1/comments","review_comment_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/issues/1/comments","statuses_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/statuses/d4ecb049f9be0ca63392b1295e8a3e817f7d73a6","head":{"label":"aeroniero33:email-reminders","ref":"email-reminders","sha":"d4ecb049f9be0ca63392b1295e8a3e817f7d73a6","user":{"login":"aeroniero33","id":5175537,"avatar_url":"https://avatars.githubusercontent.com/u/5175537?v=3","gravatar_id":"","url":"https://api.github.com/users/aeroniero33","html_url":"https://github.com/aeroniero33","followers_url":"https://api.github.com/users/aeroniero33/followers","following_url":"https://api.github.com/users/aeroniero33/following{/other_user}","gists_url":"https://api.github.com/users/aeroniero33/gists{/gist_id}","starred_url":"https://api.github.com/users/aeroniero33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aeroniero33/subscriptions","organizations_url":"https://api.github.com/users/aeroniero33/orgs","repos_url":"https://api.github.com/users/aeroniero33/repos","events_url":"https://api.github.com/users/aeroniero33/events{/privacy}","received_events_url":"https://api.github.com/users/aeroniero33/received_events","type":"User","site_admin":false},"repo":{"id":64665818,"name":"gentoo-keys","full_name":"aeroniero33/gentoo-keys","owner":{"login":"aeroniero33","id":5175537,"avatar_url":"https://avatars.githubusercontent.com/u/5175537?v=3","gravatar_id":"","url":"https://api.github.com/users/aeroniero33","html_url":"https://github.com/aeroniero33","followers_url":"https://api.github.com/users/aeroniero33/followers","following_url":"https://api.github.com/users/aeroniero33/following{/other_user}","gists_url":"https://api.github.com/users/aeroniero33/gists{/gist_id}","starred_url":"https://api.github.com/users/aeroniero33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aeroniero33/subscriptions","organizations_url":"https://api.github.com/users/aeroniero33/orgs","repos_url":"https://api.github.com/users/aeroniero33/repos","events_url":"https://api.github.com/users/aeroniero33/events{/privacy}","received_events_url":"https://api.github.com/users/aeroniero33/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aeroniero33/gentoo-keys","description":"OpenPGP Key management tool for Gentoo projects","fork":true,"url":"https://api.github.com/repos/aeroniero33/gentoo-keys","forks_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/forks","keys_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/teams","hooks_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/hooks","issue_events_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/issues/events{/number}","events_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/events","assignees_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/assignees{/user}","branches_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/branches{/branch}","tags_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/tags","blobs_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/git/refs{/sha}","trees_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/statuses/{sha}","languages_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/languages","stargazers_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/stargazers","contributors_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/contributors","subscribers_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/subscribers","subscription_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/subscription","commits_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/commits{/sha}","git_commits_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/git/commits{/sha}","comments_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/comments{/number}","issue_comment_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/issues/comments{/number}","contents_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/contents/{+path}","compare_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/merges","archive_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/downloads","issues_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/issues{/number}","pulls_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/pulls{/number}","milestones_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/milestones{/number}","notifications_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/labels{/name}","releases_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/releases{/id}","deployments_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/deployments","created_at":"2016-08-01T12:42:17Z","updated_at":"2016-08-01T12:42:19Z","pushed_at":"2016-08-08T17:24:05Z","git_url":"git://github.com/aeroniero33/gentoo-keys.git","ssh_url":"git@github.com:aeroniero33/gentoo-keys.git","clone_url":"https://github.com/aeroniero33/gentoo-keys.git","svn_url":"https://github.com/aeroniero33/gentoo-keys","homepage":"https://wiki.gentoo.org/wiki/Project:Gentoo-keys","size":551,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"aeroniero33:master","ref":"master","sha":"423c3bf0b3ae993e15886858aede0a94372b55fd","user":{"login":"aeroniero33","id":5175537,"avatar_url":"https://avatars.githubusercontent.com/u/5175537?v=3","gravatar_id":"","url":"https://api.github.com/users/aeroniero33","html_url":"https://github.com/aeroniero33","followers_url":"https://api.github.com/users/aeroniero33/followers","following_url":"https://api.github.com/users/aeroniero33/following{/other_user}","gists_url":"https://api.github.com/users/aeroniero33/gists{/gist_id}","starred_url":"https://api.github.com/users/aeroniero33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aeroniero33/subscriptions","organizations_url":"https://api.github.com/users/aeroniero33/orgs","repos_url":"https://api.github.com/users/aeroniero33/repos","events_url":"https://api.github.com/users/aeroniero33/events{/privacy}","received_events_url":"https://api.github.com/users/aeroniero33/received_events","type":"User","site_admin":false},"repo":{"id":64665818,"name":"gentoo-keys","full_name":"aeroniero33/gentoo-keys","owner":{"login":"aeroniero33","id":5175537,"avatar_url":"https://avatars.githubusercontent.com/u/5175537?v=3","gravatar_id":"","url":"https://api.github.com/users/aeroniero33","html_url":"https://github.com/aeroniero33","followers_url":"https://api.github.com/users/aeroniero33/followers","following_url":"https://api.github.com/users/aeroniero33/following{/other_user}","gists_url":"https://api.github.com/users/aeroniero33/gists{/gist_id}","starred_url":"https://api.github.com/users/aeroniero33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aeroniero33/subscriptions","organizations_url":"https://api.github.com/users/aeroniero33/orgs","repos_url":"https://api.github.com/users/aeroniero33/repos","events_url":"https://api.github.com/users/aeroniero33/events{/privacy}","received_events_url":"https://api.github.com/users/aeroniero33/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aeroniero33/gentoo-keys","description":"OpenPGP Key management tool for Gentoo projects","fork":true,"url":"https://api.github.com/repos/aeroniero33/gentoo-keys","forks_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/forks","keys_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/teams","hooks_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/hooks","issue_events_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/issues/events{/number}","events_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/events","assignees_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/assignees{/user}","branches_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/branches{/branch}","tags_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/tags","blobs_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/git/refs{/sha}","trees_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/statuses/{sha}","languages_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/languages","stargazers_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/stargazers","contributors_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/contributors","subscribers_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/subscribers","subscription_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/subscription","commits_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/commits{/sha}","git_commits_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/git/commits{/sha}","comments_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/comments{/number}","issue_comment_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/issues/comments{/number}","contents_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/contents/{+path}","compare_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/merges","archive_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/downloads","issues_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/issues{/number}","pulls_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/pulls{/number}","milestones_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/milestones{/number}","notifications_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/labels{/name}","releases_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/releases{/id}","deployments_url":"https://api.github.com/repos/aeroniero33/gentoo-keys/deployments","created_at":"2016-08-01T12:42:17Z","updated_at":"2016-08-01T12:42:19Z","pushed_at":"2016-08-08T17:24:05Z","git_url":"git://github.com/aeroniero33/gentoo-keys.git","ssh_url":"git@github.com:aeroniero33/gentoo-keys.git","clone_url":"https://github.com/aeroniero33/gentoo-keys.git","svn_url":"https://github.com/aeroniero33/gentoo-keys","homepage":"https://wiki.gentoo.org/wiki/Project:Gentoo-keys","size":551,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aeroniero33/gentoo-keys/pulls/1"},"html":{"href":"https://github.com/aeroniero33/gentoo-keys/pull/1"},"issue":{"href":"https://api.github.com/repos/aeroniero33/gentoo-keys/issues/1"},"comments":{"href":"https://api.github.com/repos/aeroniero33/gentoo-keys/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/aeroniero33/gentoo-keys/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/aeroniero33/gentoo-keys/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aeroniero33/gentoo-keys/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/aeroniero33/gentoo-keys/statuses/d4ecb049f9be0ca63392b1295e8a3e817f7d73a6"}}}}
{"actor":{"display_login":"dol-sen"}}