Skip to content

Instantly share code, notes, and snippets.

@npjohnson
Created January 24, 2021 21:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save npjohnson/65f0c6dff7023dc4b89ae666503923f8 to your computer and use it in GitHub Desktop.
Save npjohnson/65f0c6dff7023dc4b89ae666503923f8 to your computer and use it in GitHub Desktop.
LineageOS Build Server Day Calulator
#!/usr/bin/env python2
## Build servers use python2, and python3 actually changes the results
### LineageOS Build Day Calculator
## Imports
import calendar
import random
## Variables
# We use 7 for W, 28 for M, but we currently use W
buckets=7
# Build taret name, not variant (eg. klteactivexx not klteattactive)
codename=raw_input("Device codename?\n")
print("\n")
## Get the numeric day of the week
day_number=random.Random(codename).randint(1, buckets)
## Convert the day of week to expected format, we use 1,7, and `calendar` assumes Monday = 0, so account for that
day=calendar.day_name[day_number-1]
## Print the day of the week
print(day)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment