| 9 | image_extentions = '.bmp', '.gif', '.jpg', '.png' |
| 10 | |
| 11 | def main(): |
| 12 | # Default Settings |
| 13 | title = 'Image Viewer' |
| 14 | image = '' |
| 15 | action = basename(argv[0]) |
| 16 | back = '' |
| 17 | forward = '' |
| 18 | hidden = '' |
| 19 | if dictionary is None: |
| 20 | # Nothing To Do |
| 21 | pass |
| 22 | elif dictionary.had_key('directory'): |
| 23 | # Something To Do |
| 24 | if not dictionary.has_key('hidden'): |
| 25 | # Just Began Viewing |
| 26 | if isdir(dictionary['directory']): |
| 27 | # Check For Pickle |
| 28 | image_pickle = join(dictionary['directory'], 'image.pickle') |
| 29 | if exists(image_pickle): |
| 30 | # Load Directory Listing |
| 31 | dir_data = load(file(image_pickle)) |
| 32 | else: |
| 33 | # Create Directory Listing |
| 34 | dir_data = update_image_pickle(dictionary['directory']) |
| 35 | # START HERE |
| 36 | image = WHAT_TO_DECIDE_HERE |
| 37 | else: |
| 38 | # Post Error Message |
| 39 | dictionary['directory'] = 'No Such Directory' |
| 40 | else: |
| 41 | # Find Next Image |
| 42 | show_form(title, image, action, back, forward, hidden) |
| 43 | |
| 44 | def show_form(*form_settings): |
| 45 | print_html('''<html> |