GitHub PullRequestReviewCommentEvent at 2014-11-11 10:24:55
Repository: cookiecutter
Actor: pydanny
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/audreyr/cookiecutter/pulls/comments/20141823","id":20141823,"diff_hunk":"@@ -195,3 +197,37 @@ def generate_files(repo_dir, context=None, output_dir=\".\"):\n     # run post-gen hook from repo_dir\n     with work_in(repo_dir):\n         run_hook('post_gen_project', project_dir, context)\n+\n+\n+def generate_validation(validation_file='cookiecutter.validation.json'):\n+    \"\"\"\n+    Generates the validation for a Cookiecutter project template.\n+    Loads the JSON file as a Python object, with key being the JSON filename.\n+\n+    :param validation_file: JSON file containing key/value pairs for populating\n+        the cookiecutter's validation variables.\n+    \"\"\"\n+\n+    validation = {'cookiecutter.validation' : {}}\n+\n+    try:\n+        file_handle = open(validation_file)\n+        obj = json.load(file_handle, encoding='utf-8', object_pairs_hook=OrderedDict)\n+\n+        # Add the Python object to the validation dictionary\n+        file_name = os.path.split(validation_file)[1]\n+        file_stem = os.path.splitext(file_name)[0]\n+        validation[file_stem] = obj\n+    except Exception, msg:","path":"cookiecutter/generate.py","position":46,"original_position":46,"commit_id":"c29e6581e1fe3e5ef90dddbaa82f0f09a58da2d6","original_commit_id":"c29e6581e1fe3e5ef90dddbaa82f0f09a58da2d6","user":{"login":"pydanny","id":62857,"avatar_url":"https://avatars.githubusercontent.com/u/62857?v=3","gravatar_id":"","url":"https://api.github.com/users/pydanny","html_url":"https://github.com/pydanny","followers_url":"https://api.github.com/users/pydanny/followers","following_url":"https://api.github.com/users/pydanny/following{/other_user}","gists_url":"https://api.github.com/users/pydanny/gists{/gist_id}","starred_url":"https://api.github.com/users/pydanny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydanny/subscriptions","organizations_url":"https://api.github.com/users/pydanny/orgs","repos_url":"https://api.github.com/users/pydanny/repos","events_url":"https://api.github.com/users/pydanny/events{/privacy}","received_events_url":"https://api.github.com/users/pydanny/received_events","type":"User","site_admin":false},"body":"Also, for the sake of better multi-python compatibility, it should be `except CustomException as e` instead of `except CustomException, e`.","created_at":"2014-11-11T10:24:55Z","updated_at":"2014-11-11T10:24:55Z","html_url":"https://github.com/audreyr/cookiecutter/pull/308#discussion_r20141823","pull_request_url":"https://api.github.com/repos/audreyr/cookiecutter/pulls/308","_links":{"self":{"href":"https://api.github.com/repos/audreyr/cookiecutter/pulls/comments/20141823"},"html":{"href":"https://github.com/audreyr/cookiecutter/pull/308#discussion_r20141823"},"pull_request":{"href":"https://api.github.com/repos/audreyr/cookiecutter/pulls/308"}}},"pull_request":{"url":"https://api.github.com/repos/audreyr/cookiecutter/pulls/308","id":23896975,"html_url":"https://github.com/audreyr/cookiecutter/pull/308","diff_url":"https://github.com/audreyr/cookiecutter/pull/308.diff","patch_url":"https://github.com/audreyr/cookiecutter/pull/308.patch","issue_url":"https://api.github.com/repos/audreyr/cookiecutter/issues/308","number":308,"state":"open","locked":false,"title":" issue175 inputvalidation","user":{"login":"luismartingil","id":1906859,"avatar_url":"https://avatars.githubusercontent.com/u/1906859?v=3","gravatar_id":"","url":"https://api.github.com/users/luismartingil","html_url":"https://github.com/luismartingil","followers_url":"https://api.github.com/users/luismartingil/followers","following_url":"https://api.github.com/users/luismartingil/following{/other_user}","gists_url":"https://api.github.com/users/luismartingil/gists{/gist_id}","starred_url":"https://api.github.com/users/luismartingil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luismartingil/subscriptions","organizations_url":"https://api.github.com/users/luismartingil/orgs","repos_url":"https://api.github.com/users/luismartingil/repos","events_url":"https://api.github.com/users/luismartingil/events{/privacy}","received_events_url":"https://api.github.com/users/luismartingil/received_events","type":"User","site_admin":false},"body":"Updated pull-request to implement validation in the input as #175 ","created_at":"2014-11-05T10:39:41Z","updated_at":"2014-11-11T10:24:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba0b5783042a638489568765c6ed23df3cf2b48a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/audreyr/cookiecutter/pulls/308/commits","review_comments_url":"https://api.github.com/repos/audreyr/cookiecutter/pulls/308/comments","review_comment_url":"https://api.github.com/repos/audreyr/cookiecutter/pulls/comments/{number}","comments_url":"https://api.github.com/repos/audreyr/cookiecutter/issues/308/comments","statuses_url":"https://api.github.com/repos/audreyr/cookiecutter/statuses/c29e6581e1fe3e5ef90dddbaa82f0f09a58da2d6","head":{"label":"luismartingil:_issue175_inputvalidation","ref":"_issue175_inputvalidation","sha":"c29e6581e1fe3e5ef90dddbaa82f0f09a58da2d6","user":{"login":"luismartingil","id":1906859,"avatar_url":"https://avatars.githubusercontent.com/u/1906859?v=3","gravatar_id":"","url":"https://api.github.com/users/luismartingil","html_url":"https://github.com/luismartingil","followers_url":"https://api.github.com/users/luismartingil/followers","following_url":"https://api.github.com/users/luismartingil/following{/other_user}","gists_url":"https://api.github.com/users/luismartingil/gists{/gist_id}","starred_url":"https://api.github.com/users/luismartingil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luismartingil/subscriptions","organizations_url":"https://api.github.com/users/luismartingil/orgs","repos_url":"https://api.github.com/users/luismartingil/repos","events_url":"https://api.github.com/users/luismartingil/events{/privacy}","received_events_url":"https://api.github.com/users/luismartingil/received_events","type":"User","site_admin":false},"repo":{"id":26211703,"name":"cookiecutter","full_name":"luismartingil/cookiecutter","owner":{"login":"luismartingil","id":1906859,"avatar_url":"https://avatars.githubusercontent.com/u/1906859?v=3","gravatar_id":"","url":"https://api.github.com/users/luismartingil","html_url":"https://github.com/luismartingil","followers_url":"https://api.github.com/users/luismartingil/followers","following_url":"https://api.github.com/users/luismartingil/following{/other_user}","gists_url":"https://api.github.com/users/luismartingil/gists{/gist_id}","starred_url":"https://api.github.com/users/luismartingil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luismartingil/subscriptions","organizations_url":"https://api.github.com/users/luismartingil/orgs","repos_url":"https://api.github.com/users/luismartingil/repos","events_url":"https://api.github.com/users/luismartingil/events{/privacy}","received_events_url":"https://api.github.com/users/luismartingil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/luismartingil/cookiecutter","description":"A command-line utility that creates projects from cookiecutters (project templates). E.g. Python package projects, jQuery plugin projects.","fork":true,"url":"https://api.github.com/repos/luismartingil/cookiecutter","forks_url":"https://api.github.com/repos/luismartingil/cookiecutter/forks","keys_url":"https://api.github.com/repos/luismartingil/cookiecutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luismartingil/cookiecutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luismartingil/cookiecutter/teams","hooks_url":"https://api.github.com/repos/luismartingil/cookiecutter/hooks","issue_events_url":"https://api.github.com/repos/luismartingil/cookiecutter/issues/events{/number}","events_url":"https://api.github.com/repos/luismartingil/cookiecutter/events","assignees_url":"https://api.github.com/repos/luismartingil/cookiecutter/assignees{/user}","branches_url":"https://api.github.com/repos/luismartingil/cookiecutter/branches{/branch}","tags_url":"https://api.github.com/repos/luismartingil/cookiecutter/tags","blobs_url":"https://api.github.com/repos/luismartingil/cookiecutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luismartingil/cookiecutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luismartingil/cookiecutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/luismartingil/cookiecutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luismartingil/cookiecutter/statuses/{sha}","languages_url":"https://api.github.com/repos/luismartingil/cookiecutter/languages","stargazers_url":"https://api.github.com/repos/luismartingil/cookiecutter/stargazers","contributors_url":"https://api.github.com/repos/luismartingil/cookiecutter/contributors","subscribers_url":"https://api.github.com/repos/luismartingil/cookiecutter/subscribers","subscription_url":"https://api.github.com/repos/luismartingil/cookiecutter/subscription","commits_url":"https://api.github.com/repos/luismartingil/cookiecutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/luismartingil/cookiecutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/luismartingil/cookiecutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/luismartingil/cookiecutter/issues/comments/{number}","contents_url":"https://api.github.com/repos/luismartingil/cookiecutter/contents/{+path}","compare_url":"https://api.github.com/repos/luismartingil/cookiecutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luismartingil/cookiecutter/merges","archive_url":"https://api.github.com/repos/luismartingil/cookiecutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luismartingil/cookiecutter/downloads","issues_url":"https://api.github.com/repos/luismartingil/cookiecutter/issues{/number}","pulls_url":"https://api.github.com/repos/luismartingil/cookiecutter/pulls{/number}","milestones_url":"https://api.github.com/repos/luismartingil/cookiecutter/milestones{/number}","notifications_url":"https://api.github.com/repos/luismartingil/cookiecutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luismartingil/cookiecutter/labels{/name}","releases_url":"https://api.github.com/repos/luismartingil/cookiecutter/releases{/id}","created_at":"2014-11-05T09:09:07Z","updated_at":"2014-11-04T18:32:59Z","pushed_at":"2014-11-10T15:43:29Z","git_url":"git://github.com/luismartingil/cookiecutter.git","ssh_url":"git@github.com:luismartingil/cookiecutter.git","clone_url":"https://github.com/luismartingil/cookiecutter.git","svn_url":"https://github.com/luismartingil/cookiecutter","homepage":"","size":777,"stargazers_count":0,"watchers_count":0,"language":null,"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":"audreyr:master","ref":"master","sha":"0ed6832f7cc19905b77894cf0b7e4ac06dc72124","user":{"login":"audreyr","id":74739,"avatar_url":"https://avatars.githubusercontent.com/u/74739?v=3","gravatar_id":"","url":"https://api.github.com/users/audreyr","html_url":"https://github.com/audreyr","followers_url":"https://api.github.com/users/audreyr/followers","following_url":"https://api.github.com/users/audreyr/following{/other_user}","gists_url":"https://api.github.com/users/audreyr/gists{/gist_id}","starred_url":"https://api.github.com/users/audreyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/audreyr/subscriptions","organizations_url":"https://api.github.com/users/audreyr/orgs","repos_url":"https://api.github.com/users/audreyr/repos","events_url":"https://api.github.com/users/audreyr/events{/privacy}","received_events_url":"https://api.github.com/users/audreyr/received_events","type":"User","site_admin":false},"repo":{"id":11407242,"name":"cookiecutter","full_name":"audreyr/cookiecutter","owner":{"login":"audreyr","id":74739,"avatar_url":"https://avatars.githubusercontent.com/u/74739?v=3","gravatar_id":"","url":"https://api.github.com/users/audreyr","html_url":"https://github.com/audreyr","followers_url":"https://api.github.com/users/audreyr/followers","following_url":"https://api.github.com/users/audreyr/following{/other_user}","gists_url":"https://api.github.com/users/audreyr/gists{/gist_id}","starred_url":"https://api.github.com/users/audreyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/audreyr/subscriptions","organizations_url":"https://api.github.com/users/audreyr/orgs","repos_url":"https://api.github.com/users/audreyr/repos","events_url":"https://api.github.com/users/audreyr/events{/privacy}","received_events_url":"https://api.github.com/users/audreyr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/audreyr/cookiecutter","description":"A command-line utility that creates projects from cookiecutters (project templates). E.g. Python package projects, jQuery plugin projects.","fork":false,"url":"https://api.github.com/repos/audreyr/cookiecutter","forks_url":"https://api.github.com/repos/audreyr/cookiecutter/forks","keys_url":"https://api.github.com/repos/audreyr/cookiecutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/audreyr/cookiecutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/audreyr/cookiecutter/teams","hooks_url":"https://api.github.com/repos/audreyr/cookiecutter/hooks","issue_events_url":"https://api.github.com/repos/audreyr/cookiecutter/issues/events{/number}","events_url":"https://api.github.com/repos/audreyr/cookiecutter/events","assignees_url":"https://api.github.com/repos/audreyr/cookiecutter/assignees{/user}","branches_url":"https://api.github.com/repos/audreyr/cookiecutter/branches{/branch}","tags_url":"https://api.github.com/repos/audreyr/cookiecutter/tags","blobs_url":"https://api.github.com/repos/audreyr/cookiecutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/audreyr/cookiecutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/audreyr/cookiecutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/audreyr/cookiecutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/audreyr/cookiecutter/statuses/{sha}","languages_url":"https://api.github.com/repos/audreyr/cookiecutter/languages","stargazers_url":"https://api.github.com/repos/audreyr/cookiecutter/stargazers","contributors_url":"https://api.github.com/repos/audreyr/cookiecutter/contributors","subscribers_url":"https://api.github.com/repos/audreyr/cookiecutter/subscribers","subscription_url":"https://api.github.com/repos/audreyr/cookiecutter/subscription","commits_url":"https://api.github.com/repos/audreyr/cookiecutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/audreyr/cookiecutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/audreyr/cookiecutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/audreyr/cookiecutter/issues/comments/{number}","contents_url":"https://api.github.com/repos/audreyr/cookiecutter/contents/{+path}","compare_url":"https://api.github.com/repos/audreyr/cookiecutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/audreyr/cookiecutter/merges","archive_url":"https://api.github.com/repos/audreyr/cookiecutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/audreyr/cookiecutter/downloads","issues_url":"https://api.github.com/repos/audreyr/cookiecutter/issues{/number}","pulls_url":"https://api.github.com/repos/audreyr/cookiecutter/pulls{/number}","milestones_url":"https://api.github.com/repos/audreyr/cookiecutter/milestones{/number}","notifications_url":"https://api.github.com/repos/audreyr/cookiecutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/audreyr/cookiecutter/labels{/name}","releases_url":"https://api.github.com/repos/audreyr/cookiecutter/releases{/id}","created_at":"2013-07-14T18:31:22Z","updated_at":"2014-11-11T09:26:43Z","pushed_at":"2014-11-11T10:17:26Z","git_url":"git://github.com/audreyr/cookiecutter.git","ssh_url":"git@github.com:audreyr/cookiecutter.git","clone_url":"https://github.com/audreyr/cookiecutter.git","svn_url":"https://github.com/audreyr/cookiecutter","homepage":"","size":4308,"stargazers_count":1261,"watchers_count":1261,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":156,"mirror_url":null,"open_issues_count":99,"forks":156,"open_issues":99,"watchers":1261,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/audreyr/cookiecutter/pulls/308"},"html":{"href":"https://github.com/audreyr/cookiecutter/pull/308"},"issue":{"href":"https://api.github.com/repos/audreyr/cookiecutter/issues/308"},"comments":{"href":"https://api.github.com/repos/audreyr/cookiecutter/issues/308/comments"},"review_comments":{"href":"https://api.github.com/repos/audreyr/cookiecutter/pulls/308/comments"},"review_comment":{"href":"https://api.github.com/repos/audreyr/cookiecutter/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/audreyr/cookiecutter/pulls/308/commits"},"statuses":{"href":"https://api.github.com/repos/audreyr/cookiecutter/statuses/c29e6581e1fe3e5ef90dddbaa82f0f09a58da2d6"}}}}