{"action":"created","comment":{"url":"https://api.github.com/repos/malirod/pylua/pulls/comments/86660442","pull_request_review_id":7310503,"id":86660442,"diff_hunk":"@@ -0,0 +1,38 @@\n+#!/usr/bin/env python2\n+# -*- coding: utf-8 -*-\n+# timer works with milliseconds\n+\n+import threading\n+\n+\n+def msec_to_sec(milliseconds):\n+    milliseconds_in_second = 1000.0\n+    return milliseconds/milliseconds_in_second\n+\n+\n+def sec_to_msec(seconds):\n+    milliseconds_in_second = 1000.0\n+    return seconds*milliseconds_in_second\n+\n+\n+class PyTimer(object):\n+\n+    def __init__(self, task, interval):\n+        self._task = task\n+        self._interval = msec_to_sec(interval)\n+        self._timer = None\n+\n+    def start(self):\n+        self.create()\n+        self._timer.start()\n+\n+    def create(self):\n+        self._timer = threading.Timer(self._interval, self._task)","path":"pylua/timer.py","position":30,"original_position":30,"commit_id":"124fe2ce011bac5387fc5fff88f49379da37cc4f","original_commit_id":"124fe2ce011bac5387fc5fff88f49379da37cc4f","user":{"login":"malirod","id":1135245,"avatar_url":"https://avatars.githubusercontent.com/u/1135245?v=3","gravatar_id":"","url":"https://api.github.com/users/malirod","html_url":"https://github.com/malirod","followers_url":"https://api.github.com/users/malirod/followers","following_url":"https://api.github.com/users/malirod/following{/other_user}","gists_url":"https://api.github.com/users/malirod/gists{/gist_id}","starred_url":"https://api.github.com/users/malirod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malirod/subscriptions","organizations_url":"https://api.github.com/users/malirod/orgs","repos_url":"https://api.github.com/users/malirod/repos","events_url":"https://api.github.com/users/malirod/events{/privacy}","received_events_url":"https://api.github.com/users/malirod/received_events","type":"User","site_admin":false},"body":"@dtrunov, why this create methon cannot be replaced with ctor? I see no point in special method to create timer.","created_at":"2016-11-05T08:19:06Z","updated_at":"2016-11-05T08:19:06Z","html_url":"https://github.com/malirod/pylua/pull/16#discussion_r86660442","pull_request_url":"https://api.github.com/repos/malirod/pylua/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/malirod/pylua/pulls/comments/86660442"},"html":{"href":"https://github.com/malirod/pylua/pull/16#discussion_r86660442"},"pull_request":{"href":"https://api.github.com/repos/malirod/pylua/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/malirod/pylua/pulls/16","id":90530760,"html_url":"https://github.com/malirod/pylua/pull/16","diff_url":"https://github.com/malirod/pylua/pull/16.diff","patch_url":"https://github.com/malirod/pylua/pull/16.patch","issue_url":"https://api.github.com/repos/malirod/pylua/issues/16","number":16,"state":"open","locked":false,"title":"[WIP]Feature/timer","user":{"login":"dtrunov","id":11158877,"avatar_url":"https://avatars.githubusercontent.com/u/11158877?v=3","gravatar_id":"","url":"https://api.github.com/users/dtrunov","html_url":"https://github.com/dtrunov","followers_url":"https://api.github.com/users/dtrunov/followers","following_url":"https://api.github.com/users/dtrunov/following{/other_user}","gists_url":"https://api.github.com/users/dtrunov/gists{/gist_id}","starred_url":"https://api.github.com/users/dtrunov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtrunov/subscriptions","organizations_url":"https://api.github.com/users/dtrunov/orgs","repos_url":"https://api.github.com/users/dtrunov/repos","events_url":"https://api.github.com/users/dtrunov/events{/privacy}","received_events_url":"https://api.github.com/users/dtrunov/received_events","type":"User","site_admin":false},"body":"Create timer based on python timer and add UT for timer.\n","created_at":"2016-10-23T21:36:43Z","updated_at":"2016-11-05T08:19:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eaad6430c007687802446ac8b55d787a163d9519","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/malirod/pylua/pulls/16/commits","review_comments_url":"https://api.github.com/repos/malirod/pylua/pulls/16/comments","review_comment_url":"https://api.github.com/repos/malirod/pylua/pulls/comments{/number}","comments_url":"https://api.github.com/repos/malirod/pylua/issues/16/comments","statuses_url":"https://api.github.com/repos/malirod/pylua/statuses/124fe2ce011bac5387fc5fff88f49379da37cc4f","head":{"label":"dtrunov:feature/timer","ref":"feature/timer","sha":"124fe2ce011bac5387fc5fff88f49379da37cc4f","user":{"login":"dtrunov","id":11158877,"avatar_url":"https://avatars.githubusercontent.com/u/11158877?v=3","gravatar_id":"","url":"https://api.github.com/users/dtrunov","html_url":"https://github.com/dtrunov","followers_url":"https://api.github.com/users/dtrunov/followers","following_url":"https://api.github.com/users/dtrunov/following{/other_user}","gists_url":"https://api.github.com/users/dtrunov/gists{/gist_id}","starred_url":"https://api.github.com/users/dtrunov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtrunov/subscriptions","organizations_url":"https://api.github.com/users/dtrunov/orgs","repos_url":"https://api.github.com/users/dtrunov/repos","events_url":"https://api.github.com/users/dtrunov/events{/privacy}","received_events_url":"https://api.github.com/users/dtrunov/received_events","type":"User","site_admin":false},"repo":{"id":71392232,"name":"pylua","full_name":"dtrunov/pylua","owner":{"login":"dtrunov","id":11158877,"avatar_url":"https://avatars.githubusercontent.com/u/11158877?v=3","gravatar_id":"","url":"https://api.github.com/users/dtrunov","html_url":"https://github.com/dtrunov","followers_url":"https://api.github.com/users/dtrunov/followers","following_url":"https://api.github.com/users/dtrunov/following{/other_user}","gists_url":"https://api.github.com/users/dtrunov/gists{/gist_id}","starred_url":"https://api.github.com/users/dtrunov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtrunov/subscriptions","organizations_url":"https://api.github.com/users/dtrunov/orgs","repos_url":"https://api.github.com/users/dtrunov/repos","events_url":"https://api.github.com/users/dtrunov/events{/privacy}","received_events_url":"https://api.github.com/users/dtrunov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dtrunov/pylua","description":"Example of binding between python and lua","fork":true,"url":"https://api.github.com/repos/dtrunov/pylua","forks_url":"https://api.github.com/repos/dtrunov/pylua/forks","keys_url":"https://api.github.com/repos/dtrunov/pylua/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dtrunov/pylua/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dtrunov/pylua/teams","hooks_url":"https://api.github.com/repos/dtrunov/pylua/hooks","issue_events_url":"https://api.github.com/repos/dtrunov/pylua/issues/events{/number}","events_url":"https://api.github.com/repos/dtrunov/pylua/events","assignees_url":"https://api.github.com/repos/dtrunov/pylua/assignees{/user}","branches_url":"https://api.github.com/repos/dtrunov/pylua/branches{/branch}","tags_url":"https://api.github.com/repos/dtrunov/pylua/tags","blobs_url":"https://api.github.com/repos/dtrunov/pylua/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dtrunov/pylua/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dtrunov/pylua/git/refs{/sha}","trees_url":"https://api.github.com/repos/dtrunov/pylua/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dtrunov/pylua/statuses/{sha}","languages_url":"https://api.github.com/repos/dtrunov/pylua/languages","stargazers_url":"https://api.github.com/repos/dtrunov/pylua/stargazers","contributors_url":"https://api.github.com/repos/dtrunov/pylua/contributors","subscribers_url":"https://api.github.com/repos/dtrunov/pylua/subscribers","subscription_url":"https://api.github.com/repos/dtrunov/pylua/subscription","commits_url":"https://api.github.com/repos/dtrunov/pylua/commits{/sha}","git_commits_url":"https://api.github.com/repos/dtrunov/pylua/git/commits{/sha}","comments_url":"https://api.github.com/repos/dtrunov/pylua/comments{/number}","issue_comment_url":"https://api.github.com/repos/dtrunov/pylua/issues/comments{/number}","contents_url":"https://api.github.com/repos/dtrunov/pylua/contents/{+path}","compare_url":"https://api.github.com/repos/dtrunov/pylua/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dtrunov/pylua/merges","archive_url":"https://api.github.com/repos/dtrunov/pylua/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dtrunov/pylua/downloads","issues_url":"https://api.github.com/repos/dtrunov/pylua/issues{/number}","pulls_url":"https://api.github.com/repos/dtrunov/pylua/pulls{/number}","milestones_url":"https://api.github.com/repos/dtrunov/pylua/milestones{/number}","notifications_url":"https://api.github.com/repos/dtrunov/pylua/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dtrunov/pylua/labels{/name}","releases_url":"https://api.github.com/repos/dtrunov/pylua/releases{/id}","deployments_url":"https://api.github.com/repos/dtrunov/pylua/deployments","created_at":"2016-10-19T19:30:22Z","updated_at":"2016-10-19T19:30:23Z","pushed_at":"2016-11-02T21:08:46Z","git_url":"git://github.com/dtrunov/pylua.git","ssh_url":"git@github.com:dtrunov/pylua.git","clone_url":"https://github.com/dtrunov/pylua.git","svn_url":"https://github.com/dtrunov/pylua","homepage":null,"size":46,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"malirod:develop","ref":"develop","sha":"c3a056f01d1f83ca807fdf9241267aa73ed30709","user":{"login":"malirod","id":1135245,"avatar_url":"https://avatars.githubusercontent.com/u/1135245?v=3","gravatar_id":"","url":"https://api.github.com/users/malirod","html_url":"https://github.com/malirod","followers_url":"https://api.github.com/users/malirod/followers","following_url":"https://api.github.com/users/malirod/following{/other_user}","gists_url":"https://api.github.com/users/malirod/gists{/gist_id}","starred_url":"https://api.github.com/users/malirod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malirod/subscriptions","organizations_url":"https://api.github.com/users/malirod/orgs","repos_url":"https://api.github.com/users/malirod/repos","events_url":"https://api.github.com/users/malirod/events{/privacy}","received_events_url":"https://api.github.com/users/malirod/received_events","type":"User","site_admin":false},"repo":{"id":67381714,"name":"pylua","full_name":"malirod/pylua","owner":{"login":"malirod","id":1135245,"avatar_url":"https://avatars.githubusercontent.com/u/1135245?v=3","gravatar_id":"","url":"https://api.github.com/users/malirod","html_url":"https://github.com/malirod","followers_url":"https://api.github.com/users/malirod/followers","following_url":"https://api.github.com/users/malirod/following{/other_user}","gists_url":"https://api.github.com/users/malirod/gists{/gist_id}","starred_url":"https://api.github.com/users/malirod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malirod/subscriptions","organizations_url":"https://api.github.com/users/malirod/orgs","repos_url":"https://api.github.com/users/malirod/repos","events_url":"https://api.github.com/users/malirod/events{/privacy}","received_events_url":"https://api.github.com/users/malirod/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/malirod/pylua","description":"Example of binding between python and lua","fork":false,"url":"https://api.github.com/repos/malirod/pylua","forks_url":"https://api.github.com/repos/malirod/pylua/forks","keys_url":"https://api.github.com/repos/malirod/pylua/keys{/key_id}","collaborators_url":"https://api.github.com/repos/malirod/pylua/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/malirod/pylua/teams","hooks_url":"https://api.github.com/repos/malirod/pylua/hooks","issue_events_url":"https://api.github.com/repos/malirod/pylua/issues/events{/number}","events_url":"https://api.github.com/repos/malirod/pylua/events","assignees_url":"https://api.github.com/repos/malirod/pylua/assignees{/user}","branches_url":"https://api.github.com/repos/malirod/pylua/branches{/branch}","tags_url":"https://api.github.com/repos/malirod/pylua/tags","blobs_url":"https://api.github.com/repos/malirod/pylua/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/malirod/pylua/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/malirod/pylua/git/refs{/sha}","trees_url":"https://api.github.com/repos/malirod/pylua/git/trees{/sha}","statuses_url":"https://api.github.com/repos/malirod/pylua/statuses/{sha}","languages_url":"https://api.github.com/repos/malirod/pylua/languages","stargazers_url":"https://api.github.com/repos/malirod/pylua/stargazers","contributors_url":"https://api.github.com/repos/malirod/pylua/contributors","subscribers_url":"https://api.github.com/repos/malirod/pylua/subscribers","subscription_url":"https://api.github.com/repos/malirod/pylua/subscription","commits_url":"https://api.github.com/repos/malirod/pylua/commits{/sha}","git_commits_url":"https://api.github.com/repos/malirod/pylua/git/commits{/sha}","comments_url":"https://api.github.com/repos/malirod/pylua/comments{/number}","issue_comment_url":"https://api.github.com/repos/malirod/pylua/issues/comments{/number}","contents_url":"https://api.github.com/repos/malirod/pylua/contents/{+path}","compare_url":"https://api.github.com/repos/malirod/pylua/compare/{base}...{head}","merges_url":"https://api.github.com/repos/malirod/pylua/merges","archive_url":"https://api.github.com/repos/malirod/pylua/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/malirod/pylua/downloads","issues_url":"https://api.github.com/repos/malirod/pylua/issues{/number}","pulls_url":"https://api.github.com/repos/malirod/pylua/pulls{/number}","milestones_url":"https://api.github.com/repos/malirod/pylua/milestones{/number}","notifications_url":"https://api.github.com/repos/malirod/pylua/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/malirod/pylua/labels{/name}","releases_url":"https://api.github.com/repos/malirod/pylua/releases{/id}","deployments_url":"https://api.github.com/repos/malirod/pylua/deployments","created_at":"2016-09-05T02:34:14Z","updated_at":"2016-09-08T06:21:22Z","pushed_at":"2016-11-04T09:47:57Z","git_url":"git://github.com/malirod/pylua.git","ssh_url":"git@github.com:malirod/pylua.git","clone_url":"https://github.com/malirod/pylua.git","svn_url":"https://github.com/malirod/pylua","homepage":null,"size":85,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":8,"forks":6,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/malirod/pylua/pulls/16"},"html":{"href":"https://github.com/malirod/pylua/pull/16"},"issue":{"href":"https://api.github.com/repos/malirod/pylua/issues/16"},"comments":{"href":"https://api.github.com/repos/malirod/pylua/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/malirod/pylua/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/malirod/pylua/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/malirod/pylua/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/malirod/pylua/statuses/124fe2ce011bac5387fc5fff88f49379da37cc4f"}}}}
{"actor":{"display_login":"malirod"}}