384
edits
Changes
→Due Date and Final Submission requirement
In your repository you will find a file called <b>duim.py</b>. This file contains starting code. You will complete the assignment inside duim.py. <b>Do not rename this file or the functions inside, unit tests will fail and you will lose marks!</b>
Also in your repository you will find <b>CheckA2checkA2.py</b>. You can use this check script to check your work.
<!--=== Alternative Starting Code ===
If your section is not providing an invite code to the repo, you should create a GitHub repo, add your instructor as an owner of the repo, and download the following files:
<ul>
<li>[https://raw.githubusercontent.com/OPS445-W22/a2/files/duim.py duim.py (starting code) ]</li>
<li>[https://raw.githubusercontent.com/OPS445-W22/a2/files/CheckA2checkA2.py CheckA2checkA2.py (check script) ]</li>
<!-- <li>[https://ict.senecacollege.ca/~eric.brauer/ops445/a2/duim.py duim.py (starting code) ]</li> -->
<!--li>[https://ict.senecacollege.ca/~eric.brauer/ops445/a2/CheckA2checkA2.py CheckA2checkA2.py (check script) ]</li> --></ul>
== Permitted Modules ==
== Required Functions ==
You will need to complete the functions inside the provided file called <code>duim.py</code>. The provided <code>CheckA2checkA2.py</code> will be used to test these functions.
* <code>call_du_sub()</code> should take the target directory as an argument and return a list of strings returned by the command <b>du -d 1 <target directory></b>.
To test with the check script, run the following:
<code>python3 CheckA2checkA2.py -f -v TestPercent</code>
<code>python3 CheckA2checkA2.py -f -v TestDuSub</code>
== Second Milestone (due August 2) ==
To run the check script, enter the following:
<code>python3 CheckA2checkA2.py -f -v TestDirDict</code>
You will be using a module in the standard library called <b>Argparse</b>. This will help handle more complex sets of options and arguments than simply using sys.argv.
Use the following to test your code:
<code>python3 CheckA2checkA2.py -f -v TestArgs</code>
== Minimum Viable Product ==
** If the user has entered more than one argument, or their argument isn't a valid directory, print an error message.
** If the user doesn't specify any target, use the current directory.
* Call <code>call_du_sub</code> with the target directory. This will return a list.* Pass Call the return value from that function to <code>create_dir_dict</code>with that list to create a dictionary.
* You may wish to create one or more functions to do the following:
** Use the total size of the target directory to calculate percentage.
== The Assignment (due August 9, 11:59pm) ==
* Be sure to make your final commit before the deadline. Don't forget to also use <code>git push</code> to push your code into the online repository!
* Then, copy the contents of your <b>duim.py</b> file into a2_yoursenecauser.py, a text file and submit it to Blackboard along with a2_output.txt generated from '''CheckA2.py -f -v''' script. <i>I will use GitHub to evaluate your deadline, but submitting to Blackboard tells me that you wish to be evaluated.</i>
= Rubric =
! Task !! Maximum mark !! Actual mark
|-
| Program Authorship Declaration First Milestone || 5 10 ||
|-
| required functions design || 5 |||-| required functions readability || 5 |||-| main loop design Second Milestone || 10 |||-| main loop readability || 10 |||-| output function design || 5 ||
|-
| output function readability Program working as intended || 5 10 ||
|-
| additional features implemented required functions design || 20 2 ||
|-
| docstrings and comments main loop design || 5 2 ||
|-
| First Milestone additional features implemented || 10 5 ||
|-
| Second Milestone docstrings and comments || 10 6 ||
|-
| github.com repository: Commit messages and use || 10 5 ||
|-
|'''Total''' || 100 30 ||
|}
Please submit the following files by the due date:
* Push all changes to your Github.* Your python script, named as 'duim.py', in your repository, and also '''submitted to Blackboard''' as a2_yoursenecauser.py, by August 9 at 11:59pm.* Submit it to Blackboard along with a2_output.txt generated from '''CheckA2.py -f -v''' script. <i>I will use GitHub to evaluate your deadline, but submitting to Blackboard tells me that you wish to be evaluated.</i>