{"action":"created","comment":{"url":"https://api.github.com/repos/snapcore/snapcraft/pulls/comments/71951199","id":71951199,"diff_hunk":"@@ -229,40 +229,52 @@ class Options:\n     return parts_list, after_parts\n \n \n+def _process_wiki_entry(entry, master_parts_list):\n+    try:\n+        data = yaml.load(entry)\n+    except ScannerError as e:\n+        logger.warning(\n+            'Bad wiki entry, possibly malformed YAML: {}'.format(e))\n+        return\n+\n+    part_name = data.get('project-part')\n+    if part_name is not None and part_name in master_parts_list:\n+        logger.warning(\"Duplicate part found in wiki: {}\".format(\n+            part_name))\n+        return\n+\n+    try:\n+        parts_list, after_parts = _process_entry(data)\n+    except InvalidEntryError as e:\n+        logger.warning('Invalid wiki entry: {}'.format(e))\n+        return\n+\n+    if is_valid_parts_list(parts_list, after_parts):\n+        master_parts_list.update(parts_list)\n+\n+\n def _process_index(output):\n     # XXX: This can't remain in memory if the list gets very large, but it\n     # should be okay for now.\n     master_parts_list = OrderedDict()\n \n-    output = output.strip()\n-\n     output = output.replace(b\"{{{\", b\"\").replace(b\"}}}\", b\"\")\n+    output = output.strip()\n \n     # split the wiki into an array of entries to allow the parser to\n     # proceed when invalid yaml is found.\n-    entries = output.split(b'\\n---\\n')\n-    for entry in entries:\n-        if entry != b'':\n-            try:\n-                data = yaml.load(entry)\n-            except ScannerError as e:\n-                logger.warning(\n-                    'Bad wiki entry, possibly malformed YAML: {}'.format(e))\n-\n-            part_name = data.get('project-part')\n-            if part_name is not None and part_name in master_parts_list:\n-                logger.warning(\"Duplicate part found in wiki: {}\".format(\n-                    part_name))\n-                continue\n-\n-            try:\n-                parts_list, after_parts = _process_entry(data)\n-            except InvalidEntryError as e:\n-                logger.warning('Invalid wiki entry: {}'.format(e))\n-                continue\n-\n-            if is_valid_parts_list(parts_list, after_parts):\n-                master_parts_list.update(parts_list)\n+    entry = \"\"\n+    for line in output.decode().splitlines():\n+\n+        if line == \"---\":\n+            if entry != \"\":\n+                _process_wiki_entry(entry, master_parts_list)\n+                entry = \"\"\n+        else:\n+            entry = \"\\n\".join([entry, line])\n+\n+    if entry != \"\":","path":"snapcraft/internal/parser.py","position":73,"original_position":73,"commit_id":"d4add179d7ee7cf2a721b7640e70396bc8fc5758","original_commit_id":"d4add179d7ee7cf2a721b7640e70396bc8fc5758","user":{"login":"sergiusens","id":1146853,"avatar_url":"https://avatars.githubusercontent.com/u/1146853?v=3","gravatar_id":"","url":"https://api.github.com/users/sergiusens","html_url":"https://github.com/sergiusens","followers_url":"https://api.github.com/users/sergiusens/followers","following_url":"https://api.github.com/users/sergiusens/following{/other_user}","gists_url":"https://api.github.com/users/sergiusens/gists{/gist_id}","starred_url":"https://api.github.com/users/sergiusens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergiusens/subscriptions","organizations_url":"https://api.github.com/users/sergiusens/orgs","repos_url":"https://api.github.com/users/sergiusens/repos","events_url":"https://api.github.com/users/sergiusens/events{/privacy}","received_events_url":"https://api.github.com/users/sergiusens/received_events","type":"User","site_admin":false},"body":"Just `if entry`","created_at":"2016-07-22T21:50:01Z","updated_at":"2016-07-22T21:50:01Z","html_url":"https://github.com/snapcore/snapcraft/pull/681#discussion_r71951199","pull_request_url":"https://api.github.com/repos/snapcore/snapcraft/pulls/681","_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapcraft/pulls/comments/71951199"},"html":{"href":"https://github.com/snapcore/snapcraft/pull/681#discussion_r71951199"},"pull_request":{"href":"https://api.github.com/repos/snapcore/snapcraft/pulls/681"}}},"pull_request":{"url":"https://api.github.com/repos/snapcore/snapcraft/pulls/681","id":78487122,"html_url":"https://github.com/snapcore/snapcraft/pull/681","diff_url":"https://github.com/snapcore/snapcraft/pull/681.diff","patch_url":"https://github.com/snapcore/snapcraft/pull/681.patch","issue_url":"https://api.github.com/repos/snapcore/snapcraft/issues/681","number":681,"state":"open","locked":false,"title":"parser - Add handling for carriage returns in wiki","user":{"login":"josepht","id":646088,"avatar_url":"https://avatars.githubusercontent.com/u/646088?v=3","gravatar_id":"","url":"https://api.github.com/users/josepht","html_url":"https://github.com/josepht","followers_url":"https://api.github.com/users/josepht/followers","following_url":"https://api.github.com/users/josepht/following{/other_user}","gists_url":"https://api.github.com/users/josepht/gists{/gist_id}","starred_url":"https://api.github.com/users/josepht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josepht/subscriptions","organizations_url":"https://api.github.com/users/josepht/orgs","repos_url":"https://api.github.com/users/josepht/repos","events_url":"https://api.github.com/users/josepht/events{/privacy}","received_events_url":"https://api.github.com/users/josepht/received_events","type":"User","site_admin":false},"body":"LP:#1605541","created_at":"2016-07-22T14:35:43Z","updated_at":"2016-07-22T21:50:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10cc4ad99d6abc1173bb29eb4a8b12d3bf802f30","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/snapcore/snapcraft/pulls/681/commits","review_comments_url":"https://api.github.com/repos/snapcore/snapcraft/pulls/681/comments","review_comment_url":"https://api.github.com/repos/snapcore/snapcraft/pulls/comments{/number}","comments_url":"https://api.github.com/repos/snapcore/snapcraft/issues/681/comments","statuses_url":"https://api.github.com/repos/snapcore/snapcraft/statuses/d4add179d7ee7cf2a721b7640e70396bc8fc5758","head":{"label":"josepht:bugs/1605541","ref":"bugs/1605541","sha":"d4add179d7ee7cf2a721b7640e70396bc8fc5758","user":{"login":"josepht","id":646088,"avatar_url":"https://avatars.githubusercontent.com/u/646088?v=3","gravatar_id":"","url":"https://api.github.com/users/josepht","html_url":"https://github.com/josepht","followers_url":"https://api.github.com/users/josepht/followers","following_url":"https://api.github.com/users/josepht/following{/other_user}","gists_url":"https://api.github.com/users/josepht/gists{/gist_id}","starred_url":"https://api.github.com/users/josepht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josepht/subscriptions","organizations_url":"https://api.github.com/users/josepht/orgs","repos_url":"https://api.github.com/users/josepht/repos","events_url":"https://api.github.com/users/josepht/events{/privacy}","received_events_url":"https://api.github.com/users/josepht/received_events","type":"User","site_admin":false},"repo":{"id":54208156,"name":"snapcraft","full_name":"josepht/snapcraft","owner":{"login":"josepht","id":646088,"avatar_url":"https://avatars.githubusercontent.com/u/646088?v=3","gravatar_id":"","url":"https://api.github.com/users/josepht","html_url":"https://github.com/josepht","followers_url":"https://api.github.com/users/josepht/followers","following_url":"https://api.github.com/users/josepht/following{/other_user}","gists_url":"https://api.github.com/users/josepht/gists{/gist_id}","starred_url":"https://api.github.com/users/josepht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josepht/subscriptions","organizations_url":"https://api.github.com/users/josepht/orgs","repos_url":"https://api.github.com/users/josepht/repos","events_url":"https://api.github.com/users/josepht/events{/privacy}","received_events_url":"https://api.github.com/users/josepht/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/josepht/snapcraft","description":"Snapcraft is a delightful packaging tool","fork":true,"url":"https://api.github.com/repos/josepht/snapcraft","forks_url":"https://api.github.com/repos/josepht/snapcraft/forks","keys_url":"https://api.github.com/repos/josepht/snapcraft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/josepht/snapcraft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/josepht/snapcraft/teams","hooks_url":"https://api.github.com/repos/josepht/snapcraft/hooks","issue_events_url":"https://api.github.com/repos/josepht/snapcraft/issues/events{/number}","events_url":"https://api.github.com/repos/josepht/snapcraft/events","assignees_url":"https://api.github.com/repos/josepht/snapcraft/assignees{/user}","branches_url":"https://api.github.com/repos/josepht/snapcraft/branches{/branch}","tags_url":"https://api.github.com/repos/josepht/snapcraft/tags","blobs_url":"https://api.github.com/repos/josepht/snapcraft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/josepht/snapcraft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/josepht/snapcraft/git/refs{/sha}","trees_url":"https://api.github.com/repos/josepht/snapcraft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/josepht/snapcraft/statuses/{sha}","languages_url":"https://api.github.com/repos/josepht/snapcraft/languages","stargazers_url":"https://api.github.com/repos/josepht/snapcraft/stargazers","contributors_url":"https://api.github.com/repos/josepht/snapcraft/contributors","subscribers_url":"https://api.github.com/repos/josepht/snapcraft/subscribers","subscription_url":"https://api.github.com/repos/josepht/snapcraft/subscription","commits_url":"https://api.github.com/repos/josepht/snapcraft/commits{/sha}","git_commits_url":"https://api.github.com/repos/josepht/snapcraft/git/commits{/sha}","comments_url":"https://api.github.com/repos/josepht/snapcraft/comments{/number}","issue_comment_url":"https://api.github.com/repos/josepht/snapcraft/issues/comments{/number}","contents_url":"https://api.github.com/repos/josepht/snapcraft/contents/{+path}","compare_url":"https://api.github.com/repos/josepht/snapcraft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/josepht/snapcraft/merges","archive_url":"https://api.github.com/repos/josepht/snapcraft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/josepht/snapcraft/downloads","issues_url":"https://api.github.com/repos/josepht/snapcraft/issues{/number}","pulls_url":"https://api.github.com/repos/josepht/snapcraft/pulls{/number}","milestones_url":"https://api.github.com/repos/josepht/snapcraft/milestones{/number}","notifications_url":"https://api.github.com/repos/josepht/snapcraft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/josepht/snapcraft/labels{/name}","releases_url":"https://api.github.com/repos/josepht/snapcraft/releases{/id}","deployments_url":"https://api.github.com/repos/josepht/snapcraft/deployments","created_at":"2016-03-18T14:39:09Z","updated_at":"2016-03-18T14:39:10Z","pushed_at":"2016-07-22T20:05:11Z","git_url":"git://github.com/josepht/snapcraft.git","ssh_url":"git@github.com:josepht/snapcraft.git","clone_url":"https://github.com/josepht/snapcraft.git","svn_url":"https://github.com/josepht/snapcraft","homepage":null,"size":4469,"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":"snapcore:master","ref":"master","sha":"ece292dcb307af40bd4d9301f5842ea10626a06a","user":{"login":"snapcore","id":19532717,"avatar_url":"https://avatars.githubusercontent.com/u/19532717?v=3","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"repo":{"id":45199136,"name":"snapcraft","full_name":"snapcore/snapcraft","owner":{"login":"snapcore","id":19532717,"avatar_url":"https://avatars.githubusercontent.com/u/19532717?v=3","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/snapcore/snapcraft","description":"Snapcraft is a delightful packaging tool","fork":false,"url":"https://api.github.com/repos/snapcore/snapcraft","forks_url":"https://api.github.com/repos/snapcore/snapcraft/forks","keys_url":"https://api.github.com/repos/snapcore/snapcraft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/snapcore/snapcraft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/snapcore/snapcraft/teams","hooks_url":"https://api.github.com/repos/snapcore/snapcraft/hooks","issue_events_url":"https://api.github.com/repos/snapcore/snapcraft/issues/events{/number}","events_url":"https://api.github.com/repos/snapcore/snapcraft/events","assignees_url":"https://api.github.com/repos/snapcore/snapcraft/assignees{/user}","branches_url":"https://api.github.com/repos/snapcore/snapcraft/branches{/branch}","tags_url":"https://api.github.com/repos/snapcore/snapcraft/tags","blobs_url":"https://api.github.com/repos/snapcore/snapcraft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/snapcore/snapcraft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/snapcore/snapcraft/git/refs{/sha}","trees_url":"https://api.github.com/repos/snapcore/snapcraft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/snapcore/snapcraft/statuses/{sha}","languages_url":"https://api.github.com/repos/snapcore/snapcraft/languages","stargazers_url":"https://api.github.com/repos/snapcore/snapcraft/stargazers","contributors_url":"https://api.github.com/repos/snapcore/snapcraft/contributors","subscribers_url":"https://api.github.com/repos/snapcore/snapcraft/subscribers","subscription_url":"https://api.github.com/repos/snapcore/snapcraft/subscription","commits_url":"https://api.github.com/repos/snapcore/snapcraft/commits{/sha}","git_commits_url":"https://api.github.com/repos/snapcore/snapcraft/git/commits{/sha}","comments_url":"https://api.github.com/repos/snapcore/snapcraft/comments{/number}","issue_comment_url":"https://api.github.com/repos/snapcore/snapcraft/issues/comments{/number}","contents_url":"https://api.github.com/repos/snapcore/snapcraft/contents/{+path}","compare_url":"https://api.github.com/repos/snapcore/snapcraft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/snapcore/snapcraft/merges","archive_url":"https://api.github.com/repos/snapcore/snapcraft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/snapcore/snapcraft/downloads","issues_url":"https://api.github.com/repos/snapcore/snapcraft/issues{/number}","pulls_url":"https://api.github.com/repos/snapcore/snapcraft/pulls{/number}","milestones_url":"https://api.github.com/repos/snapcore/snapcraft/milestones{/number}","notifications_url":"https://api.github.com/repos/snapcore/snapcraft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/snapcore/snapcraft/labels{/name}","releases_url":"https://api.github.com/repos/snapcore/snapcraft/releases{/id}","deployments_url":"https://api.github.com/repos/snapcore/snapcraft/deployments","created_at":"2015-10-29T17:23:15Z","updated_at":"2016-07-22T10:00:46Z","pushed_at":"2016-07-22T20:05:11Z","git_url":"git://github.com/snapcore/snapcraft.git","ssh_url":"git@github.com:snapcore/snapcraft.git","clone_url":"https://github.com/snapcore/snapcraft.git","svn_url":"https://github.com/snapcore/snapcraft","homepage":null,"size":6343,"stargazers_count":190,"watchers_count":190,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":86,"mirror_url":null,"open_issues_count":31,"forks":86,"open_issues":31,"watchers":190,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapcraft/pulls/681"},"html":{"href":"https://github.com/snapcore/snapcraft/pull/681"},"issue":{"href":"https://api.github.com/repos/snapcore/snapcraft/issues/681"},"comments":{"href":"https://api.github.com/repos/snapcore/snapcraft/issues/681/comments"},"review_comments":{"href":"https://api.github.com/repos/snapcore/snapcraft/pulls/681/comments"},"review_comment":{"href":"https://api.github.com/repos/snapcore/snapcraft/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/snapcore/snapcraft/pulls/681/commits"},"statuses":{"href":"https://api.github.com/repos/snapcore/snapcraft/statuses/d4add179d7ee7cf2a721b7640e70396bc8fc5758"}}}}
{"actor":{"display_login":"sergiusens"}}