Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-19 08:00:04

0001 import argparse
0002 import os
0003 import sys
0004 
0005 from pandaharvester.harvesterconfig import harvester_config
0006 from pandaharvester.harvestermisc.selfcheck import harvesterPackageInfo
0007 
0008 
0009 def main():
0010     oparser = argparse.ArgumentParser(prog="prescript", add_help=True)
0011     oparser.add_argument("-f", "--local_info_file", action="store", dest="local_info_file", help="path of harvester local info file")
0012 
0013     if len(sys.argv) == 1:
0014         print("No argument or flag specified. Did nothing")
0015         sys.exit(0)
0016     args = oparser.parse_args(sys.argv[1:])
0017 
0018     # check package info
0019     local_info_file = os.path.normpath(args.local_info_file)
0020     hpi = harvesterPackageInfo(local_info_file=local_info_file)
0021     if hpi.package_changed:
0022         print("Harvester package changed")
0023         # TODO
0024         pass
0025         hpi.renew_local_info()
0026     else:
0027         print("Harvester package unchanged. Skipped")
0028 
0029     # if enabled, clean up inactive fifo tables
0030     if hasattr(harvester_config.monitor, "fifoEnable") and harvester_config.monitor.fifoEnable:
0031         from pandaharvester.harvestercore.fifos import ManagementFIFO
0032 
0033         mfifo = ManagementFIFO()
0034         mfifo.cleanup_tables()
0035 
0036     # done
0037     pass
0038 
0039 
0040 if __name__ == "__main__":
0041     main()