Skip to content

Instantly share code, notes, and snippets.

@npjohnson
Last active September 3, 2020 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save npjohnson/8ba4a7a1ea1938578f838ea330409d19 to your computer and use it in GitHub Desktop.
Save npjohnson/8ba4a7a1ea1938578f838ea330409d19 to your computer and use it in GitHub Desktop.
lineage-build-day
#!/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="figo"
## 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(day_number)
## 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