Last active
September 3, 2020 01:21
-
-
Save npjohnson/8ba4a7a1ea1938578f838ea330409d19 to your computer and use it in GitHub Desktop.
lineage-build-day
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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