{"action":"created","comment":{"url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/pulls/comments/24914249","id":24914249,"diff_hunk":"@@ -0,0 +1,24 @@\n+\n+\n+class BestLapFilter(object):\n+    \"\"\"Update BestLap if laptime is present and is faster than the current best\"\"\"\n+    BEST_LAPTIME_KEY = 'BestLap'\n+    best_laptime = 0\n+    best_laptime_meta = None\n+    def __init__(self, system_channels):\n+        self.best_laptime_meta = system_channels.findChannelMeta(self.BEST_LAPTIME_KEY)\n+        \n+    def get_channel_meta(self):\n+        return self.best_laptime_meta\n+    \n+    def reset(self):\n+        self.best_laptime = 0\n+         \n+    def filter(self, channel_data):\n+        laptime = channel_data.get('LapTime')\n+        if laptime != None and laptime > 0:\n+            current_best_laptime = self.best_laptime","path":"autosportlabs/racecapture/databus/filter/bestlapfilter.py","position":20,"original_position":20,"commit_id":"8e85e2378025ef31c95894b751f8958a8e207f21","original_commit_id":"8e85e2378025ef31c95894b751f8958a8e207f21","user":{"login":"brentpicasso","id":3267533,"avatar_url":"https://avatars.githubusercontent.com/u/3267533?v=3","gravatar_id":"","url":"https://api.github.com/users/brentpicasso","html_url":"https://github.com/brentpicasso","followers_url":"https://api.github.com/users/brentpicasso/followers","following_url":"https://api.github.com/users/brentpicasso/following{/other_user}","gists_url":"https://api.github.com/users/brentpicasso/gists{/gist_id}","starred_url":"https://api.github.com/users/brentpicasso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brentpicasso/subscriptions","organizations_url":"https://api.github.com/users/brentpicasso/orgs","repos_url":"https://api.github.com/users/brentpicasso/repos","events_url":"https://api.github.com/users/brentpicasso/events{/privacy}","received_events_url":"https://api.github.com/users/brentpicasso/received_events","type":"User","site_admin":false},"body":"In most programming languages it's considered a best practice b/c faster and also so that another thread doesn't change the member variable out from underneath you (makes the work a more atomic). I wasn't sure if python local variables are faster than members so I looked; seems like they are: http://stackoverflow.com/questions/12397984/why-is-local-variable-access-faster-than-class-member-access-in-python","created_at":"2015-02-18T16:21:14Z","updated_at":"2015-02-18T16:21:14Z","html_url":"https://github.com/autosportlabs/RaceCapture_App/pull/14#discussion_r24914249","pull_request_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/autosportlabs/RaceCapture_App/pulls/comments/24914249"},"html":{"href":"https://github.com/autosportlabs/RaceCapture_App/pull/14#discussion_r24914249"},"pull_request":{"href":"https://api.github.com/repos/autosportlabs/RaceCapture_App/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/pulls/14","id":29471301,"html_url":"https://github.com/autosportlabs/RaceCapture_App/pull/14","diff_url":"https://github.com/autosportlabs/RaceCapture_App/pull/14.diff","patch_url":"https://github.com/autosportlabs/RaceCapture_App/pull/14.patch","issue_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/issues/14","number":14,"state":"open","locked":false,"title":"V1.2.4 release candidate","user":{"login":"brentpicasso","id":3267533,"avatar_url":"https://avatars.githubusercontent.com/u/3267533?v=3","gravatar_id":"","url":"https://api.github.com/users/brentpicasso","html_url":"https://github.com/brentpicasso","followers_url":"https://api.github.com/users/brentpicasso/followers","following_url":"https://api.github.com/users/brentpicasso/following{/other_user}","gists_url":"https://api.github.com/users/brentpicasso/gists{/gist_id}","starred_url":"https://api.github.com/users/brentpicasso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brentpicasso/subscriptions","organizations_url":"https://api.github.com/users/brentpicasso/orgs","repos_url":"https://api.github.com/users/brentpicasso/repos","events_url":"https://api.github.com/users/brentpicasso/events{/privacy}","received_events_url":"https://api.github.com/users/brentpicasso/received_events","type":"User","site_admin":false},"body":"This is a combo PR that includes:\r\n\r\n- improvements to android Bluetooth processing and android behavior\r\n\r\n- introduction of filters into sample stream. Filters can modify / add to the sample stream on the fly. in this case, adding the channel 'BestLap' and 'LapDelta' needed for the dashboard pages.\r\n\r\n- Misc fixes.\r\n\r\nSorry this is a combo PR. I'll go through and annotate the changes.\r\n","created_at":"2015-02-17T19:45:04Z","updated_at":"2015-02-18T16:21:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7048658bca726d3b0bead0ba52d625ade352a6a5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/pulls/14/commits","review_comments_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/pulls/14/comments","review_comment_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/pulls/comments/{number}","comments_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/issues/14/comments","statuses_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/statuses/8e85e2378025ef31c95894b751f8958a8e207f21","head":{"label":"autosportlabs:v1.2.4_release_candidate","ref":"v1.2.4_release_candidate","sha":"8e85e2378025ef31c95894b751f8958a8e207f21","user":{"login":"autosportlabs","id":1274125,"avatar_url":"https://avatars.githubusercontent.com/u/1274125?v=3","gravatar_id":"","url":"https://api.github.com/users/autosportlabs","html_url":"https://github.com/autosportlabs","followers_url":"https://api.github.com/users/autosportlabs/followers","following_url":"https://api.github.com/users/autosportlabs/following{/other_user}","gists_url":"https://api.github.com/users/autosportlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/autosportlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autosportlabs/subscriptions","organizations_url":"https://api.github.com/users/autosportlabs/orgs","repos_url":"https://api.github.com/users/autosportlabs/repos","events_url":"https://api.github.com/users/autosportlabs/events{/privacy}","received_events_url":"https://api.github.com/users/autosportlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":17649551,"name":"RaceCapture_App","full_name":"autosportlabs/RaceCapture_App","owner":{"login":"autosportlabs","id":1274125,"avatar_url":"https://avatars.githubusercontent.com/u/1274125?v=3","gravatar_id":"","url":"https://api.github.com/users/autosportlabs","html_url":"https://github.com/autosportlabs","followers_url":"https://api.github.com/users/autosportlabs/followers","following_url":"https://api.github.com/users/autosportlabs/following{/other_user}","gists_url":"https://api.github.com/users/autosportlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/autosportlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autosportlabs/subscriptions","organizations_url":"https://api.github.com/users/autosportlabs/orgs","repos_url":"https://api.github.com/users/autosportlabs/repos","events_url":"https://api.github.com/users/autosportlabs/events{/privacy}","received_events_url":"https://api.github.com/users/autosportlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/autosportlabs/RaceCapture_App","description":"Next Generation version of the RaceCapture App","fork":false,"url":"https://api.github.com/repos/autosportlabs/RaceCapture_App","forks_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/forks","keys_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/keys{/key_id}","collaborators_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/teams","hooks_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/hooks","issue_events_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/issues/events{/number}","events_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/events","assignees_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/assignees{/user}","branches_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/branches{/branch}","tags_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/tags","blobs_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/git/refs{/sha}","trees_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/git/trees{/sha}","statuses_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/statuses/{sha}","languages_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/languages","stargazers_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/stargazers","contributors_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/contributors","subscribers_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/subscribers","subscription_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/subscription","commits_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/commits{/sha}","git_commits_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/git/commits{/sha}","comments_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/comments{/number}","issue_comment_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/issues/comments/{number}","contents_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/contents/{+path}","compare_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/compare/{base}...{head}","merges_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/merges","archive_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/downloads","issues_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/issues{/number}","pulls_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/pulls{/number}","milestones_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/milestones{/number}","notifications_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/labels{/name}","releases_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/releases{/id}","created_at":"2014-03-11T23:58:31Z","updated_at":"2015-01-30T19:59:22Z","pushed_at":"2015-02-17T23:42:27Z","git_url":"git://github.com/autosportlabs/RaceCapture_App.git","ssh_url":"git@github.com:autosportlabs/RaceCapture_App.git","clone_url":"https://github.com/autosportlabs/RaceCapture_App.git","svn_url":"https://github.com/autosportlabs/RaceCapture_App","homepage":"","size":5810,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":7,"default_branch":"master"}},"base":{"label":"autosportlabs:master","ref":"master","sha":"1eb74c710cad0f3faa0129a89d3b034e5f0aa335","user":{"login":"autosportlabs","id":1274125,"avatar_url":"https://avatars.githubusercontent.com/u/1274125?v=3","gravatar_id":"","url":"https://api.github.com/users/autosportlabs","html_url":"https://github.com/autosportlabs","followers_url":"https://api.github.com/users/autosportlabs/followers","following_url":"https://api.github.com/users/autosportlabs/following{/other_user}","gists_url":"https://api.github.com/users/autosportlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/autosportlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autosportlabs/subscriptions","organizations_url":"https://api.github.com/users/autosportlabs/orgs","repos_url":"https://api.github.com/users/autosportlabs/repos","events_url":"https://api.github.com/users/autosportlabs/events{/privacy}","received_events_url":"https://api.github.com/users/autosportlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":17649551,"name":"RaceCapture_App","full_name":"autosportlabs/RaceCapture_App","owner":{"login":"autosportlabs","id":1274125,"avatar_url":"https://avatars.githubusercontent.com/u/1274125?v=3","gravatar_id":"","url":"https://api.github.com/users/autosportlabs","html_url":"https://github.com/autosportlabs","followers_url":"https://api.github.com/users/autosportlabs/followers","following_url":"https://api.github.com/users/autosportlabs/following{/other_user}","gists_url":"https://api.github.com/users/autosportlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/autosportlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autosportlabs/subscriptions","organizations_url":"https://api.github.com/users/autosportlabs/orgs","repos_url":"https://api.github.com/users/autosportlabs/repos","events_url":"https://api.github.com/users/autosportlabs/events{/privacy}","received_events_url":"https://api.github.com/users/autosportlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/autosportlabs/RaceCapture_App","description":"Next Generation version of the RaceCapture App","fork":false,"url":"https://api.github.com/repos/autosportlabs/RaceCapture_App","forks_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/forks","keys_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/keys{/key_id}","collaborators_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/teams","hooks_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/hooks","issue_events_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/issues/events{/number}","events_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/events","assignees_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/assignees{/user}","branches_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/branches{/branch}","tags_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/tags","blobs_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/git/refs{/sha}","trees_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/git/trees{/sha}","statuses_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/statuses/{sha}","languages_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/languages","stargazers_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/stargazers","contributors_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/contributors","subscribers_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/subscribers","subscription_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/subscription","commits_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/commits{/sha}","git_commits_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/git/commits{/sha}","comments_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/comments{/number}","issue_comment_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/issues/comments/{number}","contents_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/contents/{+path}","compare_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/compare/{base}...{head}","merges_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/merges","archive_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/downloads","issues_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/issues{/number}","pulls_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/pulls{/number}","milestones_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/milestones{/number}","notifications_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/labels{/name}","releases_url":"https://api.github.com/repos/autosportlabs/RaceCapture_App/releases{/id}","created_at":"2014-03-11T23:58:31Z","updated_at":"2015-01-30T19:59:22Z","pushed_at":"2015-02-17T23:42:27Z","git_url":"git://github.com/autosportlabs/RaceCapture_App.git","ssh_url":"git@github.com:autosportlabs/RaceCapture_App.git","clone_url":"https://github.com/autosportlabs/RaceCapture_App.git","svn_url":"https://github.com/autosportlabs/RaceCapture_App","homepage":"","size":5810,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/autosportlabs/RaceCapture_App/pulls/14"},"html":{"href":"https://github.com/autosportlabs/RaceCapture_App/pull/14"},"issue":{"href":"https://api.github.com/repos/autosportlabs/RaceCapture_App/issues/14"},"comments":{"href":"https://api.github.com/repos/autosportlabs/RaceCapture_App/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/autosportlabs/RaceCapture_App/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/autosportlabs/RaceCapture_App/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/autosportlabs/RaceCapture_App/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/autosportlabs/RaceCapture_App/statuses/8e85e2378025ef31c95894b751f8958a8e207f21"}}}}