M-star.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import logging
  2. import sys
  3. from vendors.debian.DebianModel import DebianModel
  4. ##### GLOBAL VARIABLES #####
  5. logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
  6. # Increase the recursion limit by much to allow bs to parse large files ()
  7. sys.setrecursionlimit(6000)
  8. secondsperday = 86400
  9. verbosity = 1
  10. ###### FUNCTIONS ######
  11. def aptsec_help():
  12. """
  13. :return:
  14. """
  15. print('See manual for correct usage!')
  16. def __main__(configfile='config_default.txt', vendorname='debian', action='help'):
  17. # support only debian
  18. if vendorname is 'debian':
  19. model = DebianModel(action)
  20. model.performTests()
  21. #for norm_param in range(1, 15):
  22. # get model as set of opinions
  23. # TODO: FIX THE CVSREADER dependency
  24. # TODO: for random subsets of packages (that exist in our model), generate prediction_error_values and compute the average error value for each of the three approaches: (addition from model , addition of separate predictions for opinions from a model, ANDed prediction)
  25. """
  26. # TEST AN INPUT AGAINST OUR MODEL
  27. # read packages and create a set of opinions for those packages
  28. """
  29. else:
  30. print("Only debian vendors are supported for now.")
  31. sys.exit(1)
  32. __main__(action='status')