{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/43790100","id":43790100,"diff_hunk":"@@ -147,6 +204,56 @@ def _publish_event(self, event_name, result, **kwargs):\n         self.runtime.publish(self, \"edx.librarycontentblock.content.{}\".format(event_name), event_data)\n         self._last_event_result_count = len(result)  # pylint: disable=attribute-defined-outside-init\n \n+    @classmethod\n+    def publish_selected_children_events(cls, block_keys, format_block_keys, publish_event):\n+        \"\"\"\n+        Publish selected events on child objects.  # REVIEW: Useless. Rewrite.\n+        Dynamically selects block_ids indicating which of the possible children are displayed to the current user.\n+\n+        Arguments:\n+\n+            block_keys -\n+                A dict describing which events to publish (add or remove), see `make_selection` above\n+                for format details.\n+\n+            format_block_keys -\n+                A function to convert block keys to the format expected by publish_event. Must have the signature:\n+\n+                    [(block_type, block_id)] -> T\n+\n+                Where T is a collection of block keys as accepted by `publish_event`.\n+\n+            publish_event -\n+                Function that handles the actual publishing.  Must have the signature:\n+\n+                    <'removed'|'assigned'> -> result:T -> removed:T -> reason:basestring -> None\n+\n+                Where T is a collection of block_keys as returned by `format_block_keys`.\n+        \"\"\"\n+        if block_keys['invalid']:\n+            # reason \"invalid\" means deleted from library or a different library is now being used.\n+            publish_event(\n+                \"removed\",\n+                result=format_block_keys(block_keys['selected']),\n+                removed=format_block_keys(block_keys['invalid']),\n+                reason=\"invalid\"\n+            )\n+\n+        if block_keys['overlimit']:\n+            publish_event(\n+                \"removed\",\n+                result=format_block_keys(block_keys['selected']),\n+                removed=format_block_keys(block_keys['overlimit']),\n+                reason=\"overlimit\"\n+            )\n+\n+        if block_keys['added']:\n+            publish_event(\n+                \"assigned\",\n+                result=format_block_keys(block_keys['selected']),\n+                added=format_block_keys(block_keys['added'])","path":"common/lib/xmodule/xmodule/library_content_module.py","position":118,"original_position":118,"commit_id":"886c4be828c8ab80bb2030196dd6729c1951d5b1","original_commit_id":"886c4be828c8ab80bb2030196dd6729c1951d5b1","user":{"login":"aleffert","id":114396,"avatar_url":"https://avatars.githubusercontent.com/u/114396?v=3","gravatar_id":"","url":"https://api.github.com/users/aleffert","html_url":"https://github.com/aleffert","followers_url":"https://api.github.com/users/aleffert/followers","following_url":"https://api.github.com/users/aleffert/following{/other_user}","gists_url":"https://api.github.com/users/aleffert/gists{/gist_id}","starred_url":"https://api.github.com/users/aleffert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleffert/subscriptions","organizations_url":"https://api.github.com/users/aleffert/orgs","repos_url":"https://api.github.com/users/aleffert/repos","events_url":"https://api.github.com/users/aleffert/events{/privacy}","received_events_url":"https://api.github.com/users/aleffert/received_events","type":"User","site_admin":false},"body":"This doesn't have a reason, unlike the others, is that intentional?","created_at":"2015-11-03T18:56:41Z","updated_at":"2015-11-03T18:56:41Z","html_url":"https://github.com/edx/edx-platform/pull/10412#discussion_r43790100","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/10412","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/43790100"},"html":{"href":"https://github.com/edx/edx-platform/pull/10412#discussion_r43790100"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10412"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/10412","id":49079178,"html_url":"https://github.com/edx/edx-platform/pull/10412","diff_url":"https://github.com/edx/edx-platform/pull/10412.diff","patch_url":"https://github.com/edx/edx-platform/pull/10412.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/10412","number":10412,"state":"open","locked":false,"title":"Course Blocks App","user":{"login":"nasthagiri","id":6772826,"avatar_url":"https://avatars.githubusercontent.com/u/6772826?v=3","gravatar_id":"","url":"https://api.github.com/users/nasthagiri","html_url":"https://github.com/nasthagiri","followers_url":"https://api.github.com/users/nasthagiri/followers","following_url":"https://api.github.com/users/nasthagiri/following{/other_user}","gists_url":"https://api.github.com/users/nasthagiri/gists{/gist_id}","starred_url":"https://api.github.com/users/nasthagiri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasthagiri/subscriptions","organizations_url":"https://api.github.com/users/nasthagiri/orgs","repos_url":"https://api.github.com/users/nasthagiri/repos","events_url":"https://api.github.com/users/nasthagiri/events{/privacy}","received_events_url":"https://api.github.com/users/nasthagiri/received_events","type":"User","site_admin":false},"body":"This PR is not ready yet.  But this gives you an idea of what's coming down the line.\r\nI have broken the PR into separate commits for easier review.  I will tag other developers to help review a few specific transformers.\r\n\r\nReviewers: @aleffert @jcdyer   \r\nFYI @BenjiLee ","created_at":"2015-10-28T23:02:35Z","updated_at":"2015-11-03T18:56:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbdfcb6ff560e93f34242dc86ab66e4ed2737fdb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/10412/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/10412/comments","review_comment_url":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/10412/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/886c4be828c8ab80bb2030196dd6729c1951d5b1","head":{"label":"edx:mobile/course-blocks-app","ref":"mobile/course-blocks-app","sha":"886c4be828c8ab80bb2030196dd6729c1951d5b1","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-11-03T14:17:11Z","pushed_at":"2015-11-03T18:41:47Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://open.edx.org/","size":2208727,"stargazers_count":2212,"watchers_count":2212,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1351,"mirror_url":null,"open_issues_count":148,"forks":1351,"open_issues":148,"watchers":2212,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"79c2501c8de9309483c280097063988ebfec3c7e","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-11-03T14:17:11Z","pushed_at":"2015-11-03T18:41:47Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://open.edx.org/","size":2208727,"stargazers_count":2212,"watchers_count":2212,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1351,"mirror_url":null,"open_issues_count":148,"forks":1351,"open_issues":148,"watchers":2212,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10412"},"html":{"href":"https://github.com/edx/edx-platform/pull/10412"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/10412"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/10412/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10412/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10412/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/886c4be828c8ab80bb2030196dd6729c1951d5b1"}}}}