{"action":"created","comment":{"url":"https://api.github.com/repos/vispy/vispy/pulls/comments/27226280","id":27226280,"diff_hunk":"@@ -0,0 +1,35 @@\n+# -*- coding: utf-8 -*-\n+# -----------------------------------------------------------------------------\n+# Copyright (c) 2014, Nicolas P. Rougier\n+# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n+# -----------------------------------------------------------------------------\n+import os\n+\n+\n+def find(name):\n+    \"\"\"Locate a filename into the shader library.\"\"\"\n+\n+    if os.path.exists(name):\n+        return name\n+\n+    path = os.path.dirname(__file__) or '.'\n+    filename = os.path.abspath(os.path.join(path, name))\n+    if os.path.exists(filename):\n+        return filename\n+\n+    for d in os.listdir(path):\n+        fullpath = os.path.abspath(os.path.join(path, d))\n+        if os.path.isdir(fullpath):\n+            filename = os.path.abspath(os.path.join(fullpath, name))\n+            if os.path.exists(filename):\n+                return filename\n+    return None\n+\n+\n+def get(name):\n+    \"\"\"Retrieve code from the given filename.\"\"\"\n+\n+    filename = find(name)\n+    if filename is None:\n+        return name\n+    return open(filename).read()","path":"vispy/glsl/__init__.py","position":35,"original_position":35,"commit_id":"044afc783966ee988c70f79e1431bdba37f28dd0","original_commit_id":"eeb1ce95e20441e215c8c9b45d386c6c1f509192","user":{"login":"Eric89GXL","id":2365790,"avatar_url":"https://avatars.githubusercontent.com/u/2365790?v=3","gravatar_id":"","url":"https://api.github.com/users/Eric89GXL","html_url":"https://github.com/Eric89GXL","followers_url":"https://api.github.com/users/Eric89GXL/followers","following_url":"https://api.github.com/users/Eric89GXL/following{/other_user}","gists_url":"https://api.github.com/users/Eric89GXL/gists{/gist_id}","starred_url":"https://api.github.com/users/Eric89GXL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eric89GXL/subscriptions","organizations_url":"https://api.github.com/users/Eric89GXL/orgs","repos_url":"https://api.github.com/users/Eric89GXL/repos","events_url":"https://api.github.com/users/Eric89GXL/events{/privacy}","received_events_url":"https://api.github.com/users/Eric89GXL/received_events","type":"User","site_admin":false},"body":"this will leak file descriptors, use:\r\n```\r\nwith open(filename) as fid:\r\n    return fid.read()\r\n```","created_at":"2015-03-26T15:56:23Z","updated_at":"2015-03-26T15:56:24Z","html_url":"https://github.com/vispy/vispy/pull/788#discussion_r27226280","pull_request_url":"https://api.github.com/repos/vispy/vispy/pulls/788","_links":{"self":{"href":"https://api.github.com/repos/vispy/vispy/pulls/comments/27226280"},"html":{"href":"https://github.com/vispy/vispy/pull/788#discussion_r27226280"},"pull_request":{"href":"https://api.github.com/repos/vispy/vispy/pulls/788"}}},"pull_request":{"url":"https://api.github.com/repos/vispy/vispy/pulls/788","id":32012733,"html_url":"https://github.com/vispy/vispy/pull/788","diff_url":"https://github.com/vispy/vispy/pull/788.diff","patch_url":"https://github.com/vispy/vispy/pull/788.patch","issue_url":"https://api.github.com/repos/vispy/vispy/issues/788","number":788,"state":"open","locked":false,"title":"[WIP] Collections rebased","user":{"login":"rossant","id":1942359,"avatar_url":"https://avatars.githubusercontent.com/u/1942359?v=3","gravatar_id":"","url":"https://api.github.com/users/rossant","html_url":"https://github.com/rossant","followers_url":"https://api.github.com/users/rossant/followers","following_url":"https://api.github.com/users/rossant/following{/other_user}","gists_url":"https://api.github.com/users/rossant/gists{/gist_id}","starred_url":"https://api.github.com/users/rossant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossant/subscriptions","organizations_url":"https://api.github.com/users/rossant/orgs","repos_url":"https://api.github.com/users/rossant/repos","events_url":"https://api.github.com/users/rossant/events{/privacy}","received_events_url":"https://api.github.com/users/rossant/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-26T12:28:58Z","updated_at":"2015-03-26T15:56:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c2fc3c8643e4634f6372d923cf7baa246531586","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vispy/vispy/pulls/788/commits","review_comments_url":"https://api.github.com/repos/vispy/vispy/pulls/788/comments","review_comment_url":"https://api.github.com/repos/vispy/vispy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vispy/vispy/issues/788/comments","statuses_url":"https://api.github.com/repos/vispy/vispy/statuses/044afc783966ee988c70f79e1431bdba37f28dd0","head":{"label":"rossant:collections-rebase-cyrille","ref":"collections-rebase-cyrille","sha":"044afc783966ee988c70f79e1431bdba37f28dd0","user":{"login":"rossant","id":1942359,"avatar_url":"https://avatars.githubusercontent.com/u/1942359?v=3","gravatar_id":"","url":"https://api.github.com/users/rossant","html_url":"https://github.com/rossant","followers_url":"https://api.github.com/users/rossant/followers","following_url":"https://api.github.com/users/rossant/following{/other_user}","gists_url":"https://api.github.com/users/rossant/gists{/gist_id}","starred_url":"https://api.github.com/users/rossant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossant/subscriptions","organizations_url":"https://api.github.com/users/rossant/orgs","repos_url":"https://api.github.com/users/rossant/repos","events_url":"https://api.github.com/users/rossant/events{/privacy}","received_events_url":"https://api.github.com/users/rossant/received_events","type":"User","site_admin":false},"repo":{"id":20727406,"name":"vispy","full_name":"rossant/vispy","owner":{"login":"rossant","id":1942359,"avatar_url":"https://avatars.githubusercontent.com/u/1942359?v=3","gravatar_id":"","url":"https://api.github.com/users/rossant","html_url":"https://github.com/rossant","followers_url":"https://api.github.com/users/rossant/followers","following_url":"https://api.github.com/users/rossant/following{/other_user}","gists_url":"https://api.github.com/users/rossant/gists{/gist_id}","starred_url":"https://api.github.com/users/rossant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossant/subscriptions","organizations_url":"https://api.github.com/users/rossant/orgs","repos_url":"https://api.github.com/users/rossant/repos","events_url":"https://api.github.com/users/rossant/events{/privacy}","received_events_url":"https://api.github.com/users/rossant/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rossant/vispy","description":"Main repository for Vispy","fork":true,"url":"https://api.github.com/repos/rossant/vispy","forks_url":"https://api.github.com/repos/rossant/vispy/forks","keys_url":"https://api.github.com/repos/rossant/vispy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rossant/vispy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rossant/vispy/teams","hooks_url":"https://api.github.com/repos/rossant/vispy/hooks","issue_events_url":"https://api.github.com/repos/rossant/vispy/issues/events{/number}","events_url":"https://api.github.com/repos/rossant/vispy/events","assignees_url":"https://api.github.com/repos/rossant/vispy/assignees{/user}","branches_url":"https://api.github.com/repos/rossant/vispy/branches{/branch}","tags_url":"https://api.github.com/repos/rossant/vispy/tags","blobs_url":"https://api.github.com/repos/rossant/vispy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rossant/vispy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rossant/vispy/git/refs{/sha}","trees_url":"https://api.github.com/repos/rossant/vispy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rossant/vispy/statuses/{sha}","languages_url":"https://api.github.com/repos/rossant/vispy/languages","stargazers_url":"https://api.github.com/repos/rossant/vispy/stargazers","contributors_url":"https://api.github.com/repos/rossant/vispy/contributors","subscribers_url":"https://api.github.com/repos/rossant/vispy/subscribers","subscription_url":"https://api.github.com/repos/rossant/vispy/subscription","commits_url":"https://api.github.com/repos/rossant/vispy/commits{/sha}","git_commits_url":"https://api.github.com/repos/rossant/vispy/git/commits{/sha}","comments_url":"https://api.github.com/repos/rossant/vispy/comments{/number}","issue_comment_url":"https://api.github.com/repos/rossant/vispy/issues/comments{/number}","contents_url":"https://api.github.com/repos/rossant/vispy/contents/{+path}","compare_url":"https://api.github.com/repos/rossant/vispy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rossant/vispy/merges","archive_url":"https://api.github.com/repos/rossant/vispy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rossant/vispy/downloads","issues_url":"https://api.github.com/repos/rossant/vispy/issues{/number}","pulls_url":"https://api.github.com/repos/rossant/vispy/pulls{/number}","milestones_url":"https://api.github.com/repos/rossant/vispy/milestones{/number}","notifications_url":"https://api.github.com/repos/rossant/vispy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rossant/vispy/labels{/name}","releases_url":"https://api.github.com/repos/rossant/vispy/releases{/id}","created_at":"2014-06-11T14:07:00Z","updated_at":"2015-03-24T15:36:55Z","pushed_at":"2015-03-26T15:55:55Z","git_url":"git://github.com/rossant/vispy.git","ssh_url":"git@github.com:rossant/vispy.git","clone_url":"https://github.com/rossant/vispy.git","svn_url":"https://github.com/rossant/vispy","homepage":"","size":7811,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"vispy:master","ref":"master","sha":"c117e6635aa6d349211fbf8b5e96344a2cb2dcd7","user":{"login":"vispy","id":3934254,"avatar_url":"https://avatars.githubusercontent.com/u/3934254?v=3","gravatar_id":"","url":"https://api.github.com/users/vispy","html_url":"https://github.com/vispy","followers_url":"https://api.github.com/users/vispy/followers","following_url":"https://api.github.com/users/vispy/following{/other_user}","gists_url":"https://api.github.com/users/vispy/gists{/gist_id}","starred_url":"https://api.github.com/users/vispy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vispy/subscriptions","organizations_url":"https://api.github.com/users/vispy/orgs","repos_url":"https://api.github.com/users/vispy/repos","events_url":"https://api.github.com/users/vispy/events{/privacy}","received_events_url":"https://api.github.com/users/vispy/received_events","type":"Organization","site_admin":false},"repo":{"id":8935948,"name":"vispy","full_name":"vispy/vispy","owner":{"login":"vispy","id":3934254,"avatar_url":"https://avatars.githubusercontent.com/u/3934254?v=3","gravatar_id":"","url":"https://api.github.com/users/vispy","html_url":"https://github.com/vispy","followers_url":"https://api.github.com/users/vispy/followers","following_url":"https://api.github.com/users/vispy/following{/other_user}","gists_url":"https://api.github.com/users/vispy/gists{/gist_id}","starred_url":"https://api.github.com/users/vispy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vispy/subscriptions","organizations_url":"https://api.github.com/users/vispy/orgs","repos_url":"https://api.github.com/users/vispy/repos","events_url":"https://api.github.com/users/vispy/events{/privacy}","received_events_url":"https://api.github.com/users/vispy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vispy/vispy","description":"Main repository for Vispy","fork":false,"url":"https://api.github.com/repos/vispy/vispy","forks_url":"https://api.github.com/repos/vispy/vispy/forks","keys_url":"https://api.github.com/repos/vispy/vispy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vispy/vispy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vispy/vispy/teams","hooks_url":"https://api.github.com/repos/vispy/vispy/hooks","issue_events_url":"https://api.github.com/repos/vispy/vispy/issues/events{/number}","events_url":"https://api.github.com/repos/vispy/vispy/events","assignees_url":"https://api.github.com/repos/vispy/vispy/assignees{/user}","branches_url":"https://api.github.com/repos/vispy/vispy/branches{/branch}","tags_url":"https://api.github.com/repos/vispy/vispy/tags","blobs_url":"https://api.github.com/repos/vispy/vispy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vispy/vispy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vispy/vispy/git/refs{/sha}","trees_url":"https://api.github.com/repos/vispy/vispy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vispy/vispy/statuses/{sha}","languages_url":"https://api.github.com/repos/vispy/vispy/languages","stargazers_url":"https://api.github.com/repos/vispy/vispy/stargazers","contributors_url":"https://api.github.com/repos/vispy/vispy/contributors","subscribers_url":"https://api.github.com/repos/vispy/vispy/subscribers","subscription_url":"https://api.github.com/repos/vispy/vispy/subscription","commits_url":"https://api.github.com/repos/vispy/vispy/commits{/sha}","git_commits_url":"https://api.github.com/repos/vispy/vispy/git/commits{/sha}","comments_url":"https://api.github.com/repos/vispy/vispy/comments{/number}","issue_comment_url":"https://api.github.com/repos/vispy/vispy/issues/comments{/number}","contents_url":"https://api.github.com/repos/vispy/vispy/contents/{+path}","compare_url":"https://api.github.com/repos/vispy/vispy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vispy/vispy/merges","archive_url":"https://api.github.com/repos/vispy/vispy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vispy/vispy/downloads","issues_url":"https://api.github.com/repos/vispy/vispy/issues{/number}","pulls_url":"https://api.github.com/repos/vispy/vispy/pulls{/number}","milestones_url":"https://api.github.com/repos/vispy/vispy/milestones{/number}","notifications_url":"https://api.github.com/repos/vispy/vispy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vispy/vispy/labels{/name}","releases_url":"https://api.github.com/repos/vispy/vispy/releases{/id}","created_at":"2013-03-21T18:43:22Z","updated_at":"2015-03-26T15:36:32Z","pushed_at":"2015-03-26T15:55:56Z","git_url":"git://github.com/vispy/vispy.git","ssh_url":"git@github.com:vispy/vispy.git","clone_url":"https://github.com/vispy/vispy.git","svn_url":"https://github.com/vispy/vispy","homepage":"http://vispy.org","size":16043,"stargazers_count":516,"watchers_count":516,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":89,"mirror_url":null,"open_issues_count":133,"forks":89,"open_issues":133,"watchers":516,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vispy/vispy/pulls/788"},"html":{"href":"https://github.com/vispy/vispy/pull/788"},"issue":{"href":"https://api.github.com/repos/vispy/vispy/issues/788"},"comments":{"href":"https://api.github.com/repos/vispy/vispy/issues/788/comments"},"review_comments":{"href":"https://api.github.com/repos/vispy/vispy/pulls/788/comments"},"review_comment":{"href":"https://api.github.com/repos/vispy/vispy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vispy/vispy/pulls/788/commits"},"statuses":{"href":"https://api.github.com/repos/vispy/vispy/statuses/044afc783966ee988c70f79e1431bdba37f28dd0"}}}}