{"action":"created","comment":{"url":"https://api.github.com/repos/neutralio/pynio/pulls/comments/24880933","id":24880933,"diff_hunk":"@@ -37,6 +48,47 @@ def name(self):\n     def type(self):\n         return self._type\n \n+    @property\n+    def template(self):\n+        return self._template\n+\n+    @template.setter\n+    def template(self, value):\n+        # do type checking later\n+        self._template = value\n+\n+    @property\n+    def config(self):\n+        return self._config\n+\n+    @config.setter\n+    def config(self, value):\n+        if self._template is None:\n+            self._config = value\n+            return\n+        config = deepcopy(self._template)\n+        config.readonly = False\n+        config.update(value, drop_unknown=True,\n+                      drop_logger=self._instance.droplog)\n+        self._config = config\n+\n+    def json(self):\n+        return self._config.__basic__()\n+\n+    def _load_template(self, type, value, instance=None):\n+        '''Set the template with a template gotten from nio'''\n+        if instance is not None:\n+            self._instance = instance\n+        if self._instance is None:\n+            raise TypeError(\"Block is not tied to an instance\")\n+\n+        template = load_block(value)","path":"pynio/block.py","position":77,"original_position":74,"commit_id":"9dfa86db734babf811b3c5b963dd423b6076d194","original_commit_id":"613df35d2720bc825d63621cb73a28e8e4a8c04f","user":{"login":"cloudformdesign","id":5587659,"avatar_url":"https://avatars.githubusercontent.com/u/5587659?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudformdesign","html_url":"https://github.com/cloudformdesign","followers_url":"https://api.github.com/users/cloudformdesign/followers","following_url":"https://api.github.com/users/cloudformdesign/following{/other_user}","gists_url":"https://api.github.com/users/cloudformdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudformdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudformdesign/subscriptions","organizations_url":"https://api.github.com/users/cloudformdesign/orgs","repos_url":"https://api.github.com/users/cloudformdesign/repos","events_url":"https://api.github.com/users/cloudformdesign/events{/privacy}","received_events_url":"https://api.github.com/users/cloudformdesign/received_events","type":"User","site_admin":false},"body":"This point inspired the small but significant change in 9dfa86d","created_at":"2015-02-18T06:11:35Z","updated_at":"2015-02-18T06:11:35Z","html_url":"https://github.com/neutralio/pynio/pull/13#discussion_r24880933","pull_request_url":"https://api.github.com/repos/neutralio/pynio/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/neutralio/pynio/pulls/comments/24880933"},"html":{"href":"https://github.com/neutralio/pynio/pull/13#discussion_r24880933"},"pull_request":{"href":"https://api.github.com/repos/neutralio/pynio/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/neutralio/pynio/pulls/13","id":29474114,"html_url":"https://github.com/neutralio/pynio/pull/13","diff_url":"https://github.com/neutralio/pynio/pull/13.diff","patch_url":"https://github.com/neutralio/pynio/pull/13.patch","issue_url":"https://api.github.com/repos/neutralio/pynio/issues/13","number":13,"state":"open","locked":false,"title":"F/properties","user":{"login":"cloudformdesign","id":5587659,"avatar_url":"https://avatars.githubusercontent.com/u/5587659?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudformdesign","html_url":"https://github.com/cloudformdesign","followers_url":"https://api.github.com/users/cloudformdesign/followers","following_url":"https://api.github.com/users/cloudformdesign/following{/other_user}","gists_url":"https://api.github.com/users/cloudformdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudformdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudformdesign/subscriptions","organizations_url":"https://api.github.com/users/cloudformdesign/orgs","repos_url":"https://api.github.com/users/cloudformdesign/repos","events_url":"https://api.github.com/users/cloudformdesign/events{/privacy}","received_events_url":"https://api.github.com/users/cloudformdesign/received_events","type":"User","site_admin":false},"body":"This is now ready for your review.\r\n\r\nChanges:\r\n- the instance now automatically loads block templates(types) and objects as `self.blocks_types` and `self.blocks`\r\n- all saving operations done on a block that is attached to an instance also checks to make sure that the configuration is correct.\r\n- block properties can be accessed through `block.config.attribute = 'value'`. If a template has been loaded, these operations are type checked automatically.\r\n\r\nTests:\r\n- Tests have been added that load the configuration of a large amount of blocks from a previously live instance.\r\n- Tests have been added that test new features.\r\n- More tests probably need to be added","created_at":"2015-02-17T20:20:34Z","updated_at":"2015-02-18T06:11:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"651d76545406aee9eb32efcf34fc2249598cc539","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/neutralio/pynio/pulls/13/commits","review_comments_url":"https://api.github.com/repos/neutralio/pynio/pulls/13/comments","review_comment_url":"https://api.github.com/repos/neutralio/pynio/pulls/comments/{number}","comments_url":"https://api.github.com/repos/neutralio/pynio/issues/13/comments","statuses_url":"https://api.github.com/repos/neutralio/pynio/statuses/9dfa86db734babf811b3c5b963dd423b6076d194","head":{"label":"neutralio:f/properties","ref":"f/properties","sha":"9dfa86db734babf811b3c5b963dd423b6076d194","user":{"login":"neutralio","id":4392245,"avatar_url":"https://avatars.githubusercontent.com/u/4392245?v=3","gravatar_id":"","url":"https://api.github.com/users/neutralio","html_url":"https://github.com/neutralio","followers_url":"https://api.github.com/users/neutralio/followers","following_url":"https://api.github.com/users/neutralio/following{/other_user}","gists_url":"https://api.github.com/users/neutralio/gists{/gist_id}","starred_url":"https://api.github.com/users/neutralio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neutralio/subscriptions","organizations_url":"https://api.github.com/users/neutralio/orgs","repos_url":"https://api.github.com/users/neutralio/repos","events_url":"https://api.github.com/users/neutralio/events{/privacy}","received_events_url":"https://api.github.com/users/neutralio/received_events","type":"Organization","site_admin":false},"repo":{"id":30577837,"name":"pynio","full_name":"neutralio/pynio","owner":{"login":"neutralio","id":4392245,"avatar_url":"https://avatars.githubusercontent.com/u/4392245?v=3","gravatar_id":"","url":"https://api.github.com/users/neutralio","html_url":"https://github.com/neutralio","followers_url":"https://api.github.com/users/neutralio/followers","following_url":"https://api.github.com/users/neutralio/following{/other_user}","gists_url":"https://api.github.com/users/neutralio/gists{/gist_id}","starred_url":"https://api.github.com/users/neutralio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neutralio/subscriptions","organizations_url":"https://api.github.com/users/neutralio/orgs","repos_url":"https://api.github.com/users/neutralio/repos","events_url":"https://api.github.com/users/neutralio/events{/privacy}","received_events_url":"https://api.github.com/users/neutralio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neutralio/pynio","description":"A Python module for communicating with the nio REST API.","fork":false,"url":"https://api.github.com/repos/neutralio/pynio","forks_url":"https://api.github.com/repos/neutralio/pynio/forks","keys_url":"https://api.github.com/repos/neutralio/pynio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neutralio/pynio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neutralio/pynio/teams","hooks_url":"https://api.github.com/repos/neutralio/pynio/hooks","issue_events_url":"https://api.github.com/repos/neutralio/pynio/issues/events{/number}","events_url":"https://api.github.com/repos/neutralio/pynio/events","assignees_url":"https://api.github.com/repos/neutralio/pynio/assignees{/user}","branches_url":"https://api.github.com/repos/neutralio/pynio/branches{/branch}","tags_url":"https://api.github.com/repos/neutralio/pynio/tags","blobs_url":"https://api.github.com/repos/neutralio/pynio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neutralio/pynio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neutralio/pynio/git/refs{/sha}","trees_url":"https://api.github.com/repos/neutralio/pynio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neutralio/pynio/statuses/{sha}","languages_url":"https://api.github.com/repos/neutralio/pynio/languages","stargazers_url":"https://api.github.com/repos/neutralio/pynio/stargazers","contributors_url":"https://api.github.com/repos/neutralio/pynio/contributors","subscribers_url":"https://api.github.com/repos/neutralio/pynio/subscribers","subscription_url":"https://api.github.com/repos/neutralio/pynio/subscription","commits_url":"https://api.github.com/repos/neutralio/pynio/commits{/sha}","git_commits_url":"https://api.github.com/repos/neutralio/pynio/git/commits{/sha}","comments_url":"https://api.github.com/repos/neutralio/pynio/comments{/number}","issue_comment_url":"https://api.github.com/repos/neutralio/pynio/issues/comments/{number}","contents_url":"https://api.github.com/repos/neutralio/pynio/contents/{+path}","compare_url":"https://api.github.com/repos/neutralio/pynio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neutralio/pynio/merges","archive_url":"https://api.github.com/repos/neutralio/pynio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neutralio/pynio/downloads","issues_url":"https://api.github.com/repos/neutralio/pynio/issues{/number}","pulls_url":"https://api.github.com/repos/neutralio/pynio/pulls{/number}","milestones_url":"https://api.github.com/repos/neutralio/pynio/milestones{/number}","notifications_url":"https://api.github.com/repos/neutralio/pynio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neutralio/pynio/labels{/name}","releases_url":"https://api.github.com/repos/neutralio/pynio/releases{/id}","created_at":"2015-02-10T06:09:08Z","updated_at":"2015-02-16T20:23:25Z","pushed_at":"2015-02-18T06:11:06Z","git_url":"git://github.com/neutralio/pynio.git","ssh_url":"git@github.com:neutralio/pynio.git","clone_url":"https://github.com/neutralio/pynio.git","svn_url":"https://github.com/neutralio/pynio","homepage":null,"size":583,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"neutralio:master","ref":"master","sha":"6b01ccfab064c92c3c1af5c9bad61cffbaa895c1","user":{"login":"neutralio","id":4392245,"avatar_url":"https://avatars.githubusercontent.com/u/4392245?v=3","gravatar_id":"","url":"https://api.github.com/users/neutralio","html_url":"https://github.com/neutralio","followers_url":"https://api.github.com/users/neutralio/followers","following_url":"https://api.github.com/users/neutralio/following{/other_user}","gists_url":"https://api.github.com/users/neutralio/gists{/gist_id}","starred_url":"https://api.github.com/users/neutralio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neutralio/subscriptions","organizations_url":"https://api.github.com/users/neutralio/orgs","repos_url":"https://api.github.com/users/neutralio/repos","events_url":"https://api.github.com/users/neutralio/events{/privacy}","received_events_url":"https://api.github.com/users/neutralio/received_events","type":"Organization","site_admin":false},"repo":{"id":30577837,"name":"pynio","full_name":"neutralio/pynio","owner":{"login":"neutralio","id":4392245,"avatar_url":"https://avatars.githubusercontent.com/u/4392245?v=3","gravatar_id":"","url":"https://api.github.com/users/neutralio","html_url":"https://github.com/neutralio","followers_url":"https://api.github.com/users/neutralio/followers","following_url":"https://api.github.com/users/neutralio/following{/other_user}","gists_url":"https://api.github.com/users/neutralio/gists{/gist_id}","starred_url":"https://api.github.com/users/neutralio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neutralio/subscriptions","organizations_url":"https://api.github.com/users/neutralio/orgs","repos_url":"https://api.github.com/users/neutralio/repos","events_url":"https://api.github.com/users/neutralio/events{/privacy}","received_events_url":"https://api.github.com/users/neutralio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neutralio/pynio","description":"A Python module for communicating with the nio REST API.","fork":false,"url":"https://api.github.com/repos/neutralio/pynio","forks_url":"https://api.github.com/repos/neutralio/pynio/forks","keys_url":"https://api.github.com/repos/neutralio/pynio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neutralio/pynio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neutralio/pynio/teams","hooks_url":"https://api.github.com/repos/neutralio/pynio/hooks","issue_events_url":"https://api.github.com/repos/neutralio/pynio/issues/events{/number}","events_url":"https://api.github.com/repos/neutralio/pynio/events","assignees_url":"https://api.github.com/repos/neutralio/pynio/assignees{/user}","branches_url":"https://api.github.com/repos/neutralio/pynio/branches{/branch}","tags_url":"https://api.github.com/repos/neutralio/pynio/tags","blobs_url":"https://api.github.com/repos/neutralio/pynio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neutralio/pynio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neutralio/pynio/git/refs{/sha}","trees_url":"https://api.github.com/repos/neutralio/pynio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neutralio/pynio/statuses/{sha}","languages_url":"https://api.github.com/repos/neutralio/pynio/languages","stargazers_url":"https://api.github.com/repos/neutralio/pynio/stargazers","contributors_url":"https://api.github.com/repos/neutralio/pynio/contributors","subscribers_url":"https://api.github.com/repos/neutralio/pynio/subscribers","subscription_url":"https://api.github.com/repos/neutralio/pynio/subscription","commits_url":"https://api.github.com/repos/neutralio/pynio/commits{/sha}","git_commits_url":"https://api.github.com/repos/neutralio/pynio/git/commits{/sha}","comments_url":"https://api.github.com/repos/neutralio/pynio/comments{/number}","issue_comment_url":"https://api.github.com/repos/neutralio/pynio/issues/comments/{number}","contents_url":"https://api.github.com/repos/neutralio/pynio/contents/{+path}","compare_url":"https://api.github.com/repos/neutralio/pynio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neutralio/pynio/merges","archive_url":"https://api.github.com/repos/neutralio/pynio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neutralio/pynio/downloads","issues_url":"https://api.github.com/repos/neutralio/pynio/issues{/number}","pulls_url":"https://api.github.com/repos/neutralio/pynio/pulls{/number}","milestones_url":"https://api.github.com/repos/neutralio/pynio/milestones{/number}","notifications_url":"https://api.github.com/repos/neutralio/pynio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neutralio/pynio/labels{/name}","releases_url":"https://api.github.com/repos/neutralio/pynio/releases{/id}","created_at":"2015-02-10T06:09:08Z","updated_at":"2015-02-16T20:23:25Z","pushed_at":"2015-02-18T06:11:06Z","git_url":"git://github.com/neutralio/pynio.git","ssh_url":"git@github.com:neutralio/pynio.git","clone_url":"https://github.com/neutralio/pynio.git","svn_url":"https://github.com/neutralio/pynio","homepage":null,"size":583,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neutralio/pynio/pulls/13"},"html":{"href":"https://github.com/neutralio/pynio/pull/13"},"issue":{"href":"https://api.github.com/repos/neutralio/pynio/issues/13"},"comments":{"href":"https://api.github.com/repos/neutralio/pynio/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/neutralio/pynio/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/neutralio/pynio/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/neutralio/pynio/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/neutralio/pynio/statuses/9dfa86db734babf811b3c5b963dd423b6076d194"}}}}