{"action":"created","comment":{"url":"https://api.github.com/repos/datalad/datalad/pulls/comments/86142228","pull_request_review_id":6813992,"id":86142228,"diff_hunk":"@@ -0,0 +1,52 @@\n+# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-\n+# ex: set sts=4 ts=4 sw=4 noet:\n+# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##\n+#\n+#   See COPYING file distributed along with the datalad package for the\n+#   copyright and license terms.\n+#\n+# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##\n+\"\"\"Parser for generic file-based information (mime types, etc...)\n+\"\"\"\n+\n+from datalad.metadata import _get_base_metadata_dict\n+from datalad.support.annexrepo import AnnexRepo\n+from datalad.metadata.parsers.base import BaseMetadataParser\n+\n+\n+class MetadataParser(BaseMetadataParser):\n+    _metadata_compliance = \"http://docs.datalad.org/metadata.html#v0-1\"\n+    cfg_section = 'datalad.metadata.parser.fileinfo.report'\n+\n+    def has_metadata(self):\n+        # could check if there is at least one annexed file, but hey...\n+        repo = self.ds.repo\n+        return repo and isinstance(repo, AnnexRepo)\n+\n+    def get_metadata(self, dsid=None, full=False):\n+        meta = []\n+        ds_meta = _get_base_metadata_dict(dsid)\n+        parts = []\n+        if not self.has_metadata():\n+            return meta\n+        # shortcuts\n+        cfg = self.ds.config\n+        repo = self.ds.repo\n+        cfg_section = self.cfg_section\n+        files = repo.get_annexed_files()\n+        # TODO RF to do this with one annex call","path":"datalad/metadata/parsers/fileinfo.py","position":37,"original_position":37,"commit_id":"213bbf84e9d9e5a0eacf150554fd8aad0f4e0955","original_commit_id":"213bbf84e9d9e5a0eacf150554fd8aad0f4e0955","user":{"login":"bpoldrack","id":10498301,"avatar_url":"https://avatars.githubusercontent.com/u/10498301?v=3","gravatar_id":"","url":"https://api.github.com/users/bpoldrack","html_url":"https://github.com/bpoldrack","followers_url":"https://api.github.com/users/bpoldrack/followers","following_url":"https://api.github.com/users/bpoldrack/following{/other_user}","gists_url":"https://api.github.com/users/bpoldrack/gists{/gist_id}","starred_url":"https://api.github.com/users/bpoldrack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bpoldrack/subscriptions","organizations_url":"https://api.github.com/users/bpoldrack/orgs","repos_url":"https://api.github.com/users/bpoldrack/repos","events_url":"https://api.github.com/users/bpoldrack/events{/privacy}","received_events_url":"https://api.github.com/users/bpoldrack/received_events","type":"User","site_admin":false},"body":"Note: For this TODO, an issue would be nice, telling that we need AnnexRepo.get_file_key() to work on a list and in \"batch mode\". ","created_at":"2016-11-02T13:40:09Z","updated_at":"2016-11-02T13:40:09Z","html_url":"https://github.com/datalad/datalad/pull/1077#discussion_r86142228","pull_request_url":"https://api.github.com/repos/datalad/datalad/pulls/1077","_links":{"self":{"href":"https://api.github.com/repos/datalad/datalad/pulls/comments/86142228"},"html":{"href":"https://github.com/datalad/datalad/pull/1077#discussion_r86142228"},"pull_request":{"href":"https://api.github.com/repos/datalad/datalad/pulls/1077"}}},"pull_request":{"url":"https://api.github.com/repos/datalad/datalad/pulls/1077","id":91846276,"html_url":"https://github.com/datalad/datalad/pull/1077","diff_url":"https://github.com/datalad/datalad/pull/1077.diff","patch_url":"https://github.com/datalad/datalad/pull/1077.patch","issue_url":"https://api.github.com/repos/datalad/datalad/issues/1077","number":1077,"state":"open","locked":false,"title":"Explore file-based metadata","user":{"login":"mih","id":136479,"avatar_url":"https://avatars.githubusercontent.com/u/136479?v=3","gravatar_id":"","url":"https://api.github.com/users/mih","html_url":"https://github.com/mih","followers_url":"https://api.github.com/users/mih/followers","following_url":"https://api.github.com/users/mih/following{/other_user}","gists_url":"https://api.github.com/users/mih/gists{/gist_id}","starred_url":"https://api.github.com/users/mih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mih/subscriptions","organizations_url":"https://api.github.com/users/mih/orgs","repos_url":"https://api.github.com/users/mih/repos","events_url":"https://api.github.com/users/mih/events{/privacy}","received_events_url":"https://api.github.com/users/mih/received_events","type":"User","site_admin":false},"body":"At present just playing with toys to explore the problem space. \r\n\r\nLives on top of #1074 for now.","created_at":"2016-11-01T19:20:20Z","updated_at":"2016-11-02T13:40:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c0d5d2f401bbaa4b7ec699cc4df208c97b2d4d8c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/datalad/datalad/pulls/1077/commits","review_comments_url":"https://api.github.com/repos/datalad/datalad/pulls/1077/comments","review_comment_url":"https://api.github.com/repos/datalad/datalad/pulls/comments{/number}","comments_url":"https://api.github.com/repos/datalad/datalad/issues/1077/comments","statuses_url":"https://api.github.com/repos/datalad/datalad/statuses/213bbf84e9d9e5a0eacf150554fd8aad0f4e0955","head":{"label":"mih:nf-filemetadata","ref":"nf-filemetadata","sha":"213bbf84e9d9e5a0eacf150554fd8aad0f4e0955","user":{"login":"mih","id":136479,"avatar_url":"https://avatars.githubusercontent.com/u/136479?v=3","gravatar_id":"","url":"https://api.github.com/users/mih","html_url":"https://github.com/mih","followers_url":"https://api.github.com/users/mih/followers","following_url":"https://api.github.com/users/mih/following{/other_user}","gists_url":"https://api.github.com/users/mih/gists{/gist_id}","starred_url":"https://api.github.com/users/mih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mih/subscriptions","organizations_url":"https://api.github.com/users/mih/orgs","repos_url":"https://api.github.com/users/mih/repos","events_url":"https://api.github.com/users/mih/events{/privacy}","received_events_url":"https://api.github.com/users/mih/received_events","type":"User","site_admin":false},"repo":{"id":34503646,"name":"datalad","full_name":"mih/datalad","owner":{"login":"mih","id":136479,"avatar_url":"https://avatars.githubusercontent.com/u/136479?v=3","gravatar_id":"","url":"https://api.github.com/users/mih","html_url":"https://github.com/mih","followers_url":"https://api.github.com/users/mih/followers","following_url":"https://api.github.com/users/mih/following{/other_user}","gists_url":"https://api.github.com/users/mih/gists{/gist_id}","starred_url":"https://api.github.com/users/mih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mih/subscriptions","organizations_url":"https://api.github.com/users/mih/orgs","repos_url":"https://api.github.com/users/mih/repos","events_url":"https://api.github.com/users/mih/events{/privacy}","received_events_url":"https://api.github.com/users/mih/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mih/datalad","description":"Keep scientific data under control by git  and git-annex","fork":true,"url":"https://api.github.com/repos/mih/datalad","forks_url":"https://api.github.com/repos/mih/datalad/forks","keys_url":"https://api.github.com/repos/mih/datalad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mih/datalad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mih/datalad/teams","hooks_url":"https://api.github.com/repos/mih/datalad/hooks","issue_events_url":"https://api.github.com/repos/mih/datalad/issues/events{/number}","events_url":"https://api.github.com/repos/mih/datalad/events","assignees_url":"https://api.github.com/repos/mih/datalad/assignees{/user}","branches_url":"https://api.github.com/repos/mih/datalad/branches{/branch}","tags_url":"https://api.github.com/repos/mih/datalad/tags","blobs_url":"https://api.github.com/repos/mih/datalad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mih/datalad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mih/datalad/git/refs{/sha}","trees_url":"https://api.github.com/repos/mih/datalad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mih/datalad/statuses/{sha}","languages_url":"https://api.github.com/repos/mih/datalad/languages","stargazers_url":"https://api.github.com/repos/mih/datalad/stargazers","contributors_url":"https://api.github.com/repos/mih/datalad/contributors","subscribers_url":"https://api.github.com/repos/mih/datalad/subscribers","subscription_url":"https://api.github.com/repos/mih/datalad/subscription","commits_url":"https://api.github.com/repos/mih/datalad/commits{/sha}","git_commits_url":"https://api.github.com/repos/mih/datalad/git/commits{/sha}","comments_url":"https://api.github.com/repos/mih/datalad/comments{/number}","issue_comment_url":"https://api.github.com/repos/mih/datalad/issues/comments{/number}","contents_url":"https://api.github.com/repos/mih/datalad/contents/{+path}","compare_url":"https://api.github.com/repos/mih/datalad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mih/datalad/merges","archive_url":"https://api.github.com/repos/mih/datalad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mih/datalad/downloads","issues_url":"https://api.github.com/repos/mih/datalad/issues{/number}","pulls_url":"https://api.github.com/repos/mih/datalad/pulls{/number}","milestones_url":"https://api.github.com/repos/mih/datalad/milestones{/number}","notifications_url":"https://api.github.com/repos/mih/datalad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mih/datalad/labels{/name}","releases_url":"https://api.github.com/repos/mih/datalad/releases{/id}","deployments_url":"https://api.github.com/repos/mih/datalad/deployments","created_at":"2015-04-24T07:11:39Z","updated_at":"2016-02-23T15:27:28Z","pushed_at":"2016-11-02T12:14:24Z","git_url":"git://github.com/mih/datalad.git","ssh_url":"git@github.com:mih/datalad.git","clone_url":"https://github.com/mih/datalad.git","svn_url":"https://github.com/mih/datalad","homepage":null,"size":6707,"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":"datalad:rf-metadata","ref":"rf-metadata","sha":"a00c7e1da511f8333db2305728991773183da47c","user":{"login":"datalad","id":8927200,"avatar_url":"https://avatars.githubusercontent.com/u/8927200?v=3","gravatar_id":"","url":"https://api.github.com/users/datalad","html_url":"https://github.com/datalad","followers_url":"https://api.github.com/users/datalad/followers","following_url":"https://api.github.com/users/datalad/following{/other_user}","gists_url":"https://api.github.com/users/datalad/gists{/gist_id}","starred_url":"https://api.github.com/users/datalad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datalad/subscriptions","organizations_url":"https://api.github.com/users/datalad/orgs","repos_url":"https://api.github.com/users/datalad/repos","events_url":"https://api.github.com/users/datalad/events{/privacy}","received_events_url":"https://api.github.com/users/datalad/received_events","type":"Organization","site_admin":false},"repo":{"id":14052034,"name":"datalad","full_name":"datalad/datalad","owner":{"login":"datalad","id":8927200,"avatar_url":"https://avatars.githubusercontent.com/u/8927200?v=3","gravatar_id":"","url":"https://api.github.com/users/datalad","html_url":"https://github.com/datalad","followers_url":"https://api.github.com/users/datalad/followers","following_url":"https://api.github.com/users/datalad/following{/other_user}","gists_url":"https://api.github.com/users/datalad/gists{/gist_id}","starred_url":"https://api.github.com/users/datalad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datalad/subscriptions","organizations_url":"https://api.github.com/users/datalad/orgs","repos_url":"https://api.github.com/users/datalad/repos","events_url":"https://api.github.com/users/datalad/events{/privacy}","received_events_url":"https://api.github.com/users/datalad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datalad/datalad","description":"Keep scientific data under control with git  and git-annex","fork":false,"url":"https://api.github.com/repos/datalad/datalad","forks_url":"https://api.github.com/repos/datalad/datalad/forks","keys_url":"https://api.github.com/repos/datalad/datalad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datalad/datalad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datalad/datalad/teams","hooks_url":"https://api.github.com/repos/datalad/datalad/hooks","issue_events_url":"https://api.github.com/repos/datalad/datalad/issues/events{/number}","events_url":"https://api.github.com/repos/datalad/datalad/events","assignees_url":"https://api.github.com/repos/datalad/datalad/assignees{/user}","branches_url":"https://api.github.com/repos/datalad/datalad/branches{/branch}","tags_url":"https://api.github.com/repos/datalad/datalad/tags","blobs_url":"https://api.github.com/repos/datalad/datalad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datalad/datalad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datalad/datalad/git/refs{/sha}","trees_url":"https://api.github.com/repos/datalad/datalad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datalad/datalad/statuses/{sha}","languages_url":"https://api.github.com/repos/datalad/datalad/languages","stargazers_url":"https://api.github.com/repos/datalad/datalad/stargazers","contributors_url":"https://api.github.com/repos/datalad/datalad/contributors","subscribers_url":"https://api.github.com/repos/datalad/datalad/subscribers","subscription_url":"https://api.github.com/repos/datalad/datalad/subscription","commits_url":"https://api.github.com/repos/datalad/datalad/commits{/sha}","git_commits_url":"https://api.github.com/repos/datalad/datalad/git/commits{/sha}","comments_url":"https://api.github.com/repos/datalad/datalad/comments{/number}","issue_comment_url":"https://api.github.com/repos/datalad/datalad/issues/comments{/number}","contents_url":"https://api.github.com/repos/datalad/datalad/contents/{+path}","compare_url":"https://api.github.com/repos/datalad/datalad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datalad/datalad/merges","archive_url":"https://api.github.com/repos/datalad/datalad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datalad/datalad/downloads","issues_url":"https://api.github.com/repos/datalad/datalad/issues{/number}","pulls_url":"https://api.github.com/repos/datalad/datalad/pulls{/number}","milestones_url":"https://api.github.com/repos/datalad/datalad/milestones{/number}","notifications_url":"https://api.github.com/repos/datalad/datalad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datalad/datalad/labels{/name}","releases_url":"https://api.github.com/repos/datalad/datalad/releases{/id}","deployments_url":"https://api.github.com/repos/datalad/datalad/deployments","created_at":"2013-11-01T19:40:08Z","updated_at":"2016-10-25T12:35:22Z","pushed_at":"2016-11-02T12:17:13Z","git_url":"git://github.com/datalad/datalad.git","ssh_url":"git@github.com:datalad/datalad.git","clone_url":"https://github.com/datalad/datalad.git","svn_url":"https://github.com/datalad/datalad","homepage":"http://datalad.org","size":10339,"stargazers_count":43,"watchers_count":43,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":228,"forks":10,"open_issues":228,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/datalad/datalad/pulls/1077"},"html":{"href":"https://github.com/datalad/datalad/pull/1077"},"issue":{"href":"https://api.github.com/repos/datalad/datalad/issues/1077"},"comments":{"href":"https://api.github.com/repos/datalad/datalad/issues/1077/comments"},"review_comments":{"href":"https://api.github.com/repos/datalad/datalad/pulls/1077/comments"},"review_comment":{"href":"https://api.github.com/repos/datalad/datalad/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/datalad/datalad/pulls/1077/commits"},"statuses":{"href":"https://api.github.com/repos/datalad/datalad/statuses/213bbf84e9d9e5a0eacf150554fd8aad0f4e0955"}}}}
{"actor":{"display_login":"bpoldrack"}}