source: trunk/essentials/dev-lang/python/Demo/tkinter/guido/mbox.py@ 3437

Last change on this file since 3437 was 3225, checked in by bird, 19 years ago

Python 2.5

File size: 7.3 KB
Line 
1#! /usr/bin/env python
2
3# Scan MH folder, display results in window
4
5import os
6import sys
7import re
8import getopt
9import string
10import mhlib
11
12from Tkinter import *
13
14from dialog import dialog
15
16mailbox = os.environ['HOME'] + '/Mail'
17
18def main():
19 global root, tk, top, mid, bot
20 global folderbox, foldermenu, scanbox, scanmenu, viewer
21 global folder, seq
22 global mh, mhf
23
24 # Parse command line options
25
26 folder = 'inbox'
27 seq = 'all'
28 try:
29 opts, args = getopt.getopt(sys.argv[1:], '')
30 except getopt.error, msg:
31 print msg
32 sys.exit(2)
33 for arg in args:
34 if arg[:1] == '+':
35 folder = arg[1:]
36 else:
37 seq = arg
38
39 # Initialize MH
40
41 mh = mhlib.MH()
42 mhf = mh.openfolder(folder)
43
44 # Build widget hierarchy
45
46 root = Tk()
47 tk = root.tk
48