{"action":"created","comment":{"url":"https://api.github.com/repos/robotframework/robotframework/pulls/comments/234581852","pull_request_review_id":176250106,"id":234581852,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDU4MTg1Mg==","diff_hunk":"@@ -121,6 +123,47 @@ def decode_bytes_to_string(self, bytes, encoding, errors='strict'):\n             raise TypeError('Can not decode strings on Python 3.')\n         return bytes.decode(encoding, errors)\n \n+    def format_string(self, template_or_str, *positional_search_replace,\n+                      **named_search_replace):\n+        \"\"\"Formats a ``string`` using the given ``positional_search_replace``\n+        and ``named_search_replace``.\n+\n+        If the given ``string`` is a valid absolute file path, opens the file in read\n+        mode and then format its content using the given\n+        ``positional_search_replace`` and ``named_search_replace``.\n+\n+        This keyword uses python's string format. For more information see:\n+        [https://docs.python.org/library/string.html#formatstrings]|Format syntax]\n+\n+        Examples:\n+\n+        `Considering the file C:\\\\template.txt contents as \"My {test} String\"`\n+        | ${result} = | Format String | C:\\\\template.txt | | test=awesome |\n+        | Should Be Equal | ${result} | My awesome String |\n+        | ${result} = | Format String | User {} is not a admin user. | non-admin | |\n+        | Should Be Equal | ${result} | User non-admin is not a admin user. |\n+        | ${result} = | Format String | Username: {username} - Password: {password} | | username=Robot | password=Framework |\n+        | Should Be Equal | ${result} | Username: Robot - Password: Framework |\n+        | ${result} = | Format String | Document {} is missing on folder {folder} | tests.robot | folder=/home |\n+        | Should Be Equal | ${result} | Document tests.robot is missing on folder /home |\n+        | ${result} = | Format String | Uploaded file: {} should not be bigger than {}. | photo.jpg | 5MB |\n+        | Should Be Equal | ${result} | Uploaded file: photo.jpg should not be bigger than 5MB. |\n+\n+        New in Robot Framework 3.1.\n+        \"\"\"\n+        if isabs(template_or_str) and isfile(template_or_str):\n+            logger.info(\n+                'Reading template from file <a href=\"%s\">%s</a>' % (template_or_str, template_or_str),\n+                html=True)\n+            template_or_str.replace(\"/\", sep)\n+            with open(template_or_str, 'r') as format_file:\n+                format_string = format_file.read().rstrip()","path":"src/robot/libraries/String.py","position":null,"original_position":47,"commit_id":"7803d6e1a6c38124a561baa5656a2fc09f1c89e1","original_commit_id":"1c6ea0ee7e7606ceed78b39f1e44eb8342224eac","user":{"login":"elyssonmr","id":890813,"node_id":"MDQ6VXNlcjg5MDgxMw==","avatar_url":"https://avatars2.githubusercontent.com/u/890813?v=4","gravatar_id":"","url":"https://api.github.com/users/elyssonmr","html_url":"https://github.com/elyssonmr","followers_url":"https://api.github.com/users/elyssonmr/followers","following_url":"https://api.github.com/users/elyssonmr/following{/other_user}","gists_url":"https://api.github.com/users/elyssonmr/gists{/gist_id}","starred_url":"https://api.github.com/users/elyssonmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elyssonmr/subscriptions","organizations_url":"https://api.github.com/users/elyssonmr/orgs","repos_url":"https://api.github.com/users/elyssonmr/repos","events_url":"https://api.github.com/users/elyssonmr/events{/privacy}","received_events_url":"https://api.github.com/users/elyssonmr/received_events","type":"User","site_admin":false},"body":"All right, I'm removing it. But I really think people are going to have issues with new line from editors. I'm going to also add it to the documentation.","created_at":"2018-11-19T11:21:20Z","updated_at":"2018-11-19T11:21:20Z","html_url":"https://github.com/robotframework/robotframework/pull/2831#discussion_r234581852","pull_request_url":"https://api.github.com/repos/robotframework/robotframework/pulls/2831","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/robotframework/robotframework/pulls/comments/234581852"},"html":{"href":"https://github.com/robotframework/robotframework/pull/2831#discussion_r234581852"},"pull_request":{"href":"https://api.github.com/repos/robotframework/robotframework/pulls/2831"}},"in_reply_to_id":234332919},"pull_request":{"url":"https://api.github.com/repos/robotframework/robotframework/pulls/2831","id":186462831,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg2NDYyODMx","html_url":"https://github.com/robotframework/robotframework/pull/2831","diff_url":"https://github.com/robotframework/robotframework/pull/2831.diff","patch_url":"https://github.com/robotframework/robotframework/pull/2831.patch","issue_url":"https://api.github.com/repos/robotframework/robotframework/issues/2831","number":2831,"state":"open","locked":false,"title":"Add Format String Keyword","user":{"login":"elyssonmr","id":890813,"node_id":"MDQ6VXNlcjg5MDgxMw==","avatar_url":"https://avatars2.githubusercontent.com/u/890813?v=4","gravatar_id":"","url":"https://api.github.com/users/elyssonmr","html_url":"https://github.com/elyssonmr","followers_url":"https://api.github.com/users/elyssonmr/followers","following_url":"https://api.github.com/users/elyssonmr/following{/other_user}","gists_url":"https://api.github.com/users/elyssonmr/gists{/gist_id}","starred_url":"https://api.github.com/users/elyssonmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elyssonmr/subscriptions","organizations_url":"https://api.github.com/users/elyssonmr/orgs","repos_url":"https://api.github.com/users/elyssonmr/repos","events_url":"https://api.github.com/users/elyssonmr/events{/privacy}","received_events_url":"https://api.github.com/users/elyssonmr/received_events","type":"User","site_admin":false},"body":"Adds the **Format String** keyword.\r\n\r\nCloses #2822 ","created_at":"2018-05-07T20:58:22Z","updated_at":"2018-11-19T11:21:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ba8f1e0396c46229566058c2eb05a3097b6ff76","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/robotframework/robotframework/pulls/2831/commits","review_comments_url":"https://api.github.com/repos/robotframework/robotframework/pulls/2831/comments","review_comment_url":"https://api.github.com/repos/robotframework/robotframework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/robotframework/robotframework/issues/2831/comments","statuses_url":"https://api.github.com/repos/robotframework/robotframework/statuses/7803d6e1a6c38124a561baa5656a2fc09f1c89e1","head":{"label":"elyssonmr:master","ref":"master","sha":"7803d6e1a6c38124a561baa5656a2fc09f1c89e1","user":{"login":"elyssonmr","id":890813,"node_id":"MDQ6VXNlcjg5MDgxMw==","avatar_url":"https://avatars2.githubusercontent.com/u/890813?v=4","gravatar_id":"","url":"https://api.github.com/users/elyssonmr","html_url":"https://github.com/elyssonmr","followers_url":"https://api.github.com/users/elyssonmr/followers","following_url":"https://api.github.com/users/elyssonmr/following{/other_user}","gists_url":"https://api.github.com/users/elyssonmr/gists{/gist_id}","starred_url":"https://api.github.com/users/elyssonmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elyssonmr/subscriptions","organizations_url":"https://api.github.com/users/elyssonmr/orgs","repos_url":"https://api.github.com/users/elyssonmr/repos","events_url":"https://api.github.com/users/elyssonmr/events{/privacy}","received_events_url":"https://api.github.com/users/elyssonmr/received_events","type":"User","site_admin":false},"repo":{"id":131586469,"node_id":"MDEwOlJlcG9zaXRvcnkxMzE1ODY0Njk=","name":"robotframework","full_name":"elyssonmr/robotframework","private":false,"owner":{"login":"elyssonmr","id":890813,"node_id":"MDQ6VXNlcjg5MDgxMw==","avatar_url":"https://avatars2.githubusercontent.com/u/890813?v=4","gravatar_id":"","url":"https://api.github.com/users/elyssonmr","html_url":"https://github.com/elyssonmr","followers_url":"https://api.github.com/users/elyssonmr/followers","following_url":"https://api.github.com/users/elyssonmr/following{/other_user}","gists_url":"https://api.github.com/users/elyssonmr/gists{/gist_id}","starred_url":"https://api.github.com/users/elyssonmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elyssonmr/subscriptions","organizations_url":"https://api.github.com/users/elyssonmr/orgs","repos_url":"https://api.github.com/users/elyssonmr/repos","events_url":"https://api.github.com/users/elyssonmr/events{/privacy}","received_events_url":"https://api.github.com/users/elyssonmr/received_events","type":"User","site_admin":false},"html_url":"https://github.com/elyssonmr/robotframework","description":"Generic test automation framework.","fork":true,"url":"https://api.github.com/repos/elyssonmr/robotframework","forks_url":"https://api.github.com/repos/elyssonmr/robotframework/forks","keys_url":"https://api.github.com/repos/elyssonmr/robotframework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elyssonmr/robotframework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elyssonmr/robotframework/teams","hooks_url":"https://api.github.com/repos/elyssonmr/robotframework/hooks","issue_events_url":"https://api.github.com/repos/elyssonmr/robotframework/issues/events{/number}","events_url":"https://api.github.com/repos/elyssonmr/robotframework/events","assignees_url":"https://api.github.com/repos/elyssonmr/robotframework/assignees{/user}","branches_url":"https://api.github.com/repos/elyssonmr/robotframework/branches{/branch}","tags_url":"https://api.github.com/repos/elyssonmr/robotframework/tags","blobs_url":"https://api.github.com/repos/elyssonmr/robotframework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elyssonmr/robotframework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elyssonmr/robotframework/git/refs{/sha}","trees_url":"https://api.github.com/repos/elyssonmr/robotframework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elyssonmr/robotframework/statuses/{sha}","languages_url":"https://api.github.com/repos/elyssonmr/robotframework/languages","stargazers_url":"https://api.github.com/repos/elyssonmr/robotframework/stargazers","contributors_url":"https://api.github.com/repos/elyssonmr/robotframework/contributors","subscribers_url":"https://api.github.com/repos/elyssonmr/robotframework/subscribers","subscription_url":"https://api.github.com/repos/elyssonmr/robotframework/subscription","commits_url":"https://api.github.com/repos/elyssonmr/robotframework/commits{/sha}","git_commits_url":"https://api.github.com/repos/elyssonmr/robotframework/git/commits{/sha}","comments_url":"https://api.github.com/repos/elyssonmr/robotframework/comments{/number}","issue_comment_url":"https://api.github.com/repos/elyssonmr/robotframework/issues/comments{/number}","contents_url":"https://api.github.com/repos/elyssonmr/robotframework/contents/{+path}","compare_url":"https://api.github.com/repos/elyssonmr/robotframework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elyssonmr/robotframework/merges","archive_url":"https://api.github.com/repos/elyssonmr/robotframework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elyssonmr/robotframework/downloads","issues_url":"https://api.github.com/repos/elyssonmr/robotframework/issues{/number}","pulls_url":"https://api.github.com/repos/elyssonmr/robotframework/pulls{/number}","milestones_url":"https://api.github.com/repos/elyssonmr/robotframework/milestones{/number}","notifications_url":"https://api.github.com/repos/elyssonmr/robotframework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elyssonmr/robotframework/labels{/name}","releases_url":"https://api.github.com/repos/elyssonmr/robotframework/releases{/id}","deployments_url":"https://api.github.com/repos/elyssonmr/robotframework/deployments","created_at":"2018-04-30T11:14:58Z","updated_at":"2018-11-19T11:10:42Z","pushed_at":"2018-11-19T11:10:38Z","git_url":"git://github.com/elyssonmr/robotframework.git","ssh_url":"git@github.com:elyssonmr/robotframework.git","clone_url":"https://github.com/elyssonmr/robotframework.git","svn_url":"https://github.com/elyssonmr/robotframework","homepage":"http://robotframework.org","size":92662,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"robotframework:master","ref":"master","sha":"a45bb5ca1ee9fdd9dffed8d2c0f674375c8891b4","user":{"login":"robotframework","id":574284,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3NDI4NA==","avatar_url":"https://avatars0.githubusercontent.com/u/574284?v=4","gravatar_id":"","url":"https://api.github.com/users/robotframework","html_url":"https://github.com/robotframework","followers_url":"https://api.github.com/users/robotframework/followers","following_url":"https://api.github.com/users/robotframework/following{/other_user}","gists_url":"https://api.github.com/users/robotframework/gists{/gist_id}","starred_url":"https://api.github.com/users/robotframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robotframework/subscriptions","organizations_url":"https://api.github.com/users/robotframework/orgs","repos_url":"https://api.github.com/users/robotframework/repos","events_url":"https://api.github.com/users/robotframework/events{/privacy}","received_events_url":"https://api.github.com/users/robotframework/received_events","type":"Organization","site_admin":false},"repo":{"id":21273155,"node_id":"MDEwOlJlcG9zaXRvcnkyMTI3MzE1NQ==","name":"robotframework","full_name":"robotframework/robotframework","private":false,"owner":{"login":"robotframework","id":574284,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3NDI4NA==","avatar_url":"https://avatars0.githubusercontent.com/u/574284?v=4","gravatar_id":"","url":"https://api.github.com/users/robotframework","html_url":"https://github.com/robotframework","followers_url":"https://api.github.com/users/robotframework/followers","following_url":"https://api.github.com/users/robotframework/following{/other_user}","gists_url":"https://api.github.com/users/robotframework/gists{/gist_id}","starred_url":"https://api.github.com/users/robotframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robotframework/subscriptions","organizations_url":"https://api.github.com/users/robotframework/orgs","repos_url":"https://api.github.com/users/robotframework/repos","events_url":"https://api.github.com/users/robotframework/events{/privacy}","received_events_url":"https://api.github.com/users/robotframework/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/robotframework/robotframework","description":"Generic test automation framework.","fork":false,"url":"https://api.github.com/repos/robotframework/robotframework","forks_url":"https://api.github.com/repos/robotframework/robotframework/forks","keys_url":"https://api.github.com/repos/robotframework/robotframework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robotframework/robotframework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robotframework/robotframework/teams","hooks_url":"https://api.github.com/repos/robotframework/robotframework/hooks","issue_events_url":"https://api.github.com/repos/robotframework/robotframework/issues/events{/number}","events_url":"https://api.github.com/repos/robotframework/robotframework/events","assignees_url":"https://api.github.com/repos/robotframework/robotframework/assignees{/user}","branches_url":"https://api.github.com/repos/robotframework/robotframework/branches{/branch}","tags_url":"https://api.github.com/repos/robotframework/robotframework/tags","blobs_url":"https://api.github.com/repos/robotframework/robotframework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robotframework/robotframework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robotframework/robotframework/git/refs{/sha}","trees_url":"https://api.github.com/repos/robotframework/robotframework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robotframework/robotframework/statuses/{sha}","languages_url":"https://api.github.com/repos/robotframework/robotframework/languages","stargazers_url":"https://api.github.com/repos/robotframework/robotframework/stargazers","contributors_url":"https://api.github.com/repos/robotframework/robotframework/contributors","subscribers_url":"https://api.github.com/repos/robotframework/robotframework/subscribers","subscription_url":"https://api.github.com/repos/robotframework/robotframework/subscription","commits_url":"https://api.github.com/repos/robotframework/robotframework/commits{/sha}","git_commits_url":"https://api.github.com/repos/robotframework/robotframework/git/commits{/sha}","comments_url":"https://api.github.com/repos/robotframework/robotframework/comments{/number}","issue_comment_url":"https://api.github.com/repos/robotframework/robotframework/issues/comments{/number}","contents_url":"https://api.github.com/repos/robotframework/robotframework/contents/{+path}","compare_url":"https://api.github.com/repos/robotframework/robotframework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robotframework/robotframework/merges","archive_url":"https://api.github.com/repos/robotframework/robotframework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robotframework/robotframework/downloads","issues_url":"https://api.github.com/repos/robotframework/robotframework/issues{/number}","pulls_url":"https://api.github.com/repos/robotframework/robotframework/pulls{/number}","milestones_url":"https://api.github.com/repos/robotframework/robotframework/milestones{/number}","notifications_url":"https://api.github.com/repos/robotframework/robotframework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robotframework/robotframework/labels{/name}","releases_url":"https://api.github.com/repos/robotframework/robotframework/releases{/id}","deployments_url":"https://api.github.com/repos/robotframework/robotframework/deployments","created_at":"2014-06-27T11:10:38Z","updated_at":"2018-11-19T06:24:06Z","pushed_at":"2018-11-19T11:10:41Z","git_url":"git://github.com/robotframework/robotframework.git","ssh_url":"git@github.com:robotframework/robotframework.git","clone_url":"https://github.com/robotframework/robotframework.git","svn_url":"https://github.com/robotframework/robotframework","homepage":"http://robotframework.org","size":92771,"stargazers_count":2761,"watchers_count":2761,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":911,"mirror_url":null,"archived":false,"open_issues_count":137,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":911,"open_issues":137,"watchers":2761,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/robotframework/robotframework/pulls/2831"},"html":{"href":"https://github.com/robotframework/robotframework/pull/2831"},"issue":{"href":"https://api.github.com/repos/robotframework/robotframework/issues/2831"},"comments":{"href":"https://api.github.com/repos/robotframework/robotframework/issues/2831/comments"},"review_comments":{"href":"https://api.github.com/repos/robotframework/robotframework/pulls/2831/comments"},"review_comment":{"href":"https://api.github.com/repos/robotframework/robotframework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/robotframework/robotframework/pulls/2831/commits"},"statuses":{"href":"https://api.github.com/repos/robotframework/robotframework/statuses/7803d6e1a6c38124a561baa5656a2fc09f1c89e1"}},"author_association":"NONE"}}
{"actor":{"display_login":"elyssonmr"}}