{"action":"created","comment":{"url":"https://api.github.com/repos/translate/pootle/pulls/comments/49325997","id":49325997,"diff_hunk":"@@ -49,6 +50,115 @@\n from .utils.json import PootleJSONEncoder\n \n \n+class PathRegex(object):\n+\n+    language_regex = r\"[a-zA-Z0-9\\-\\_]*\"\n+    project_regex = r\"[a-zA-Z0-9\\-\\_]*\"\n+\n+    @property\n+    def regex(self):\n+        if not (self.project_code or self.language_code):\n+            return None\n+        regex = r\"^/\"\n+\n+        if self.language_code:\n+            regex = r\"%s%s/\" % (regex, self.language_code)","path":"pootle/core/views.py","position":33,"original_position":33,"commit_id":"03616aed4780ac889b4276473280ec3e1bfc2214","original_commit_id":"03616aed4780ac889b4276473280ec3e1bfc2214","user":{"login":"phlax","id":454682,"avatar_url":"https://avatars.githubusercontent.com/u/454682?v=3","gravatar_id":"","url":"https://api.github.com/users/phlax","html_url":"https://github.com/phlax","followers_url":"https://api.github.com/users/phlax/followers","following_url":"https://api.github.com/users/phlax/following{/other_user}","gists_url":"https://api.github.com/users/phlax/gists{/gist_id}","starred_url":"https://api.github.com/users/phlax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phlax/subscriptions","organizations_url":"https://api.github.com/users/phlax/orgs","repos_url":"https://api.github.com/users/phlax/repos","events_url":"https://api.github.com/users/phlax/events{/privacy}","received_events_url":"https://api.github.com/users/phlax/received_events","type":"User","site_admin":false},"body":"not sure  i agree","created_at":"2016-01-11T14:29:18Z","updated_at":"2016-01-11T14:29:18Z","html_url":"https://github.com/translate/pootle/pull/4317#discussion_r49325997","pull_request_url":"https://api.github.com/repos/translate/pootle/pulls/4317","_links":{"self":{"href":"https://api.github.com/repos/translate/pootle/pulls/comments/49325997"},"html":{"href":"https://github.com/translate/pootle/pull/4317#discussion_r49325997"},"pull_request":{"href":"https://api.github.com/repos/translate/pootle/pulls/4317"}}},"pull_request":{"url":"https://api.github.com/repos/translate/pootle/pulls/4317","id":54626141,"html_url":"https://github.com/translate/pootle/pull/4317","diff_url":"https://github.com/translate/pootle/pull/4317.diff","patch_url":"https://github.com/translate/pootle/pull/4317.patch","issue_url":"https://api.github.com/repos/translate/pootle/issues/4317","number":4317,"state":"open","locked":false,"title":"Use regex for unit path","user":{"login":"phlax","id":454682,"avatar_url":"https://avatars.githubusercontent.com/u/454682?v=3","gravatar_id":"","url":"https://api.github.com/users/phlax","html_url":"https://github.com/phlax","followers_url":"https://api.github.com/users/phlax/followers","following_url":"https://api.github.com/users/phlax/following{/other_user}","gists_url":"https://api.github.com/users/phlax/gists{/gist_id}","starred_url":"https://api.github.com/users/phlax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phlax/subscriptions","organizations_url":"https://api.github.com/users/phlax/orgs","repos_url":"https://api.github.com/users/phlax/repos","events_url":"https://api.github.com/users/phlax/events{/privacy}","received_events_url":"https://api.github.com/users/phlax/received_events","type":"User","site_admin":false},"body":"- Unit.get_for_path uses a regex search for pootle_path\r\n- also changes order of arguments","created_at":"2015-12-27T23:56:46Z","updated_at":"2016-01-11T14:29:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9ae55f3ca3dcdd37a59ad172211cf13c75c4e03","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/translate/pootle/pulls/4317/commits","review_comments_url":"https://api.github.com/repos/translate/pootle/pulls/4317/comments","review_comment_url":"https://api.github.com/repos/translate/pootle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/translate/pootle/issues/4317/comments","statuses_url":"https://api.github.com/repos/translate/pootle/statuses/03616aed4780ac889b4276473280ec3e1bfc2214","head":{"label":"phlax:use_regex_for_unit_path","ref":"use_regex_for_unit_path","sha":"03616aed4780ac889b4276473280ec3e1bfc2214","user":{"login":"phlax","id":454682,"avatar_url":"https://avatars.githubusercontent.com/u/454682?v=3","gravatar_id":"","url":"https://api.github.com/users/phlax","html_url":"https://github.com/phlax","followers_url":"https://api.github.com/users/phlax/followers","following_url":"https://api.github.com/users/phlax/following{/other_user}","gists_url":"https://api.github.com/users/phlax/gists{/gist_id}","starred_url":"https://api.github.com/users/phlax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phlax/subscriptions","organizations_url":"https://api.github.com/users/phlax/orgs","repos_url":"https://api.github.com/users/phlax/repos","events_url":"https://api.github.com/users/phlax/events{/privacy}","received_events_url":"https://api.github.com/users/phlax/received_events","type":"User","site_admin":false},"repo":{"id":39886550,"name":"pootle","full_name":"phlax/pootle","owner":{"login":"phlax","id":454682,"avatar_url":"https://avatars.githubusercontent.com/u/454682?v=3","gravatar_id":"","url":"https://api.github.com/users/phlax","html_url":"https://github.com/phlax","followers_url":"https://api.github.com/users/phlax/followers","following_url":"https://api.github.com/users/phlax/following{/other_user}","gists_url":"https://api.github.com/users/phlax/gists{/gist_id}","starred_url":"https://api.github.com/users/phlax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phlax/subscriptions","organizations_url":"https://api.github.com/users/phlax/orgs","repos_url":"https://api.github.com/users/phlax/repos","events_url":"https://api.github.com/users/phlax/events{/privacy}","received_events_url":"https://api.github.com/users/phlax/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phlax/pootle","description":"Online translation tool","fork":true,"url":"https://api.github.com/repos/phlax/pootle","forks_url":"https://api.github.com/repos/phlax/pootle/forks","keys_url":"https://api.github.com/repos/phlax/pootle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phlax/pootle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phlax/pootle/teams","hooks_url":"https://api.github.com/repos/phlax/pootle/hooks","issue_events_url":"https://api.github.com/repos/phlax/pootle/issues/events{/number}","events_url":"https://api.github.com/repos/phlax/pootle/events","assignees_url":"https://api.github.com/repos/phlax/pootle/assignees{/user}","branches_url":"https://api.github.com/repos/phlax/pootle/branches{/branch}","tags_url":"https://api.github.com/repos/phlax/pootle/tags","blobs_url":"https://api.github.com/repos/phlax/pootle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phlax/pootle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phlax/pootle/git/refs{/sha}","trees_url":"https://api.github.com/repos/phlax/pootle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phlax/pootle/statuses/{sha}","languages_url":"https://api.github.com/repos/phlax/pootle/languages","stargazers_url":"https://api.github.com/repos/phlax/pootle/stargazers","contributors_url":"https://api.github.com/repos/phlax/pootle/contributors","subscribers_url":"https://api.github.com/repos/phlax/pootle/subscribers","subscription_url":"https://api.github.com/repos/phlax/pootle/subscription","commits_url":"https://api.github.com/repos/phlax/pootle/commits{/sha}","git_commits_url":"https://api.github.com/repos/phlax/pootle/git/commits{/sha}","comments_url":"https://api.github.com/repos/phlax/pootle/comments{/number}","issue_comment_url":"https://api.github.com/repos/phlax/pootle/issues/comments{/number}","contents_url":"https://api.github.com/repos/phlax/pootle/contents/{+path}","compare_url":"https://api.github.com/repos/phlax/pootle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phlax/pootle/merges","archive_url":"https://api.github.com/repos/phlax/pootle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phlax/pootle/downloads","issues_url":"https://api.github.com/repos/phlax/pootle/issues{/number}","pulls_url":"https://api.github.com/repos/phlax/pootle/pulls{/number}","milestones_url":"https://api.github.com/repos/phlax/pootle/milestones{/number}","notifications_url":"https://api.github.com/repos/phlax/pootle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phlax/pootle/labels{/name}","releases_url":"https://api.github.com/repos/phlax/pootle/releases{/id}","created_at":"2015-07-29T10:00:35Z","updated_at":"2015-07-29T10:00:39Z","pushed_at":"2016-01-09T15:40:45Z","git_url":"git://github.com/phlax/pootle.git","ssh_url":"git@github.com:phlax/pootle.git","clone_url":"https://github.com/phlax/pootle.git","svn_url":"https://github.com/phlax/pootle","homepage":"http://pootle.translatehouse.org","size":82043,"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":"translate:master","ref":"master","sha":"85ccb478a0eb5aed922359e3043a2499b5324041","user":{"login":"translate","id":1538178,"avatar_url":"https://avatars.githubusercontent.com/u/1538178?v=3","gravatar_id":"","url":"https://api.github.com/users/translate","html_url":"https://github.com/translate","followers_url":"https://api.github.com/users/translate/followers","following_url":"https://api.github.com/users/translate/following{/other_user}","gists_url":"https://api.github.com/users/translate/gists{/gist_id}","starred_url":"https://api.github.com/users/translate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/translate/subscriptions","organizations_url":"https://api.github.com/users/translate/orgs","repos_url":"https://api.github.com/users/translate/repos","events_url":"https://api.github.com/users/translate/events{/privacy}","received_events_url":"https://api.github.com/users/translate/received_events","type":"Organization","site_admin":false},"repo":{"id":3769702,"name":"pootle","full_name":"translate/pootle","owner":{"login":"translate","id":1538178,"avatar_url":"https://avatars.githubusercontent.com/u/1538178?v=3","gravatar_id":"","url":"https://api.github.com/users/translate","html_url":"https://github.com/translate","followers_url":"https://api.github.com/users/translate/followers","following_url":"https://api.github.com/users/translate/following{/other_user}","gists_url":"https://api.github.com/users/translate/gists{/gist_id}","starred_url":"https://api.github.com/users/translate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/translate/subscriptions","organizations_url":"https://api.github.com/users/translate/orgs","repos_url":"https://api.github.com/users/translate/repos","events_url":"https://api.github.com/users/translate/events{/privacy}","received_events_url":"https://api.github.com/users/translate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/translate/pootle","description":"Online translation tool","fork":false,"url":"https://api.github.com/repos/translate/pootle","forks_url":"https://api.github.com/repos/translate/pootle/forks","keys_url":"https://api.github.com/repos/translate/pootle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/translate/pootle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/translate/pootle/teams","hooks_url":"https://api.github.com/repos/translate/pootle/hooks","issue_events_url":"https://api.github.com/repos/translate/pootle/issues/events{/number}","events_url":"https://api.github.com/repos/translate/pootle/events","assignees_url":"https://api.github.com/repos/translate/pootle/assignees{/user}","branches_url":"https://api.github.com/repos/translate/pootle/branches{/branch}","tags_url":"https://api.github.com/repos/translate/pootle/tags","blobs_url":"https://api.github.com/repos/translate/pootle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/translate/pootle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/translate/pootle/git/refs{/sha}","trees_url":"https://api.github.com/repos/translate/pootle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/translate/pootle/statuses/{sha}","languages_url":"https://api.github.com/repos/translate/pootle/languages","stargazers_url":"https://api.github.com/repos/translate/pootle/stargazers","contributors_url":"https://api.github.com/repos/translate/pootle/contributors","subscribers_url":"https://api.github.com/repos/translate/pootle/subscribers","subscription_url":"https://api.github.com/repos/translate/pootle/subscription","commits_url":"https://api.github.com/repos/translate/pootle/commits{/sha}","git_commits_url":"https://api.github.com/repos/translate/pootle/git/commits{/sha}","comments_url":"https://api.github.com/repos/translate/pootle/comments{/number}","issue_comment_url":"https://api.github.com/repos/translate/pootle/issues/comments{/number}","contents_url":"https://api.github.com/repos/translate/pootle/contents/{+path}","compare_url":"https://api.github.com/repos/translate/pootle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/translate/pootle/merges","archive_url":"https://api.github.com/repos/translate/pootle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/translate/pootle/downloads","issues_url":"https://api.github.com/repos/translate/pootle/issues{/number}","pulls_url":"https://api.github.com/repos/translate/pootle/pulls{/number}","milestones_url":"https://api.github.com/repos/translate/pootle/milestones{/number}","notifications_url":"https://api.github.com/repos/translate/pootle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/translate/pootle/labels{/name}","releases_url":"https://api.github.com/repos/translate/pootle/releases{/id}","created_at":"2012-03-19T23:06:03Z","updated_at":"2016-01-10T14:01:13Z","pushed_at":"2016-01-11T14:17:26Z","git_url":"git://github.com/translate/pootle.git","ssh_url":"git@github.com:translate/pootle.git","clone_url":"https://github.com/translate/pootle.git","svn_url":"https://github.com/translate/pootle","homepage":"http://pootle.translatehouse.org","size":83599,"stargazers_count":564,"watchers_count":564,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":169,"mirror_url":null,"open_issues_count":285,"forks":169,"open_issues":285,"watchers":564,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/translate/pootle/pulls/4317"},"html":{"href":"https://github.com/translate/pootle/pull/4317"},"issue":{"href":"https://api.github.com/repos/translate/pootle/issues/4317"},"comments":{"href":"https://api.github.com/repos/translate/pootle/issues/4317/comments"},"review_comments":{"href":"https://api.github.com/repos/translate/pootle/pulls/4317/comments"},"review_comment":{"href":"https://api.github.com/repos/translate/pootle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/translate/pootle/pulls/4317/commits"},"statuses":{"href":"https://api.github.com/repos/translate/pootle/statuses/03616aed4780ac889b4276473280ec3e1bfc2214"}}}}