Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkpoint 1 Review Corrections #34

Open
wants to merge 182 commits into
base: review
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
c78f364
Added tests/test_room.py andsrc/room.py, I also implemented two test …
Apr 10, 2016
e063514
Added 3 edge cases test for init method of room
Apr 10, 2016
ea251fa
added allocate method placeholder and two instance variables
Apr 10, 2016
f244f51
Merge pull request #1 from andela-snwuguru/room
Apr 10, 2016
588effa
added person class and one test case for person class
Apr 10, 2016
2384095
added 5 edges cases for person class
Apr 10, 2016
00bfefa
implemented person init method to pass edge cases test
Apr 10, 2016
973c1cb
Merge pull request #2 from andela-snwuguru/person
Apr 10, 2016
ed16220
added 1 test case for allocate method of room
Apr 10, 2016
0e19c36
implemented allocate method or room to pass new test case
Apr 10, 2016
775a583
added 5 test cases to room
Apr 10, 2016
ad8db54
implemented room class to pass new added test cases
Apr 10, 2016
5a6183f
added 1 test case to room
Apr 10, 2016
5fc9acb
Implemented room class to pass new test case
Apr 10, 2016
b10d313
Merge pull request #3 from andela-snwuguru/room
Apr 11, 2016
d893558
Added allocationapp class and one test case for allocationapp
Apr 11, 2016
e375cb0
added data/people.txt and implement loadpeople method to pass 2nd tes…
Apr 11, 2016
87130d1
added 1 test case for allocationapp
Apr 11, 2016
b4f6c23
added util class and modified allocationapp to pass test cases
Apr 11, 2016
1f11a4d
added 3 helper methods to person class and modified allocationapp cla…
Apr 11, 2016
8d39c91
added helper methods to room class and changed beds variable to peopl…
Apr 11, 2016
08bc7a7
added more util methods and implement startapp method in allocationap…
Apr 11, 2016
67a630e
added starttipscommandlistener
Apr 11, 2016
a68db12
added data/rating.txt, an exit method and also refactored runcommand …
Apr 12, 2016
de0c501
refactored runcommand method to accept parameter
Apr 12, 2016
6e4b43d
added clearscreen method to util and implemented it in runcommand met…
Apr 12, 2016
0e88d32
implement the LP command functionality
Apr 13, 2016
eabc198
added DB class an test case for db class
Apr 14, 2016
7036329
completed the migration class and added new methods to db class
Apr 16, 2016
5aefb04
added test case for db find method
Apr 16, 2016
88849f6
added prepare method to db class
Apr 16, 2016
885acb7
Merge pull request #4 from andela-snwuguru/app
Apr 16, 2016
30a3779
resolved db create method to pass test case, I also modified db file …
Apr 16, 2016
c8c0cef
modified migration class to autoincrement primary key and improved db…
Apr 16, 2016
04acca2
optimized db class to better manage opening and closing of db connection
Apr 16, 2016
3ae3ec8
finished db findbyattr and the test cases passed, also added __setatt…
Apr 17, 2016
420fb6b
finalized update, delete of db class and more test cases
Apr 17, 2016
0473bb6
Merge pull request #5 from andela-snwuguru/db
Apr 17, 2016
6a06c17
fellow class added and refactored person class
Apr 17, 2016
72e47e6
added staff class
Apr 17, 2016
914ddc8
refactored person test cases to pass
Apr 17, 2016
b78129c
Merge pull request #6 from andela-snwuguru/person
Apr 17, 2016
41c098e
Added livingspace and office class, also modified room class
Apr 17, 2016
eead3a7
added offce and livingspace class and refactored room class and test …
Apr 17, 2016
c597b98
Merge pull request #7 from andela-snwuguru/room
Apr 17, 2016
432e4cb
added fileman class and it test cases, I also modified util class to …
Apr 18, 2016
ffef54e
added more test case
Apr 18, 2016
f9fadb6
added more test cases and modified filman to pass test
Apr 18, 2016
c9e5f73
added more edge cases test and modified fileman to pass test
Apr 18, 2016
6e7c0ea
Merge pull request #8 from andela-snwuguru/file
Apr 18, 2016
db375a5
added a comment to explain func_map variable
Apr 18, 2016
b7229d7
Merge pull request #9 from andela-snwuguru/app
Apr 18, 2016
925cf74
added pickle dump and load method to fileman and their test cases
Apr 18, 2016
3c52150
ran test fileman
Apr 18, 2016
c54df77
Merge pull request #10 from andela-snwuguru/file
Apr 18, 2016
277fe85
implemented fileman class to person and added test case
Apr 18, 2016
4ff56cb
Merge pull request #11 from andela-snwuguru/person
Apr 18, 2016
3b7cdd3
implemented fileman to room class and added test case
Apr 18, 2016
9e35533
Merge pull request #12 from andela-snwuguru/room
Apr 18, 2016
43c9705
implemented add_person command
Apr 18, 2016
4394768
completed add_person implementation
Apr 18, 2016
27d8628
created amity class and moved command functions into it, I aslo refra…
Apr 19, 2016
aeb1e36
implemented reallocate_person command
Apr 19, 2016
259ddd9
Implemented load_people command
Apr 19, 2016
1ca34d0
completed the print_allocations command feature
Apr 20, 2016
c79593b
implemented print_unallocated command
Apr 20, 2016
f575f72
implemented print_room command
Apr 20, 2016
2fe79fc
implemented save_state command, I also modified person, room, migrati…
Apr 20, 2016
fc9a6a1
modified print_allocations and print_unallocated to display message w…
Apr 21, 2016
18a9580
Modified list_people and list_room
Apr 21, 2016
7efec03
implemented load_state command
Apr 21, 2016
c89ad16
optimization and modification to print_unllocated
Apr 21, 2016
6b7f3fe
Modifying code to pass edge cases
Apr 22, 2016
e0f39b9
completed load_state and save_state to use specified sqlite db
Apr 22, 2016
b095ffc
Merge pull request #13 from andela-snwuguru/app
Apr 22, 2016
c6866e5
Refactored db class to follow python naming convention
Apr 22, 2016
d88b6cd
Refactored fileman class and util class to follow python naming conve…
Apr 22, 2016
c09ed17
Refactored person class to follow python naming convention
Apr 22, 2016
d888167
Refactored room class to follow python naming convention
Apr 22, 2016
9631a7b
Refactored amity class to follow python naming convention and correct…
Apr 22, 2016
80b8b1d
Merge pull request #14 from andela-snwuguru/refactor
Apr 22, 2016
40e8574
added allocate_person command
Apr 22, 2016
292c523
Merge pull request #15 from andela-snwuguru/app
Apr 22, 2016
b47e5d4
deleted unused files
Apr 22, 2016
5ce0b72
Merge pull request #16 from andela-snwuguru/refactor
Apr 22, 2016
275de6a
added date_time display to person details
Apr 23, 2016
1969554
refactored person class and commented methods
Apr 23, 2016
5ba0057
added docstring to amity class methods and migration class
Apr 23, 2016
7c2ee26
added docstring to room class methods
Apr 23, 2016
6230d8f
implement -u and -a options in list_people command
Apr 23, 2016
a61cb21
implemented -u and -a options in list_rooms command
Apr 23, 2016
e426d3d
modified list rooms to enumeate from one
Apr 23, 2016
8255b9e
added options description to docopt command definitions
Apr 23, 2016
57ba455
modified readme
Apr 23, 2016
5616ac0
modified readme
Apr 23, 2016
916af6f
modified readme
Apr 23, 2016
02be453
modified readme
Apr 23, 2016
b189002
Finalized readme content
Apr 23, 2016
284255e
modified readme
Apr 23, 2016
6b5f878
Merge pull request #17 from andela-snwuguru/refactor
Apr 23, 2016
db177b5
deleted unnecessary files
Apr 24, 2016
612c08b
removed .pyc files
Apr 25, 2016
7bd478c
added validtion to duplicate creation of person and room
Apr 25, 2016
8b87810
added allocation count to print_allocations command
Apr 25, 2016
708b07d
refactored load_state to give feedback after complete load
Apr 25, 2016
7f7adfa
modified allocation export to file for better display
Apr 25, 2016
0242f1a
modified amity allocate method to randomly allocate person instead of…
Apr 25, 2016
9aa9c5a
added gitignore file
Apr 25, 2016
e8a0707
remove .pyc file and added .pkl to gitignore
Apr 25, 2016
5e0ab48
removed .txt and .pkl file from data
Apr 25, 2016
32b8d68
Merge pull request #18 from andela-snwuguru/refactor
Apr 25, 2016
9fcba81
refactored test_db.py
Apr 25, 2016
fc64397
removed .txt and .pkl from .gitignore
Apr 25, 2016
d906fa8
Merge pull request #19 from andela-snwuguru/refactor
Apr 25, 2016
9d0d890
added helper methods in person
Apr 26, 2016
7ba06ef
refactored amity class to ahere to pep8 style guide
Apr 26, 2016
231d0fd
refactored amitroom class to ahere to pep8 style guide
Apr 26, 2016
718bbf8
refactored every class to ahere to pep8 style guide
Apr 26, 2016
99de92a
changed date_time to class instance in person class
Apr 26, 2016
5a6b139
fixed failing test
Apr 26, 2016
055b4c7
Merge pull request #20 from andela-snwuguru/refactor
Apr 27, 2016
561b4be
added .travis.yml file
Apr 27, 2016
43a8fa2
Merge pull request #21 from andela-snwuguru/ci
Apr 27, 2016
29f66c5
modified travis file and added .coveragerc file
Apr 27, 2016
faffc19
modified travis file
Apr 27, 2016
ed0c232
added .coversge.yml file
Apr 27, 2016
30208b3
Merge pull request #22 from andela-snwuguru/ci
Apr 27, 2016
e4ef60d
modified travis file
Apr 27, 2016
01e5f23
modified travis file
Apr 27, 2016
d8ff931
modified travis file
Apr 27, 2016
f317ec9
modified readme file
Apr 27, 2016
4d44ee9
Added badge section to readme
Apr 28, 2016
92bf4cb
Merge pull request #23 from andela-snwuguru/ci
Apr 28, 2016
018ab69
fixed bug in reallocate_person command
Apr 28, 2016
ba0f4d8
added remove_person to the list of command
Apr 28, 2016
89bf38f
modified travis file
Apr 28, 2016
f866b3c
added test.py file
Apr 28, 2016
d573126
Added coverage badge to readme
Apr 29, 2016
bf34f5a
Merge pull request #24 from andela-snwuguru/refactor
Apr 29, 2016
8e2462b
modified readme
Apr 29, 2016
73520fc
modified readme
Apr 29, 2016
81f0d24
Merge pull request #25 from andela-snwuguru/refactor
Apr 29, 2016
7eb7cd3
Improved allocation command to allocate an office for fellow
Apr 29, 2016
7e23a43
fixed bugs arising from change to allocation method
Apr 29, 2016
c69749c
fixed bug in load_state and save_state due to change in assigned_room…
Apr 29, 2016
8b7a160
fixed room class to pass failing tests cases in test_room.py
Apr 29, 2016
c17ceec
Merge pull request #26 from andela-snwuguru/app
Apr 29, 2016
3a11bde
fixed bug in allocate_person and remove_person method
Apr 30, 2016
f32c0a3
fixed bug in add_peson method
Apr 30, 2016
09d518a
fixed bug in reallocate_peson method
Apr 30, 2016
13fde5a
fixed bug in realload_state method
Apr 30, 2016
d81feb9
fixed bug in print_unallocated method
May 2, 2016
57966d1
Merge pull request #27 from andela-snwuguru/app
May 2, 2016
4d0068f
updated .coverages.yml
May 3, 2016
ef409a0
modified travis.yml
May 3, 2016
a1e4905
modified travis.yml
May 3, 2016
ad91990
modified travis.yml
May 3, 2016
a9f91d8
modified travis.yml
May 3, 2016
9e6982a
modified travis.yml
May 3, 2016
cca66d3
modified travis.yml
May 3, 2016
4fa5923
Added more test cases
May 3, 2016
29cf295
Added more test cases for amity class
May 3, 2016
1146700
Added more test cases for amity class
May 4, 2016
a02da78
Merge pull request #28 from andela-snwuguru/refactor
May 4, 2016
9980823
Freezed all requirements and modified .travis.yml
May 9, 2016
1e55d63
Merge pull request #29 from andela-snwuguru/refactor
May 9, 2016
f7227b5
modified readme
May 9, 2016
8574cfd
modified readme
May 9, 2016
50f8d22
modified readme
May 9, 2016
d1f16c7
Merge pull request #30 from andela-snwuguru/refactor
May 9, 2016
1b1217b
Refactored code and added .txt and .pkl to gitignor file
May 11, 2016
2882717
Refactored code and corrected error messages. I also added a clear co…
May 12, 2016
0533e4e
fixed test cases
May 12, 2016
6851269
modified readme
May 12, 2016
4b9fc45
removed unnecessary files
May 12, 2016
54aa3da
Merge branch 'refactor'
May 12, 2016
629940b
deleted unnecessary files
May 12, 2016
0f1b2a8
deleted files
May 12, 2016
555cd7f
fixed merge conflict
May 12, 2016
902a586
Removed numbering in test cases and corrected misplace docstring
May 12, 2016
5876629
Corrected merge conflict in requirements.txt
May 12, 2016
867f918
Merge pull request #33 from andela-snwuguru/refactor
May 12, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .coverage
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!coverage.py: This is a private format, don't read it directly!{"lines": {"/Users/andela/Documents/projects/room-allocation/src/person.py": [1, 4, 5, 7, 8, 9, 10, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 25, 30, 31, 32, 34, 41, 45, 46, 47, 48, 49, 50, 51, 55, 68, 73, 76, 77, 78, 79, 81, 89, 92, 94, 96, 98, 99, 100, 102, 113, 114, 116, 117], "/Users/andela/Documents/projects/room-allocation/src/util.py": [1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 14, 16, 18, 20, 21, 23, 29, 33, 37, 39, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 61, 62, 63], "/Users/andela/Documents/projects/room-allocation/src/room.py": [1, 2, 5, 6, 8, 9, 11, 12, 14, 15, 16, 17, 18, 20, 23, 24, 25, 27, 28, 30, 31, 32, 34, 35, 36, 38, 41, 42, 43, 44, 45, 46, 48, 49, 51, 53, 55, 61, 62, 63, 64, 65, 67, 69, 70, 72, 76, 79, 80, 83, 84, 86, 87, 89, 91, 94, 96], "/Users/andela/Documents/projects/room-allocation/test.py": [1, 3, 4], "/Users/andela/Documents/projects/room-allocation/src/amity.py": [1, 3, 4, 5, 6, 7, 8, 521, 522, 11, 524, 525, 526, 15, 528, 17, 18, 19, 20, 21, 22, 23, 24, 516, 538, 539, 28, 542, 517, 33, 34, 35, 37, 40, 41, 554, 44, 47, 48, 49, 530, 51, 513, 350, 56, 58, 573, 62, 64, 523, 68, 70, 275, 73, 74, 77, 78, 79, 592, 81, 82, 83, 84, 85, 86, 88, 89, 91, 92, 93, 95, 96, 97, 99, 100, 293, 102, 529, 616, 106, 107, 108, 109, 110, 112, 531, 116, 117, 118, 119, 120, 124, 125, 126, 533, 128, 131, 132, 133, 134, 135, 136, 138, 535, 141, 142, 143, 144, 657, 146, 148, 661, 662, 151, 152, 153, 155, 162, 163, 676, 165, 169, 170, 172, 173, 174, 175, 176, 177, 179, 692, 182, 183, 184, 185, 186, 188, 189, 190, 191, 192, 194, 195, 198, 199, 201, 204, 205, 206, 207, 208, 210, 211, 212, 213, 216, 217, 218, 219, 221, 223, 229, 536, 231, 232, 234, 235, 236, 238, 239, 240, 241, 243, 244, 248, 281, 42, 254, 255, 256, 640, 258, 259, 537, 261, 145, 267, 268, 269, 271, 272, 273, 643, 276, 277, 278, 280, 644, 285, 645, 291, 292, 646, 296, 297, 647, 300, 301, 302, 303, 307, 310, 311, 312, 527, 299, 660, 317, 318, 319, 321, 324, 325, 326, 328, 329, 331, 334, 335, 336, 337, 338, 339, 340, 341, 343, 344, 345, 347, 540, 351, 352, 353, 355, 356, 230, 359, 362, 363, 364, 365, 366, 368, 370, 373, 374, 375, 377, 382, 383, 385, 387, 392, 393, 394, 395, 397, 400, 401, 402, 403, 404, 408, 414, 419, 420, 424, 425, 433, 313, 435, 440, 441, 442, 443, 447, 451, 452, 453, 454, 460, 462, 465, 466, 467, 468, 472, 164, 476, 477, 478, 479, 481, 482, 484, 357, 490, 492, 495, 496, 497, 501, 504, 505, 506, 507, 508, 509], "/Users/andela/Documents/projects/room-allocation/tests/test_fileman.py": [1, 2, 3, 4, 6, 7, 9, 10, 11, 13, 14, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 28, 29, 30, 32, 33, 34, 35, 36, 38, 39, 40, 41, 44, 45, 46, 48, 49, 50, 52, 53, 54, 55, 56, 57, 59, 60, 61, 63, 64, 65, 66, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 80, 82], "/Users/andela/Documents/projects/room-allocation/tests/test_db.py": [1, 2, 3, 4, 5, 6, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 26, 27, 28, 29, 31, 32, 33, 36, 37, 38, 40, 41, 42, 43, 44, 45, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 59, 60, 61, 62, 63, 65, 66, 67, 69, 70, 71, 73, 74, 75, 77, 78, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 97, 104], "/Users/andela/Documents/projects/room-allocation/src/livingspace.py": [8, 1, 4, 5, 7], "/Users/andela/Documents/projects/room-allocation/src/fileman.py": [1, 2, 3, 6, 7, 9, 10, 11, 13, 14, 17, 18, 21, 27, 28, 30, 31, 32, 33, 34, 36, 39, 40, 42, 43, 44, 46, 49, 50, 52, 53, 55, 58, 59, 61, 63, 66, 67, 68, 70, 73, 75, 78, 79, 80, 82, 85, 86, 88, 89], "/Users/andela/Documents/projects/room-allocation/tests/test_room.py": [1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 13, 14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 43, 44, 45, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 62, 65, 67, 70, 71, 72, 73, 75, 76, 77, 78, 80, 81, 82, 83, 84, 86], "/Users/andela/Documents/projects/room-allocation/src/staff.py": [8, 1, 4, 5, 7], "/Users/andela/Documents/projects/room-allocation/tests/test_person.py": [1, 2, 3, 4, 6, 7, 9, 10, 11, 12, 14, 15, 16, 18, 19, 20, 22, 25, 27, 28, 30, 31, 33], "/Users/andela/Documents/projects/room-allocation/src/db.py": [1, 2, 3, 6, 7, 9, 10, 11, 12, 13, 15, 18, 19, 21, 24, 26, 28, 31, 33, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 49, 50, 51, 52, 54, 55, 56, 58, 61, 62, 63, 66, 67, 69, 72, 73, 74, 75, 78, 79, 81, 84, 85, 86, 87, 90, 93, 94, 95, 96, 97, 98, 99, 100, 101, 103, 106, 107, 108, 109, 111, 114, 115, 116, 118, 120, 122, 125, 128, 129, 131, 134, 135, 137, 138, 139, 140, 142, 148, 149, 150, 152, 153, 155, 156, 157, 159, 168, 171, 172, 173], "/Users/andela/Documents/projects/room-allocation/src/office.py": [8, 1, 4, 5, 7], "/Users/andela/Documents/projects/room-allocation/src/fellow.py": [1, 3, 4, 6], "/Users/andela/Documents/projects/room-allocation/tests/test_amity.py": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 29, 30, 31, 32, 33, 35, 36, 37, 39, 40, 41, 43, 44, 45, 46, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80, 82, 83, 84, 85, 86, 87, 88, 89, 91, 92, 93, 94, 95, 97, 98, 99, 100, 101, 102, 104, 105, 107, 108, 109, 110, 111, 113, 114, 115, 116, 117, 119, 120, 121, 122, 124, 125, 126, 127, 128, 129, 131, 132, 133, 134, 135, 136, 138, 139, 140, 141, 142, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 156, 157, 158, 159, 160, 163, 164, 165, 166, 167, 168, 169, 170, 173, 174, 175, 176, 177, 178, 180, 181, 182, 183, 184, 185, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 198, 201, 202, 203, 204, 206, 207, 208, 209, 210, 211, 213]}}
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[report]
omit =
*/python?.?/*
*/site-packages/nose/*
*__init__*
src/migration.py
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.pyc
*.db
src/*.pyc
data/*.pyc
data/*.pkl
data/*.txt
tests/htmlcov/*

10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: python
python:
- "2.7"
# command to install dependencies
install:
- pip install -r requirements.txt
script:
- nosetests --with-coverage
after_success:
- coveralls
65 changes: 64 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,64 @@
# room-allocation
Room Allocation
===============
[![Build Status](https://travis-ci.org/andela-snwuguru/room-allocation.svg?branch=master)](https://travis-ci.org/andela-snwuguru/room-allocation) [![Coverage Status](https://coveralls.io/repos/github/andela-snwuguru/room-allocation/badge.svg?branch=master)](https://coveralls.io/github/andela-snwuguru/room-allocation?branch=master)

Room Allocation is a checkpoint 1 project used to evaluate Fellow proviciency in Python programming. This is not a real solution for room allocation but it is a good start for python beginners.

### Features

- Create rooms
- Add Person
- Auto allocate person to a room when added
- Reallocate person
- remove person
- Manual allocation of person
- Display allocations
- Load people from text file (see sample text file format below)
- Display unallocated people and room
- Display rooms base on allocated or unallocated
- Display room details with list of members
- Save state to sqlite database
- Load state from sqlite database

### Dependecies

- Docopt `` pip install docopt ``
- Tabulate `` pip install tabulate ``
- Coverage `` pip install coverage ``
- Python 2.7.X and above

### How to use

- Clone project `` git clone git@github.com:andela-snwuguru/room-allocation.git ``
- Create a virtual environment `` mkvirtualenv ara ``
- Install dependecies `` pip install -r requirements.txt ``
- Navigate to project folder `` cd ~/room-allocation ``
- See list of available command `` python ara.py -h ``

### Sample Operations

- Create multiple rooms `` python ara.py create_room "room 1" "office" "room 2" "living" ``
- Add Person `` python ara.py add_person "Sunday" "Nwuguru" "fellow" -w ``
- Reallocate person `` python ara.py reallocate_person "SN3" "room 2" ``
- remove person `` python ara.py remove_person "SN3" "room 2" ``
- Allocate person `` python ara.py reallocate_person "SN3" "room 2" -w ``
- Load people from text file `` python ara.py load_people "people.txt" ``
- Display allocations `` python ara.py print_allocations ``
- Export allocations to file `` python ara.py print_allocations "allocation.txt" `` exported file will be located in data folder
- Display unallocated `` python ara.py print_unallocated ``
- Export unallocated to file `` python ara.py print_unallocated "unallocated.txt" `` exported file will be located in data folder
- Display room details `` python ara.py print_room "room 1" ``
- Display people `` python ara.py list_people ``
- Display unallocated people `` python ara.py list_people -u``
- Display rooms `` python ara.py list_rooms ``
- Display allocated rooms `` python ara.py list_rooms -a``
- Save current state to sqlite database `` python ara.py save_state "my_db" ``
- Load current state from sqlite database `` python ara.py load_state "my_db" ``
- Clear Records `` python ara.py clear ``

### How to Contribute

- Fork Repo
- Create new branch and add your contribution
- Push to your branch
- Raise a pull request
Binary file added amity.db
Binary file not shown.
Binary file added amity_test.db
Binary file not shown.
60 changes: 60 additions & 0 deletions ara.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
"""Amity Room Allocation

Usage:
ara create_room (<room_name> <room_type>)...
ara add_person (<firstname> <lastname> <person_type>) [-w]
ara reallocate_person <person_id> <new_room_name> [-l]
ara allocate_person <person_id> <new_room_name> [-w]
ara remove_person <person_id> <current_room_name>
ara load_people <file_location>
ara print_allocations [(-o <file_name>)]
ara print_unallocated [(-o <file_name>) -r]
ara print_room <name_of_room>
ara save_state [--db=sqlite_database -v]
ara load_state [--db=sqlite_database]
ara list_people [-u | -a]
ara list_rooms [-u | -a]
ara clear


Options:
-h --help Show this screen.
-w Wants accomodation
-u Unallocated
-r Rooms
-a Allocated
-o Output file name
-l Living Space
-v Show Logs

"""
from docopt import docopt
from src.amity import Amity


#function mapping to avoid long if else chain
func_map = [
'create_room',
'add_person',
'reallocate_person',
'load_people',
'print_allocations',
'print_unallocated',
'print_room',
'save_state',
'load_state',
'list_people',
'list_rooms',
'allocate_person',
'remove_person',
'clear',
]

if __name__ == '__main__':
arguments = docopt(__doc__)

for command in func_map:
if arguments[command]:
amity = Amity(command)
amity.run_command(arguments)
break
5 changes: 5 additions & 0 deletions data/config.pkl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(dp0
S'drop_db'
p1
I00
s.
93 changes: 93 additions & 0 deletions data/people.pkl
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
(lp0
ccopy_reg
_reconstructor
p1
(csrc.fellow
Fellow
p2
c__builtin__
object
p3
Ntp4
Rp5
(dp6
S'living_space'
p7
I00
sS'uid'
p8
S'TU2'
p9
sS'firstname'
p10
S'TEST'
p11
sS'lastname'
p12
S'USER'
p13
sS'is_allocated'
p14
I01
sS'util'
p15
g1
(csrc.util
Util
p16
g3
Ntp17
Rp18
(dp19
S'file_manager'
p20
g1
(csrc.fileman
FileMan
p21
g3
Ntp22
Rp23
(dp24
S'file_location'
p25
S'/Users/andela/Documents/projects/room-allocation/data/people.pkl'
p26
sS'base'
p27
S'/Users/andela/Documents/projects/room-allocation'
p28
sbsS'db'
p29
g1
(csrc.db
Db
p30
g3
Ntp31
Rp32
(dp33
S'db_location'
p34
S'/Users/andela/Documents/projects/room-allocation/amity.db'
p35
sS'table_name'
p36
S'table_name'
p37
sS'error_message'
p38
S''
p39
sS'name'
p40
S'amity'
p41
sbsbsS'assigned_room'
p42
(dp43
S'OFFICE'
p44
S'TESTROOM 2'
p45
ssba.
2 changes: 2 additions & 0 deletions data/people_test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
OLUWAFEMI SULE FELLOW Y
DOMINIC WALTERS STAFF
4 changes: 4 additions & 0 deletions data/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Data folder

This folder is very vital to the functionality of this project.
Don't delete it
Loading