mirror of
https://github.com/tildeclub/ttbp.git
synced 2026-06-20 11:39:23 +00:00
mail and code cleanup
_ttbp.py is now the working copy i'm using, so i don't bust the live program. i brought over the id code generator that i use in txtminebot to generate random id tags for feedback subject lines. the feedback mechanism now uses sendmail instead of writing to disk. i also started to clean up some of the larger text blocks by using here documents.
This commit is contained in:
12
bin/util.py
12
bin/util.py
@@ -2,6 +2,7 @@
|
||||
|
||||
import inflect
|
||||
import time
|
||||
import random
|
||||
|
||||
p = inflect.engine()
|
||||
|
||||
@@ -27,3 +28,14 @@ def pretty_time(time):
|
||||
return p.no("minute", m)
|
||||
else:
|
||||
return p.no("second", s)
|
||||
|
||||
def genID(digits=5):
|
||||
# makes a string of digits
|
||||
|
||||
id = ""
|
||||
x = 0
|
||||
while x < digits:
|
||||
id += str(random.randint(0,9))
|
||||
x += 1
|
||||
|
||||
return id
|
||||
|
||||
Reference in New Issue
Block a user