next up previous
Next: About this document ...

Assignment #3
CpSc 372: Python Programming
Computer Science Department
Clemson University
Design Patterns: Singleton and Command
Brian Malloy, PhD
June 7, 2006



In order to receive credit for this assignment, your solution must be submitted, using the handin command, by 8 AM, Tuesday, June 13th, 2006. I will zip your files and move them to my directory at that time. You may submit your solution before the deadline as many times as you like; only your final submission will be considered. However, for multiple submissions, it's best to use the same names for files, since only those will be overwritten by your submission.

Figure 1: Screen Capture This figure illustrates a possible GUI for the third assignment.
Image screenshot

The purpose of this assignment is to help you to become familiar with Design Patterns.

Using The Tree.py program, or any of the example programs that accompany Tree.py, construct a GUI driven file management program that permits the user to easily find or delete a specified file, and to undo the find or delete of the specified file. You can use a dialog box, similar to the one that I used in assignment #2, to obtain the file name from the user. When you delete a file, you should not actually delete it; rather, you should create a trash directory at the root directory that you're working from, and move the file to the trash directory. In later iterations of the program, we'll undo deletion, or more accurately, restore the deleted file.

Your program should have at least four classes: a base class for the command pattern, two derived classes to encapsulate the actions for find and delete and a manager class that is implemented as a Singleton Pattern. You should not have to make any changes to the Tree or Node classes stored in Tree.py.

Notes:

  1. Your file management program should be able to find and delete files in expanded directories; i.e., you should be able to handle files that were not visible when you initially started the program.
  2. You should be able to undo both find and delete.
  3. You may not use a pop-up menu on right click to implement your GUI. Your GUI should either be a drop-down menu or should consist of buttons, see Figure 1.

Your program must be written in Python and must contain documentation in the form of a readme file. The readme should contain your name and other important information about you and the assignment; for example, what your assignment does, what it fails to do, anything extra or clever that you have done beyond the assignment specification, and how to run your program.

You must submit your assignment using the handin command.

Here is the handin command:

        handin.372.1 3 *




next up previous
Next: About this document ...
Brian Malloy 2006-06-07