1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 """
18 This module provides support for starting an interactive ParselTongue
19 session.
20
21 """
22
23
24 import ptversion
25
26
27 import AIPS
28
29
30 from FITS import FITS
31
32
33 from AIPSTask import *
34 from AIPSData import *
35 from AIPSTV import *
36 from ObitTask import *
37 from FITSData import *
38
39
40
41 try:
42 import atexit, readline, ptcompleter
43 if __name__ == "__main__" :
44 try:
45 path = os.environ['HOME'] + '/.ParselTongue/history'
46 readline.read_history_file(path)
47 except IOError:
48 pass
49 readline.parse_and_bind("tab: complete")
50 if not os.path.exists(os.path.dirname(path)):
51 os.makedirs(os.path.dirname(path))
52 pass
53 atexit.register(readline.write_history_file, path)
54 except:
55 pass
56
57
58
59 _help = help
61 if isinstance(obj, AIPSTask):
62 obj.help()
63 else:
64 _help(obj)
65 pass
66 return
67
71
72 if __name__ == "__main__" :
73
74 AIPSTask.isbatch = 0
75
76
77 print ""
78
79 print "Welcome to ParselTongue", ptversion.version
80 while True:
81 try:
82 input = raw_input("Please enter your AIPS user ID number: ")
83 AIPS.userno = int(input)
84 except KeyboardInterrupt:
85 print ""
86 print "AIPS user ID number is not set"
87 break
88 except:
89 print "That is not a valid AIPS user ID number"
90 continue
91 else:
92 break
93