Read in the mascot.license file.
1
2
16
17import msparser
18import sys
19
20if len(sys.argv) < 2 :
21 print("Location of 'mascot.license' file has to be specified as a parameter")
22 sys.exit(1)
23
24file = msparser.ms_license(sys.argv[1])
25
26if not file.isValid() :
27 print("There are errors. Cannot continue. The last error description:")
28 print(file.getLastErrorString())
29 sys.exit(1)
30
31if file.isLicenseValid() :
32 print("Mascot license is still valid. Other information:")
33 print(file.getLicenseString())
34else :
35 print("Mascot license has either expired or been corrupted")
36
37
38"""
39
40Running the program as
41
42python config_license.pl mascot.license
43
44will give, without a Mascot license file:
45
46
47There are errors. Cannot continue. The last error description:
48Missing license file: mascot.license.
49
50"""
51