const.py 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # coding: utf-8
  2. from __future__ import print_function
  3. from __future__ import absolute_import
  4. from __future__ import division
  5. from __future__ import unicode_literals
  6. from collections import namedtuple
  7. Status = namedtuple("Status", ("code", "tag", "sdesc", "ldesc"))
  8. Progress = namedtuple("Progress", ("code", "tag", "sdesc", "ldesc"))
  9. g = globals()
  10. # Status of a person in Debian
  11. ALL_STATUS = (
  12. Status("STATUS_DC", "dc", "DC", "Debian Contributor"),
  13. Status("STATUS_DC_GA", "dc_ga", "DC+account", "Debian Contributor, with guest account"),
  14. Status("STATUS_DM", "dm", "DM", "Debian Maintainer"),
  15. Status("STATUS_DM_GA", "dm_ga", "DM+account", "Debian Maintainer, with guest account"),
  16. Status("STATUS_DD_U", "dd_u", "DD, upl.", "Debian Developer, uploading"),
  17. Status("STATUS_DD_NU", "dd_nu", "DD, non-upl.", "Debian Developer, non-uploading"),
  18. Status("STATUS_EMERITUS_DD", "dd_e", "DD, emeritus", "Debian Developer, emeritus"),
  19. Status("STATUS_EMERITUS_DM", "dm_e", "DM, emeritus", "Debian Maintainer, emeritus"),
  20. Status("STATUS_REMOVED_DD", "dd_r", "DD, removed", "Debian Developer, removed"),
  21. Status("STATUS_REMOVED_DM", "dm_r", "DM, removed", "Debian Maintainer, removed"),
  22. Status("STATUS_REMOVED_DC_GA", "dc_ga_r", "DC+closed acct.", "Debian Contributor, with closed guest account"),
  23. )
  24. ALL_STATUS_DESCS = dict((x.tag, x.ldesc) for x in ALL_STATUS)
  25. ALL_STATUS_BYTAG = dict((x.tag, x) for x in ALL_STATUS)
  26. for s in ALL_STATUS:
  27. g[s.code] = s.tag
  28. SEQ_STATUS = dict(((y.tag, x) for x, y in enumerate(ALL_STATUS)))
  29. # Progress of a person in a process
  30. ALL_PROGRESS = (
  31. Progress("PROGRESS_APP_NEW", "app_new", "Applied", "Applicant asked to enter the process"),
  32. Progress("PROGRESS_APP_RCVD", "app_rcvd", "Validated", "Applicant replied to initial mail"),
  33. Progress("PROGRESS_APP_HOLD", "app_hold", "App hold", "On hold before entering the queue"),
  34. Progress("PROGRESS_ADV_RCVD", "adv_rcvd", "Adv ok", "Received enough advocacies"),
  35. Progress("PROGRESS_POLL_SENT", "poll_sent", "Poll sent", "Activity poll sent"),
  36. Progress("PROGRESS_APP_OK", "app_ok", "App ok", "Advocacies have been approved"),
  37. Progress("PROGRESS_AM_RCVD", "am_rcvd", "AM assigned", "Waiting for AM to confirm"),
  38. Progress("PROGRESS_AM", "am", "AM", "Interacting with an AM"),
  39. Progress("PROGRESS_AM_HOLD", "am_hold", "AM hold", "AM hold"),
  40. Progress("PROGRESS_AM_OK", "am_ok", "AM ok", "AM approved"),
  41. Progress("PROGRESS_FD_HOLD", "fd_hold", "FD hold", "FD hold"),
  42. Progress("PROGRESS_FD_OK", "fd_ok", "FD ok", "FD approved"),
  43. Progress("PROGRESS_DAM_HOLD", "dam_hold", "DAM hold", "DAM hold"),
  44. Progress("PROGRESS_DAM_OK", "dam_ok", "DAM ok", "DAM approved"),
  45. Progress("PROGRESS_DONE", "done", "Done", "Completed"),
  46. Progress("PROGRESS_CANCELLED", "cancelled", "Cancelled", "Cancelled"),
  47. )
  48. ALL_PROGRESS_DESCS = dict((x.tag, x.ldesc) for x in ALL_PROGRESS)
  49. ALL_PROGRESS_BYTAG = dict((x.tag, x) for x in ALL_PROGRESS)
  50. for p in ALL_PROGRESS:
  51. g[p.code] = p.tag
  52. SEQ_PROGRESS = dict(((y.tag, x) for x, y in enumerate(ALL_PROGRESS)))