Advertisement
MD500_Pilot

Untitled

Apr 12th, 2021
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.21 KB | None | 0 0
  1. def init_argparser():
  2.     parser = argparse.ArgumentParser(description=program_descripton, formatter_class=RawFormatter)
  3.     parser.add_argument('-v', '--version', action='version', version=f'{parser.prog} {VERSION}')
  4.     parser.add_argument('-dr', '--daily_report', action='store_true', help='Run the Daily Email Report and exit')
  5.     parser.add_argument('-ct', '--check_temps', action='store_true', help='Return a list of drives and their temperatures and exit')
  6.     parser.add_argument('-ud', '--update_daily', action='store_true', help=f'Updates 24 hour drive count. {red}USE WITH CAUTION, USE WITH CRONTAB{nc}')
  7.     parser.add_argument('-off', '--offline_hdd', action='store_true', help=f'Offline a specific drive. Use drive number: {green}drive6{nc}')
  8.     #parser.add_argument('-on', '--online_hdd', action='store_true', nargs=1, help=f'Online a specific drive. Use drive number: {green}drive6{nc}')
  9.     return parser
  10.  
  11.  
  12. def main():
  13.     parser = init_argparser()
  14.     args = parser.parse_args()
  15.     if args.daily_report:
  16.         send_daily_email()
  17.     elif args.plot_report:
  18.         space_report()
  19.     elif args.update_daily:
  20.         update_daily_counts()
  21.     elif args.check_temps:
  22.         temperature_report()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement