{"action":"created","comment":{"url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/pulls/comments/52304116","id":52304116,"diff_hunk":"@@ -0,0 +1,108 @@\n+#!/usr/bin/env python\n+# -*- encoding: utf-8 -*-\n+#\n+# Copyright 2014 Telefónica Investigación y Desarrollo, S.A.U\n+#\n+# This file is part of FI-WARE project.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+#\n+# You may obtain a copy of the License at:\n+#\n+#        http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+#\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+#\n+# For those usages not covered by the Apache version 2.0 License please\n+# contact with opensource@tid.es\n+#\n+# Define constants\n+import httplib\n+\n+# Import flask\n+from flask import Flask, make_response\n+\n+# Import SQLAlchemy\n+from flask.ext.sqlalchemy import SQLAlchemy\n+\n+# Defile the WGSI application object\n+app = Flask(__name__)\n+\n+# Configurations\n+app.config.from_object('config')\n+\n+# Define the database object which is imported\n+# by modules and controllers\n+db = SQLAlchemy(app)\n+\n+# Import a module / component using its blueprint handler variable (mod_auth)\n+from app.mod_auth.controllers import mod_auth as auth_module\n+from app.mod_info.controllers import mod_info as info_module\n+\n+# Import settings value\n+from app.settings.settings import CONTENT_TYPE, SERVER, SERVER_HEADER, JSON_TYPE\n+\n+\n+# Sample HTTP error handling (401)\n+@app.errorhandler(httplib.UNAUTHORIZED)\n+def unauthorized(error):\n+    msg = '{ \"error\": { \"message\": \"The request you have made requires authentication.\", \"code\": ' \\\n+          + str(httplib.UNAUTHORIZED) + ', \"title\": \"Unauthorized\" } }\\n'\n+\n+    resp = make_response(msg, httplib.UNAUTHORIZED)\n+    resp.headers[SERVER_HEADER] = SERVER\n+    resp.headers[CONTENT_TYPE] = JSON_TYPE\n+\n+    return resp\n+\n+\n+# Sample HTTP error handling (404)\n+@app.errorhandler(httplib.NOT_FOUND)\n+def not_found(error):\n+    if error.description is not None:\n+        msg = error.description\n+    else:\n+        msg = '{ \"error\": { \"message\": \"Item not found.\", \"code\": ' + str(httplib.NOT_FOUND) + ' } }\\n'\n+\n+    resp = make_response(msg, httplib.NOT_FOUND)\n+    resp.headers[SERVER_HEADER] = SERVER\n+    resp.headers[CONTENT_TYPE] = JSON_TYPE\n+\n+    return resp\n+\n+\n+# Sample HTTP error handling (405)\n+@app.errorhandler(httplib.METHOD_NOT_ALLOWED)\n+def bad_method(error):\n+    msg = '{ \"error\": { \"message\": \"Bad method\", \"code\": ' + str(httplib.METHOD_NOT_ALLOWED) + ' } }\\n'\n+\n+    resp = make_response(msg, httplib.METHOD_NOT_ALLOWED)\n+    resp.headers[SERVER_HEADER] = SERVER\n+    resp.headers[CONTENT_TYPE] = JSON_TYPE\n+\n+    return resp\n+\n+\n+# Sample HTTP error handling (400)","path":"app/__init__.py","position":92,"original_position":92,"commit_id":"a014301798604091246455333a6dcfa6f562525f","original_commit_id":"a014301798604091246455333a6dcfa6f562525f","user":{"login":"pratid","id":2345596,"avatar_url":"https://avatars.githubusercontent.com/u/2345596?v=3","gravatar_id":"","url":"https://api.github.com/users/pratid","html_url":"https://github.com/pratid","followers_url":"https://api.github.com/users/pratid/followers","following_url":"https://api.github.com/users/pratid/following{/other_user}","gists_url":"https://api.github.com/users/pratid/gists{/gist_id}","starred_url":"https://api.github.com/users/pratid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pratid/subscriptions","organizations_url":"https://api.github.com/users/pratid/orgs","repos_url":"https://api.github.com/users/pratid/repos","events_url":"https://api.github.com/users/pratid/events{/privacy}","received_events_url":"https://api.github.com/users/pratid/received_events","type":"User","site_admin":false},"body":"See comment above","created_at":"2016-02-09T13:02:38Z","updated_at":"2016-02-09T13:02:38Z","html_url":"https://github.com/telefonicaid/fiware-glancesync/pull/60#discussion_r52304116","pull_request_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/pulls/60","_links":{"self":{"href":"https://api.github.com/repos/telefonicaid/fiware-glancesync/pulls/comments/52304116"},"html":{"href":"https://github.com/telefonicaid/fiware-glancesync/pull/60#discussion_r52304116"},"pull_request":{"href":"https://api.github.com/repos/telefonicaid/fiware-glancesync/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/pulls/60","id":58727812,"html_url":"https://github.com/telefonicaid/fiware-glancesync/pull/60","diff_url":"https://github.com/telefonicaid/fiware-glancesync/pull/60.diff","patch_url":"https://github.com/telefonicaid/fiware-glancesync/pull/60.patch","issue_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/issues/60","number":60,"state":"open","locked":false,"title":"Feature/5635 glancesync api implementation","user":{"login":"flopezag","id":1379796,"avatar_url":"https://avatars.githubusercontent.com/u/1379796?v=3","gravatar_id":"","url":"https://api.github.com/users/flopezag","html_url":"https://github.com/flopezag","followers_url":"https://api.github.com/users/flopezag/followers","following_url":"https://api.github.com/users/flopezag/following{/other_user}","gists_url":"https://api.github.com/users/flopezag/gists{/gist_id}","starred_url":"https://api.github.com/users/flopezag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flopezag/subscriptions","organizations_url":"https://api.github.com/users/flopezag/orgs","repos_url":"https://api.github.com/users/flopezag/repos","events_url":"https://api.github.com/users/flopezag/events{/privacy}","received_events_url":"https://api.github.com/users/flopezag/received_events","type":"User","site_admin":false},"body":"#### REVIEWERS\r\n@chemaper @pratid @jicarretero \r\n\r\n#### DESCRIPTION\r\nATENTION, DO NOT MERGE THIS PR, IT IS IN PROGRESS, IT IS JUST TO START THE REVIEW PROCESS OF THIS BIG PR...\r\n- Implementation of the GlanceSync API.\r\n- Correction of some Acceptance Tests problems.\r\n- Unit Tests associated to the GlanceSync API.\r\n\r\n#### TESTING\r\nLocally","created_at":"2016-02-09T10:21:21Z","updated_at":"2016-02-09T13:02:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18cfe0232e2645c0578b9d39f9f524dc86abe671","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/pulls/60/commits","review_comments_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/pulls/60/comments","review_comment_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/pulls/comments{/number}","comments_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/issues/60/comments","statuses_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/statuses/a014301798604091246455333a6dcfa6f562525f","head":{"label":"telefonicaid:feature/5635_glancesync_api","ref":"feature/5635_glancesync_api","sha":"a014301798604091246455333a6dcfa6f562525f","user":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"repo":{"id":39255854,"name":"fiware-glancesync","full_name":"telefonicaid/fiware-glancesync","owner":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/telefonicaid/fiware-glancesync","description":"","fork":false,"url":"https://api.github.com/repos/telefonicaid/fiware-glancesync","forks_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/forks","keys_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/keys{/key_id}","collaborators_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/teams","hooks_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/hooks","issue_events_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/issues/events{/number}","events_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/events","assignees_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/assignees{/user}","branches_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/branches{/branch}","tags_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/tags","blobs_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/git/refs{/sha}","trees_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/git/trees{/sha}","statuses_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/statuses/{sha}","languages_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/languages","stargazers_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/stargazers","contributors_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/contributors","subscribers_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/subscribers","subscription_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/subscription","commits_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/commits{/sha}","git_commits_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/git/commits{/sha}","comments_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/comments{/number}","issue_comment_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/issues/comments{/number}","contents_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/contents/{+path}","compare_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/compare/{base}...{head}","merges_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/merges","archive_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/downloads","issues_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/issues{/number}","pulls_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/pulls{/number}","milestones_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/milestones{/number}","notifications_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/labels{/name}","releases_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/releases{/id}","deployments_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/deployments","created_at":"2015-07-17T13:38:48Z","updated_at":"2016-01-20T10:36:58Z","pushed_at":"2016-02-09T10:57:01Z","git_url":"git://github.com/telefonicaid/fiware-glancesync.git","ssh_url":"git@github.com:telefonicaid/fiware-glancesync.git","clone_url":"https://github.com/telefonicaid/fiware-glancesync.git","svn_url":"https://github.com/telefonicaid/fiware-glancesync","homepage":null,"size":30277,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"telefonicaid:develop","ref":"develop","sha":"58c115a55ee2af212674d7e1d36878bd1be229e7","user":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"repo":{"id":39255854,"name":"fiware-glancesync","full_name":"telefonicaid/fiware-glancesync","owner":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/telefonicaid/fiware-glancesync","description":"","fork":false,"url":"https://api.github.com/repos/telefonicaid/fiware-glancesync","forks_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/forks","keys_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/keys{/key_id}","collaborators_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/teams","hooks_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/hooks","issue_events_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/issues/events{/number}","events_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/events","assignees_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/assignees{/user}","branches_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/branches{/branch}","tags_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/tags","blobs_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/git/refs{/sha}","trees_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/git/trees{/sha}","statuses_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/statuses/{sha}","languages_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/languages","stargazers_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/stargazers","contributors_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/contributors","subscribers_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/subscribers","subscription_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/subscription","commits_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/commits{/sha}","git_commits_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/git/commits{/sha}","comments_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/comments{/number}","issue_comment_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/issues/comments{/number}","contents_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/contents/{+path}","compare_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/compare/{base}...{head}","merges_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/merges","archive_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/downloads","issues_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/issues{/number}","pulls_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/pulls{/number}","milestones_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/milestones{/number}","notifications_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/labels{/name}","releases_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/releases{/id}","deployments_url":"https://api.github.com/repos/telefonicaid/fiware-glancesync/deployments","created_at":"2015-07-17T13:38:48Z","updated_at":"2016-01-20T10:36:58Z","pushed_at":"2016-02-09T10:57:01Z","git_url":"git://github.com/telefonicaid/fiware-glancesync.git","ssh_url":"git@github.com:telefonicaid/fiware-glancesync.git","clone_url":"https://github.com/telefonicaid/fiware-glancesync.git","svn_url":"https://github.com/telefonicaid/fiware-glancesync","homepage":null,"size":30277,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/telefonicaid/fiware-glancesync/pulls/60"},"html":{"href":"https://github.com/telefonicaid/fiware-glancesync/pull/60"},"issue":{"href":"https://api.github.com/repos/telefonicaid/fiware-glancesync/issues/60"},"comments":{"href":"https://api.github.com/repos/telefonicaid/fiware-glancesync/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/telefonicaid/fiware-glancesync/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/telefonicaid/fiware-glancesync/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/telefonicaid/fiware-glancesync/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/telefonicaid/fiware-glancesync/statuses/a014301798604091246455333a6dcfa6f562525f"}}}}