{"action":"created","comment":{"url":"https://api.github.com/repos/servo/servo/pulls/comments/46772235","id":46772235,"diff_hunk":"@@ -47,16 +49,25 @@ def __init__(self):\n             'CRASH': [],\n         }\n \n+    def get_move_up_and_clear_eol_codes(self):\n+        try:\n+            import blessings\n+        except ImportError:\n+            return DEFAULT_MOVE_UP_CODE, DEFAULT_CLEAR_EOL_CODE\n+\n+        try:\n+            self.terminal = blessings.Terminal()\n+            return self.terminal.clear_eol, self.terminal.move_up\n+        except Exception as exception:\n+            sys.stderr.write(\"GroupingFormatter: Could not get terminal \"\n+                             \"control characters: %s\\n\" % exception)\n+            return DEFAULT_MOVE_UP_CODE, DEFAULT_CLEAR_EOL_CODE\n+\n     def text_to_erase_display(self):\n         if not self.interactive or not self.current_display:\n             return \"\"\n-\n-        # TODO(mrobinson, 8313): We need to add support for Windows terminals here.\n-        erase_length = len(self.current_display)\n-        if self.one_line:\n-            return \"\\b \\b\" * erase_length\n-        else:\n-            return (\"\\033[F\" + \"\\033[K\") * len(self.current_display.splitlines())\n+        return ((self.move_up + self.clear_eol) *\n+                len(self.current_display.splitlines()))","path":"tests/wpt/grouping_formatter.py","position":59,"original_position":59,"commit_id":"7225e36d8171e58d75205badeaf5ea01e64b9a76","original_commit_id":"7225e36d8171e58d75205badeaf5ea01e64b9a76","user":{"login":"jdm","id":27658,"avatar_url":"https://avatars.githubusercontent.com/u/27658?v=3","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false},"body":"I would expect splitting a constant string on a constant separator to work the same on all platforms :) The real question is given multiline string content from an external source, does it contain `\\r` that would cause difficulties when splitting on `\\n`?","created_at":"2015-12-06T16:13:18Z","updated_at":"2015-12-06T16:13:18Z","html_url":"https://github.com/servo/servo/pull/8551#discussion_r46772235","pull_request_url":"https://api.github.com/repos/servo/servo/pulls/8551","_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/comments/46772235"},"html":{"href":"https://github.com/servo/servo/pull/8551#discussion_r46772235"},"pull_request":{"href":"https://api.github.com/repos/servo/servo/pulls/8551"}}},"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/8551","id":50843518,"html_url":"https://github.com/servo/servo/pull/8551","diff_url":"https://github.com/servo/servo/pull/8551.diff","patch_url":"https://github.com/servo/servo/pull/8551.patch","issue_url":"https://api.github.com/repos/servo/servo/issues/8551","number":8551,"state":"closed","locked":false,"title":"Use blessings when possible for WPT UI","user":{"login":"mrobinson","id":13536,"avatar_url":"https://avatars.githubusercontent.com/u/13536?v=3","gravatar_id":"","url":"https://api.github.com/users/mrobinson","html_url":"https://github.com/mrobinson","followers_url":"https://api.github.com/users/mrobinson/followers","following_url":"https://api.github.com/users/mrobinson/following{/other_user}","gists_url":"https://api.github.com/users/mrobinson/gists{/gist_id}","starred_url":"https://api.github.com/users/mrobinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrobinson/subscriptions","organizations_url":"https://api.github.com/users/mrobinson/orgs","repos_url":"https://api.github.com/users/mrobinson/repos","events_url":"https://api.github.com/users/mrobinson/events{/privacy}","received_events_url":"https://api.github.com/users/mrobinson/received_events","type":"User","site_admin":false},"body":"Use blessings when it is possible for the WPT UI and fall back to using\r\nraw control characters. This also fixes a bug where the UI didn't work\r\ncorrectly in iTerm.app. Remove the one line version of the UI, since it\r\nis no longer used as the iTerm fallback.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/servo/servo/8551)\n<!-- Reviewable:end -->\n","created_at":"2015-11-16T17:58:24Z","updated_at":"2015-12-06T16:13:18Z","closed_at":"2015-11-17T18:10:11Z","merged_at":"2015-11-17T18:10:11Z","merge_commit_sha":"baa3f9f33060beffb4ce7e0fe57fc91eda40290c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/servo/servo/pulls/8551/commits","review_comments_url":"https://api.github.com/repos/servo/servo/pulls/8551/comments","review_comment_url":"https://api.github.com/repos/servo/servo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/servo/servo/issues/8551/comments","statuses_url":"https://api.github.com/repos/servo/servo/statuses/7225e36d8171e58d75205badeaf5ea01e64b9a76","head":{"label":"mrobinson:blessings","ref":"blessings","sha":"7225e36d8171e58d75205badeaf5ea01e64b9a76","user":{"login":"mrobinson","id":13536,"avatar_url":"https://avatars.githubusercontent.com/u/13536?v=3","gravatar_id":"","url":"https://api.github.com/users/mrobinson","html_url":"https://github.com/mrobinson","followers_url":"https://api.github.com/users/mrobinson/followers","following_url":"https://api.github.com/users/mrobinson/following{/other_user}","gists_url":"https://api.github.com/users/mrobinson/gists{/gist_id}","starred_url":"https://api.github.com/users/mrobinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrobinson/subscriptions","organizations_url":"https://api.github.com/users/mrobinson/orgs","repos_url":"https://api.github.com/users/mrobinson/repos","events_url":"https://api.github.com/users/mrobinson/events{/privacy}","received_events_url":"https://api.github.com/users/mrobinson/received_events","type":"User","site_admin":false},"repo":{"id":18299566,"name":"servo","full_name":"mrobinson/servo","owner":{"login":"mrobinson","id":13536,"avatar_url":"https://avatars.githubusercontent.com/u/13536?v=3","gravatar_id":"","url":"https://api.github.com/users/mrobinson","html_url":"https://github.com/mrobinson","followers_url":"https://api.github.com/users/mrobinson/followers","following_url":"https://api.github.com/users/mrobinson/following{/other_user}","gists_url":"https://api.github.com/users/mrobinson/gists{/gist_id}","starred_url":"https://api.github.com/users/mrobinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrobinson/subscriptions","organizations_url":"https://api.github.com/users/mrobinson/orgs","repos_url":"https://api.github.com/users/mrobinson/repos","events_url":"https://api.github.com/users/mrobinson/events{/privacy}","received_events_url":"https://api.github.com/users/mrobinson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrobinson/servo","description":"The Servo Browser Engine","fork":true,"url":"https://api.github.com/repos/mrobinson/servo","forks_url":"https://api.github.com/repos/mrobinson/servo/forks","keys_url":"https://api.github.com/repos/mrobinson/servo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrobinson/servo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrobinson/servo/teams","hooks_url":"https://api.github.com/repos/mrobinson/servo/hooks","issue_events_url":"https://api.github.com/repos/mrobinson/servo/issues/events{/number}","events_url":"https://api.github.com/repos/mrobinson/servo/events","assignees_url":"https://api.github.com/repos/mrobinson/servo/assignees{/user}","branches_url":"https://api.github.com/repos/mrobinson/servo/branches{/branch}","tags_url":"https://api.github.com/repos/mrobinson/servo/tags","blobs_url":"https://api.github.com/repos/mrobinson/servo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrobinson/servo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrobinson/servo/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrobinson/servo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrobinson/servo/statuses/{sha}","languages_url":"https://api.github.com/repos/mrobinson/servo/languages","stargazers_url":"https://api.github.com/repos/mrobinson/servo/stargazers","contributors_url":"https://api.github.com/repos/mrobinson/servo/contributors","subscribers_url":"https://api.github.com/repos/mrobinson/servo/subscribers","subscription_url":"https://api.github.com/repos/mrobinson/servo/subscription","commits_url":"https://api.github.com/repos/mrobinson/servo/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrobinson/servo/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrobinson/servo/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrobinson/servo/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrobinson/servo/contents/{+path}","compare_url":"https://api.github.com/repos/mrobinson/servo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrobinson/servo/merges","archive_url":"https://api.github.com/repos/mrobinson/servo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrobinson/servo/downloads","issues_url":"https://api.github.com/repos/mrobinson/servo/issues{/number}","pulls_url":"https://api.github.com/repos/mrobinson/servo/pulls{/number}","milestones_url":"https://api.github.com/repos/mrobinson/servo/milestones{/number}","notifications_url":"https://api.github.com/repos/mrobinson/servo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrobinson/servo/labels{/name}","releases_url":"https://api.github.com/repos/mrobinson/servo/releases{/id}","created_at":"2014-03-31T16:17:52Z","updated_at":"2014-07-22T08:38:26Z","pushed_at":"2015-11-28T11:06:09Z","git_url":"git://github.com/mrobinson/servo.git","ssh_url":"git@github.com:mrobinson/servo.git","clone_url":"https://github.com/mrobinson/servo.git","svn_url":"https://github.com/mrobinson/servo","homepage":"","size":151435,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":"servo:master","ref":"master","sha":"ceb72e54e469bb3811fb641e7c38f476781a5720","user":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"repo":{"id":3390243,"name":"servo","full_name":"servo/servo","owner":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/servo/servo","description":"The Servo Browser Engine","fork":false,"url":"https://api.github.com/repos/servo/servo","forks_url":"https://api.github.com/repos/servo/servo/forks","keys_url":"https://api.github.com/repos/servo/servo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/servo/servo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/servo/servo/teams","hooks_url":"https://api.github.com/repos/servo/servo/hooks","issue_events_url":"https://api.github.com/repos/servo/servo/issues/events{/number}","events_url":"https://api.github.com/repos/servo/servo/events","assignees_url":"https://api.github.com/repos/servo/servo/assignees{/user}","branches_url":"https://api.github.com/repos/servo/servo/branches{/branch}","tags_url":"https://api.github.com/repos/servo/servo/tags","blobs_url":"https://api.github.com/repos/servo/servo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/servo/servo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/servo/servo/git/refs{/sha}","trees_url":"https://api.github.com/repos/servo/servo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/servo/servo/statuses/{sha}","languages_url":"https://api.github.com/repos/servo/servo/languages","stargazers_url":"https://api.github.com/repos/servo/servo/stargazers","contributors_url":"https://api.github.com/repos/servo/servo/contributors","subscribers_url":"https://api.github.com/repos/servo/servo/subscribers","subscription_url":"https://api.github.com/repos/servo/servo/subscription","commits_url":"https://api.github.com/repos/servo/servo/commits{/sha}","git_commits_url":"https://api.github.com/repos/servo/servo/git/commits{/sha}","comments_url":"https://api.github.com/repos/servo/servo/comments{/number}","issue_comment_url":"https://api.github.com/repos/servo/servo/issues/comments{/number}","contents_url":"https://api.github.com/repos/servo/servo/contents/{+path}","compare_url":"https://api.github.com/repos/servo/servo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/servo/servo/merges","archive_url":"https://api.github.com/repos/servo/servo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/servo/servo/downloads","issues_url":"https://api.github.com/repos/servo/servo/issues{/number}","pulls_url":"https://api.github.com/repos/servo/servo/pulls{/number}","milestones_url":"https://api.github.com/repos/servo/servo/milestones{/number}","notifications_url":"https://api.github.com/repos/servo/servo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/servo/servo/labels{/name}","releases_url":"https://api.github.com/repos/servo/servo/releases{/id}","created_at":"2012-02-08T19:07:25Z","updated_at":"2015-12-06T10:20:25Z","pushed_at":"2015-12-06T15:26:30Z","git_url":"git://github.com/servo/servo.git","ssh_url":"git@github.com:servo/servo.git","clone_url":"https://github.com/servo/servo.git","svn_url":"https://github.com/servo/servo","homepage":"http://servo.org/","size":179175,"stargazers_count":5287,"watchers_count":5287,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":875,"mirror_url":null,"open_issues_count":1258,"forks":875,"open_issues":1258,"watchers":5287,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/8551"},"html":{"href":"https://github.com/servo/servo/pull/8551"},"issue":{"href":"https://api.github.com/repos/servo/servo/issues/8551"},"comments":{"href":"https://api.github.com/repos/servo/servo/issues/8551/comments"},"review_comments":{"href":"https://api.github.com/repos/servo/servo/pulls/8551/comments"},"review_comment":{"href":"https://api.github.com/repos/servo/servo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/servo/servo/pulls/8551/commits"},"statuses":{"href":"https://api.github.com/repos/servo/servo/statuses/7225e36d8171e58d75205badeaf5ea01e64b9a76"}}}}