Changes

Jump to: navigation, search

OPS435 Online Assignment 2

37 bytes added, 20:09, 19 July 2020
m
Suggested Process
=== Suggested Process ===
0. <ol><li> Read the rest of this document, try and understand what is expected. 1. <li> Use the invite link posted to Blackboard to accept the assignment, and clone the repo to a Linux machine.2. <li> Copy a2_template.py into a2_<myseneca_id>.py. Replace with your Myseneca username.3. <li> Run the script itself. Investigate argparse. Experiment with the various options, particularly -v. Read the docs, what option must you implement? Go ahead and implement it. Test with print() for now. <b>Commit the change.</b>4. <li> Investigate the `parse_user()` function, with the <code>usage_data_file</code>. This should take the list of lines from the file, and instead return a list of usernames. <b>Commit the change.</b>5. <li> Use argparse with `-l user` `usage__data_file` to call the `parse_user()` function. <b>Commit the change.</b>6. <li> Write a function to print the list from `parse_for_user()`. Now you have input -> processing -> output. <b>Continue committing these changes as your proceed.</b>7. <li> Implement the same things as parse_for_user but for `parse_for_hosts`. Output should be sorted. 8. <li> Compare your output with the output below.9. <li> Write the `parse_for_daily()` function using the pseudocode given. This should be taking the list of lines from your file, and output a list of lists with start dates in DD/MM/YYYY format as well usage in seconds.10. <li> [['01/01/1980', '1200'], ['02/01/1980', '2400'], ['03/01/1980', '2200']]11. <li> Once your `parse_for_daily()` function works, call it with the argparse options, and display the contents.12. <li> Write (or modify) a function to do the same for remote hosts.13. <li> Implement the outputting of the duration in HH:MM:SS instead of seconds. It's recommended you write a function to take in seconds and return a string. Call this when the `-s` option is absent. Make sure this is working with remote hosts as well. You should now have x of y tests passing.14. <li> Finally, implement the `--monthly` option. Create a new function and get it working. start with seconds, then duration and make sure it works with remote as well.15. <li> Perform last checks and document your code. Write **why** your code is doing what it does, rather than **what** it's doing. You should have 100% of tests succeeding.</ol>
=== Sample Outputs ===

Navigation menu