{"action":"created","comment":{"url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/pulls/comments/65163991","id":65163991,"diff_hunk":"@@ -0,0 +1,231 @@\n+from __future__ import print_function\n+import random\n+import sqlite3\n+import sys\n+import tkFileDialog\n+from Tkinter import Tk\n+\n+from clint.textui import colored, puts\n+from colorama import init, Back, Style  # Fore\n+from pyfiglet import figlet_format\n+from termcolor import cprint\n+from .models.person import Person, Fellow, Staff\n+from .models.room import Office, LivingSpace\n+import ipdb\n+\n+\n+class Amity(object):\n+    \"\"\"Description for amity\"\"\"\n+\n+    def __init__(self, db_name=\"amity.sqlite\"):\n+\n+        self.conn = sqlite3.connect(db_name)\n+        self.connect = self.conn.cursor()\n+        self.rooms = {\n+            'O': {}, 'L': {}\n+        }\n+        self.people = {\n+            'staff and fellow': [],\n+            'fellow to house': []\n+        }\n+        # People who have not been allocated to an office or living space\n+        self.unallocated = {\n+            'O': [], 'L': []\n+        }\n+\n+        # People that have been fully occupied\n+        self.allocated_office = {}\n+        self.allocated_living = {}\n+\n+        self.space = {}\n+\n+    def create_rooms(self, rooms, room_type=None):\n+        \"\"\"Allows user to enter a list of room names specifying\n+                whether office or living spaces\"\"\"\n+        if room_type is None:\n+\n+            room_type = raw_input(\n+                \"Enter room type: \\n O: Office space \\n L: Living space: \\n\"\n+            )\n+            while room_type != \"O\" and room_type != \"L\":\n+                room_type = raw_input(\n+                    \"Try again. Enter Room Type:\\n O: Office space \\n L: Living space: \\n\"\n+                )\n+        random.shuffle(rooms)\n+        for room_name in rooms:\n+            if room_type.upper() == 'O':\n+                self.space = Office(room_name)\n+                self.rooms['O'].update({room_name: []})\n+\n+            else:\n+                self.space = LivingSpace(room_name)\n+                self.rooms['L'].update({room_name: []})\n+        print(self.rooms)\n+        print('New rooms succesfully created')\n+\n+    def add_person(self, first_name, last_name, person_type, want_housing):\n+        name = first_name + \" \" + last_name\n+        person_type = person_type\n+        want_housing = want_housing\n+        person = Person.create_person(name, person_type, want_housing)\n+        if want_housing.upper() == 'Y':\n+            self.people['fellow to house'].append(person)\n+            self.allocate_room(person, 'L')\n+        else:\n+            self.people['staff and fellow'].append(person)\n+        self.allocate_room(person, 'O')\n+\n+    def allocate_room(self, person, room_type):\n+        \"\"\"\n+        Get the number of occupants,Alllocate the room till they are full, if room\n+        filled remove it else alllocate room, then store unallocated\"\"\"\n+        for room_name, people_space in self.rooms[room_type].iteritems():\n+            check_capacity = len(people_space)\n+            if not self.space.is_filled(check_capacity):","path":"main/app.py","position":84,"original_position":84,"commit_id":"4772b574df0ae62d6c3493635602c9bcd4763bd4","original_commit_id":"4772b574df0ae62d6c3493635602c9bcd4763bd4","user":{"login":"andela-cnnadi","id":3100850,"avatar_url":"https://avatars.githubusercontent.com/u/3100850?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-cnnadi","html_url":"https://github.com/andela-cnnadi","followers_url":"https://api.github.com/users/andela-cnnadi/followers","following_url":"https://api.github.com/users/andela-cnnadi/following{/other_user}","gists_url":"https://api.github.com/users/andela-cnnadi/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-cnnadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-cnnadi/subscriptions","organizations_url":"https://api.github.com/users/andela-cnnadi/orgs","repos_url":"https://api.github.com/users/andela-cnnadi/repos","events_url":"https://api.github.com/users/andela-cnnadi/events{/privacy}","received_events_url":"https://api.github.com/users/andela-cnnadi/received_events","type":"User","site_admin":false},"body":"**Code Quality: Nitpick**\r\n\r\nWhat is happening here? I thought we already talked about making `is_filled()` a method of the room object?","created_at":"2016-05-31T11:21:31Z","updated_at":"2016-05-31T11:21:31Z","html_url":"https://github.com/andela-mochieng/Amity_room_allocation/pull/2#discussion_r65163991","pull_request_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/pulls/comments/65163991"},"html":{"href":"https://github.com/andela-mochieng/Amity_room_allocation/pull/2#discussion_r65163991"},"pull_request":{"href":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/pulls/2","id":71835842,"html_url":"https://github.com/andela-mochieng/Amity_room_allocation/pull/2","diff_url":"https://github.com/andela-mochieng/Amity_room_allocation/pull/2.diff","patch_url":"https://github.com/andela-mochieng/Amity_room_allocation/pull/2.patch","issue_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/issues/2","number":2,"state":"open","locked":false,"title":"New develop","user":{"login":"andela-mochieng","id":12407721,"avatar_url":"https://avatars.githubusercontent.com/u/12407721?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-mochieng","html_url":"https://github.com/andela-mochieng","followers_url":"https://api.github.com/users/andela-mochieng/followers","following_url":"https://api.github.com/users/andela-mochieng/following{/other_user}","gists_url":"https://api.github.com/users/andela-mochieng/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-mochieng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-mochieng/subscriptions","organizations_url":"https://api.github.com/users/andela-mochieng/orgs","repos_url":"https://api.github.com/users/andela-mochieng/repos","events_url":"https://api.github.com/users/andela-mochieng/events{/privacy}","received_events_url":"https://api.github.com/users/andela-mochieng/received_events","type":"User","site_admin":false},"body":"Correcting code functionality","created_at":"2016-05-29T19:52:27Z","updated_at":"2016-05-31T11:21:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d7ecbea404e8e423d5bca5300afd6a0ae85c4a2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/pulls/2/commits","review_comments_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/pulls/2/comments","review_comment_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/issues/2/comments","statuses_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/statuses/4772b574df0ae62d6c3493635602c9bcd4763bd4","head":{"label":"andela-mochieng:new_develop","ref":"new_develop","sha":"4772b574df0ae62d6c3493635602c9bcd4763bd4","user":{"login":"andela-mochieng","id":12407721,"avatar_url":"https://avatars.githubusercontent.com/u/12407721?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-mochieng","html_url":"https://github.com/andela-mochieng","followers_url":"https://api.github.com/users/andela-mochieng/followers","following_url":"https://api.github.com/users/andela-mochieng/following{/other_user}","gists_url":"https://api.github.com/users/andela-mochieng/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-mochieng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-mochieng/subscriptions","organizations_url":"https://api.github.com/users/andela-mochieng/orgs","repos_url":"https://api.github.com/users/andela-mochieng/repos","events_url":"https://api.github.com/users/andela-mochieng/events{/privacy}","received_events_url":"https://api.github.com/users/andela-mochieng/received_events","type":"User","site_admin":false},"repo":{"id":56297702,"name":"Amity_room_allocation","full_name":"andela-mochieng/Amity_room_allocation","owner":{"login":"andela-mochieng","id":12407721,"avatar_url":"https://avatars.githubusercontent.com/u/12407721?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-mochieng","html_url":"https://github.com/andela-mochieng","followers_url":"https://api.github.com/users/andela-mochieng/followers","following_url":"https://api.github.com/users/andela-mochieng/following{/other_user}","gists_url":"https://api.github.com/users/andela-mochieng/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-mochieng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-mochieng/subscriptions","organizations_url":"https://api.github.com/users/andela-mochieng/orgs","repos_url":"https://api.github.com/users/andela-mochieng/repos","events_url":"https://api.github.com/users/andela-mochieng/events{/privacy}","received_events_url":"https://api.github.com/users/andela-mochieng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andela-mochieng/Amity_room_allocation","description":"Checkpoint 1 application that allocated Andela Staff Oficces and living spaces.","fork":false,"url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation","forks_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/forks","keys_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/teams","hooks_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/hooks","issue_events_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/issues/events{/number}","events_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/events","assignees_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/assignees{/user}","branches_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/branches{/branch}","tags_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/tags","blobs_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/languages","stargazers_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/stargazers","contributors_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/contributors","subscribers_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/subscribers","subscription_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/subscription","commits_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/contents/{+path}","compare_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/merges","archive_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/downloads","issues_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/issues{/number}","pulls_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/labels{/name}","releases_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/releases{/id}","deployments_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/deployments","created_at":"2016-04-15T06:46:49Z","updated_at":"2016-05-24T15:41:03Z","pushed_at":"2016-05-29T19:52:27Z","git_url":"git://github.com/andela-mochieng/Amity_room_allocation.git","ssh_url":"git@github.com:andela-mochieng/Amity_room_allocation.git","clone_url":"https://github.com/andela-mochieng/Amity_room_allocation.git","svn_url":"https://github.com/andela-mochieng/Amity_room_allocation","homepage":"","size":159,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"andela-mochieng:master","ref":"master","sha":"c7af2f82945d1d9e6c924b9cb4511b8ee7455af6","user":{"login":"andela-mochieng","id":12407721,"avatar_url":"https://avatars.githubusercontent.com/u/12407721?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-mochieng","html_url":"https://github.com/andela-mochieng","followers_url":"https://api.github.com/users/andela-mochieng/followers","following_url":"https://api.github.com/users/andela-mochieng/following{/other_user}","gists_url":"https://api.github.com/users/andela-mochieng/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-mochieng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-mochieng/subscriptions","organizations_url":"https://api.github.com/users/andela-mochieng/orgs","repos_url":"https://api.github.com/users/andela-mochieng/repos","events_url":"https://api.github.com/users/andela-mochieng/events{/privacy}","received_events_url":"https://api.github.com/users/andela-mochieng/received_events","type":"User","site_admin":false},"repo":{"id":56297702,"name":"Amity_room_allocation","full_name":"andela-mochieng/Amity_room_allocation","owner":{"login":"andela-mochieng","id":12407721,"avatar_url":"https://avatars.githubusercontent.com/u/12407721?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-mochieng","html_url":"https://github.com/andela-mochieng","followers_url":"https://api.github.com/users/andela-mochieng/followers","following_url":"https://api.github.com/users/andela-mochieng/following{/other_user}","gists_url":"https://api.github.com/users/andela-mochieng/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-mochieng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-mochieng/subscriptions","organizations_url":"https://api.github.com/users/andela-mochieng/orgs","repos_url":"https://api.github.com/users/andela-mochieng/repos","events_url":"https://api.github.com/users/andela-mochieng/events{/privacy}","received_events_url":"https://api.github.com/users/andela-mochieng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andela-mochieng/Amity_room_allocation","description":"Checkpoint 1 application that allocated Andela Staff Oficces and living spaces.","fork":false,"url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation","forks_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/forks","keys_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/teams","hooks_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/hooks","issue_events_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/issues/events{/number}","events_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/events","assignees_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/assignees{/user}","branches_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/branches{/branch}","tags_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/tags","blobs_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/languages","stargazers_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/stargazers","contributors_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/contributors","subscribers_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/subscribers","subscription_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/subscription","commits_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/contents/{+path}","compare_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/merges","archive_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/downloads","issues_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/issues{/number}","pulls_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/labels{/name}","releases_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/releases{/id}","deployments_url":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/deployments","created_at":"2016-04-15T06:46:49Z","updated_at":"2016-05-24T15:41:03Z","pushed_at":"2016-05-29T19:52:27Z","git_url":"git://github.com/andela-mochieng/Amity_room_allocation.git","ssh_url":"git@github.com:andela-mochieng/Amity_room_allocation.git","clone_url":"https://github.com/andela-mochieng/Amity_room_allocation.git","svn_url":"https://github.com/andela-mochieng/Amity_room_allocation","homepage":"","size":159,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/pulls/2"},"html":{"href":"https://github.com/andela-mochieng/Amity_room_allocation/pull/2"},"issue":{"href":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/issues/2"},"comments":{"href":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/andela-mochieng/Amity_room_allocation/statuses/4772b574df0ae62d6c3493635602c9bcd4763bd4"}}}}
{"actor":{"display_login":"andela-cnnadi"}}