{"action":"created","comment":{"url":"https://api.github.com/repos/inasafe/inasafe/pulls/comments/89445753","pull_request_review_id":9990611,"id":89445753,"diff_hunk":"@@ -753,3 +813,38 @@ def open_map_in_composer(self, impact_report):\n                 space_between_pages * (number_pages - 1))\n             self.composer.fitInView(\n                 0, 0, paper_width + 1, height + 1, QtCore.Qt.KeepAspectRatio)\n+\n+    def generate_impact_report(self, impact_function):\n+        \"\"\"\n+\n+        :param impact_function:\n+        :type impact_function: ImpactFunction\n+        :return:\n+        \"\"\"\n+        # get minimum needs profile\n+        minimum_needs = NeedsProfile()\n+        minimum_needs.load()\n+\n+        # create impact report instance\n+        report_metadata = ReportMetadata(\n+            metadata_dict=standard_impact_report_metadata)\n+        impact_report = ImpactReportV4(\n+            self.iface,\n+            report_metadata,\n+            impact_function=impact_function,\n+            minimum_needs_profile=minimum_needs)\n+\n+        # generate report folder\n+\n+        # no other option for now\n+        # TODO: retrieve the information from data store\n+        if isinstance(impact_function.datastore.uri, QDir):\n+            layer_dir = impact_function.datastore.uri.absolutePath()\n+        else:\n+            # No other way for now\n+            return\n+\n+        # We will generate it on the fly without storing it after datastore\n+        # supports\n+        impact_report.output_folder = os.path.join(layer_dir, 'output')\n+        impact_report.process_component()","path":"safe/utilities/analysis_handler.py","position":210,"original_position":210,"commit_id":"93157c8d2e99b68b2ceb6fef6eab8943b25dedd5","original_commit_id":"93157c8d2e99b68b2ceb6fef6eab8943b25dedd5","user":{"login":"Gustry","id":1609292,"avatar_url":"https://avatars.githubusercontent.com/u/1609292?v=3","gravatar_id":"","url":"https://api.github.com/users/Gustry","html_url":"https://github.com/Gustry","followers_url":"https://api.github.com/users/Gustry/followers","following_url":"https://api.github.com/users/Gustry/following{/other_user}","gists_url":"https://api.github.com/users/Gustry/gists{/gist_id}","starred_url":"https://api.github.com/users/Gustry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gustry/subscriptions","organizations_url":"https://api.github.com/users/Gustry/orgs","repos_url":"https://api.github.com/users/Gustry/repos","events_url":"https://api.github.com/users/Gustry/events{/privacy}","received_events_url":"https://api.github.com/users/Gustry/received_events","type":"User","site_admin":false},"body":"All this file looks like a copy/paste from the dock ;-)\r\nCan't we do something here to avoid duplicated code ?","created_at":"2016-11-24T07:31:18Z","updated_at":"2016-11-24T07:31:18Z","html_url":"https://github.com/inasafe/inasafe/pull/3474#discussion_r89445753","pull_request_url":"https://api.github.com/repos/inasafe/inasafe/pulls/3474","_links":{"self":{"href":"https://api.github.com/repos/inasafe/inasafe/pulls/comments/89445753"},"html":{"href":"https://github.com/inasafe/inasafe/pull/3474#discussion_r89445753"},"pull_request":{"href":"https://api.github.com/repos/inasafe/inasafe/pulls/3474"}}},"pull_request":{"url":"https://api.github.com/repos/inasafe/inasafe/pulls/3474","id":94945671,"html_url":"https://github.com/inasafe/inasafe/pull/3474","diff_url":"https://github.com/inasafe/inasafe/pull/3474.diff","patch_url":"https://github.com/inasafe/inasafe/pull/3474.patch","issue_url":"https://api.github.com/repos/inasafe/inasafe/issues/3474","number":3474,"state":"open","locked":false,"title":"Fix 3387 ifcw v4","user":{"login":"ismailsunni","id":1421861,"avatar_url":"https://avatars.githubusercontent.com/u/1421861?v=3","gravatar_id":"","url":"https://api.github.com/users/ismailsunni","html_url":"https://github.com/ismailsunni","followers_url":"https://api.github.com/users/ismailsunni/followers","following_url":"https://api.github.com/users/ismailsunni/following{/other_user}","gists_url":"https://api.github.com/users/ismailsunni/gists{/gist_id}","starred_url":"https://api.github.com/users/ismailsunni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ismailsunni/subscriptions","organizations_url":"https://api.github.com/users/ismailsunni/orgs","repos_url":"https://api.github.com/users/ismailsunni/repos","events_url":"https://api.github.com/users/ismailsunni/events{/privacy}","received_events_url":"https://api.github.com/users/ismailsunni/received_events","type":"User","site_admin":false},"body":"Fix #3387 ","created_at":"2016-11-23T05:03:24Z","updated_at":"2016-11-24T07:31:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"40cc1ede425fe95b81d98bea6802a31e09ee166c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/inasafe/inasafe/pulls/3474/commits","review_comments_url":"https://api.github.com/repos/inasafe/inasafe/pulls/3474/comments","review_comment_url":"https://api.github.com/repos/inasafe/inasafe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/inasafe/inasafe/issues/3474/comments","statuses_url":"https://api.github.com/repos/inasafe/inasafe/statuses/93157c8d2e99b68b2ceb6fef6eab8943b25dedd5","head":{"label":"ismailsunni:fix_3387_IFCW_v4","ref":"fix_3387_IFCW_v4","sha":"93157c8d2e99b68b2ceb6fef6eab8943b25dedd5","user":{"login":"ismailsunni","id":1421861,"avatar_url":"https://avatars.githubusercontent.com/u/1421861?v=3","gravatar_id":"","url":"https://api.github.com/users/ismailsunni","html_url":"https://github.com/ismailsunni","followers_url":"https://api.github.com/users/ismailsunni/followers","following_url":"https://api.github.com/users/ismailsunni/following{/other_user}","gists_url":"https://api.github.com/users/ismailsunni/gists{/gist_id}","starred_url":"https://api.github.com/users/ismailsunni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ismailsunni/subscriptions","organizations_url":"https://api.github.com/users/ismailsunni/orgs","repos_url":"https://api.github.com/users/ismailsunni/repos","events_url":"https://api.github.com/users/ismailsunni/events{/privacy}","received_events_url":"https://api.github.com/users/ismailsunni/received_events","type":"User","site_admin":false},"repo":{"id":17427551,"name":"inasafe","full_name":"ismailsunni/inasafe","owner":{"login":"ismailsunni","id":1421861,"avatar_url":"https://avatars.githubusercontent.com/u/1421861?v=3","gravatar_id":"","url":"https://api.github.com/users/ismailsunni","html_url":"https://github.com/ismailsunni","followers_url":"https://api.github.com/users/ismailsunni/followers","following_url":"https://api.github.com/users/ismailsunni/following{/other_user}","gists_url":"https://api.github.com/users/ismailsunni/gists{/gist_id}","starred_url":"https://api.github.com/users/ismailsunni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ismailsunni/subscriptions","organizations_url":"https://api.github.com/users/ismailsunni/orgs","repos_url":"https://api.github.com/users/ismailsunni/repos","events_url":"https://api.github.com/users/ismailsunni/events{/privacy}","received_events_url":"https://api.github.com/users/ismailsunni/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ismailsunni/inasafe","description":"InaSAFE - QGIS plugin for estimating impact from natural disasters","fork":true,"url":"https://api.github.com/repos/ismailsunni/inasafe","forks_url":"https://api.github.com/repos/ismailsunni/inasafe/forks","keys_url":"https://api.github.com/repos/ismailsunni/inasafe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ismailsunni/inasafe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ismailsunni/inasafe/teams","hooks_url":"https://api.github.com/repos/ismailsunni/inasafe/hooks","issue_events_url":"https://api.github.com/repos/ismailsunni/inasafe/issues/events{/number}","events_url":"https://api.github.com/repos/ismailsunni/inasafe/events","assignees_url":"https://api.github.com/repos/ismailsunni/inasafe/assignees{/user}","branches_url":"https://api.github.com/repos/ismailsunni/inasafe/branches{/branch}","tags_url":"https://api.github.com/repos/ismailsunni/inasafe/tags","blobs_url":"https://api.github.com/repos/ismailsunni/inasafe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ismailsunni/inasafe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ismailsunni/inasafe/git/refs{/sha}","trees_url":"https://api.github.com/repos/ismailsunni/inasafe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ismailsunni/inasafe/statuses/{sha}","languages_url":"https://api.github.com/repos/ismailsunni/inasafe/languages","stargazers_url":"https://api.github.com/repos/ismailsunni/inasafe/stargazers","contributors_url":"https://api.github.com/repos/ismailsunni/inasafe/contributors","subscribers_url":"https://api.github.com/repos/ismailsunni/inasafe/subscribers","subscription_url":"https://api.github.com/repos/ismailsunni/inasafe/subscription","commits_url":"https://api.github.com/repos/ismailsunni/inasafe/commits{/sha}","git_commits_url":"https://api.github.com/repos/ismailsunni/inasafe/git/commits{/sha}","comments_url":"https://api.github.com/repos/ismailsunni/inasafe/comments{/number}","issue_comment_url":"https://api.github.com/repos/ismailsunni/inasafe/issues/comments{/number}","contents_url":"https://api.github.com/repos/ismailsunni/inasafe/contents/{+path}","compare_url":"https://api.github.com/repos/ismailsunni/inasafe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ismailsunni/inasafe/merges","archive_url":"https://api.github.com/repos/ismailsunni/inasafe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ismailsunni/inasafe/downloads","issues_url":"https://api.github.com/repos/ismailsunni/inasafe/issues{/number}","pulls_url":"https://api.github.com/repos/ismailsunni/inasafe/pulls{/number}","milestones_url":"https://api.github.com/repos/ismailsunni/inasafe/milestones{/number}","notifications_url":"https://api.github.com/repos/ismailsunni/inasafe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ismailsunni/inasafe/labels{/name}","releases_url":"https://api.github.com/repos/ismailsunni/inasafe/releases{/id}","deployments_url":"https://api.github.com/repos/ismailsunni/inasafe/deployments","created_at":"2014-03-05T04:07:33Z","updated_at":"2016-01-21T09:44:09Z","pushed_at":"2016-11-24T07:04:33Z","git_url":"git://github.com/ismailsunni/inasafe.git","ssh_url":"git@github.com:ismailsunni/inasafe.git","clone_url":"https://github.com/ismailsunni/inasafe.git","svn_url":"https://github.com/ismailsunni/inasafe","homepage":"www.inasafe.org","size":197239,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"inasafe:develop","ref":"develop","sha":"045a902524950e2ec64d9f32429052df6380c6db","user":{"login":"inasafe","id":1843347,"avatar_url":"https://avatars.githubusercontent.com/u/1843347?v=3","gravatar_id":"","url":"https://api.github.com/users/inasafe","html_url":"https://github.com/inasafe","followers_url":"https://api.github.com/users/inasafe/followers","following_url":"https://api.github.com/users/inasafe/following{/other_user}","gists_url":"https://api.github.com/users/inasafe/gists{/gist_id}","starred_url":"https://api.github.com/users/inasafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inasafe/subscriptions","organizations_url":"https://api.github.com/users/inasafe/orgs","repos_url":"https://api.github.com/users/inasafe/repos","events_url":"https://api.github.com/users/inasafe/events{/privacy}","received_events_url":"https://api.github.com/users/inasafe/received_events","type":"Organization","site_admin":false},"repo":{"id":3135721,"name":"inasafe","full_name":"inasafe/inasafe","owner":{"login":"inasafe","id":1843347,"avatar_url":"https://avatars.githubusercontent.com/u/1843347?v=3","gravatar_id":"","url":"https://api.github.com/users/inasafe","html_url":"https://github.com/inasafe","followers_url":"https://api.github.com/users/inasafe/followers","following_url":"https://api.github.com/users/inasafe/following{/other_user}","gists_url":"https://api.github.com/users/inasafe/gists{/gist_id}","starred_url":"https://api.github.com/users/inasafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inasafe/subscriptions","organizations_url":"https://api.github.com/users/inasafe/orgs","repos_url":"https://api.github.com/users/inasafe/repos","events_url":"https://api.github.com/users/inasafe/events{/privacy}","received_events_url":"https://api.github.com/users/inasafe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/inasafe/inasafe","description":"InaSAFE - QGIS plugin for estimating impact from natural disasters","fork":false,"url":"https://api.github.com/repos/inasafe/inasafe","forks_url":"https://api.github.com/repos/inasafe/inasafe/forks","keys_url":"https://api.github.com/repos/inasafe/inasafe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inasafe/inasafe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inasafe/inasafe/teams","hooks_url":"https://api.github.com/repos/inasafe/inasafe/hooks","issue_events_url":"https://api.github.com/repos/inasafe/inasafe/issues/events{/number}","events_url":"https://api.github.com/repos/inasafe/inasafe/events","assignees_url":"https://api.github.com/repos/inasafe/inasafe/assignees{/user}","branches_url":"https://api.github.com/repos/inasafe/inasafe/branches{/branch}","tags_url":"https://api.github.com/repos/inasafe/inasafe/tags","blobs_url":"https://api.github.com/repos/inasafe/inasafe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inasafe/inasafe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inasafe/inasafe/git/refs{/sha}","trees_url":"https://api.github.com/repos/inasafe/inasafe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inasafe/inasafe/statuses/{sha}","languages_url":"https://api.github.com/repos/inasafe/inasafe/languages","stargazers_url":"https://api.github.com/repos/inasafe/inasafe/stargazers","contributors_url":"https://api.github.com/repos/inasafe/inasafe/contributors","subscribers_url":"https://api.github.com/repos/inasafe/inasafe/subscribers","subscription_url":"https://api.github.com/repos/inasafe/inasafe/subscription","commits_url":"https://api.github.com/repos/inasafe/inasafe/commits{/sha}","git_commits_url":"https://api.github.com/repos/inasafe/inasafe/git/commits{/sha}","comments_url":"https://api.github.com/repos/inasafe/inasafe/comments{/number}","issue_comment_url":"https://api.github.com/repos/inasafe/inasafe/issues/comments{/number}","contents_url":"https://api.github.com/repos/inasafe/inasafe/contents/{+path}","compare_url":"https://api.github.com/repos/inasafe/inasafe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inasafe/inasafe/merges","archive_url":"https://api.github.com/repos/inasafe/inasafe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inasafe/inasafe/downloads","issues_url":"https://api.github.com/repos/inasafe/inasafe/issues{/number}","pulls_url":"https://api.github.com/repos/inasafe/inasafe/pulls{/number}","milestones_url":"https://api.github.com/repos/inasafe/inasafe/milestones{/number}","notifications_url":"https://api.github.com/repos/inasafe/inasafe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inasafe/inasafe/labels{/name}","releases_url":"https://api.github.com/repos/inasafe/inasafe/releases{/id}","deployments_url":"https://api.github.com/repos/inasafe/inasafe/deployments","created_at":"2012-01-09T10:34:29Z","updated_at":"2016-11-11T09:06:55Z","pushed_at":"2016-11-24T07:23:45Z","git_url":"git://github.com/inasafe/inasafe.git","ssh_url":"git@github.com:inasafe/inasafe.git","clone_url":"https://github.com/inasafe/inasafe.git","svn_url":"https://github.com/inasafe/inasafe","homepage":"www.inasafe.org","size":216088,"stargazers_count":94,"watchers_count":94,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":90,"mirror_url":null,"open_issues_count":332,"forks":90,"open_issues":332,"watchers":94,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/inasafe/inasafe/pulls/3474"},"html":{"href":"https://github.com/inasafe/inasafe/pull/3474"},"issue":{"href":"https://api.github.com/repos/inasafe/inasafe/issues/3474"},"comments":{"href":"https://api.github.com/repos/inasafe/inasafe/issues/3474/comments"},"review_comments":{"href":"https://api.github.com/repos/inasafe/inasafe/pulls/3474/comments"},"review_comment":{"href":"https://api.github.com/repos/inasafe/inasafe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/inasafe/inasafe/pulls/3474/commits"},"statuses":{"href":"https://api.github.com/repos/inasafe/inasafe/statuses/93157c8d2e99b68b2ceb6fef6eab8943b25dedd5"}}}}
{"actor":{"display_login":"Gustry"}}