urn style random

master
ultrageranium 7 years ago
parent 4ec036da38
commit 5f15865e54

@ -7,13 +7,19 @@ with open('terms.json', 'r') as f:
def make_pub(): def make_pub():
actor = random.choice(terms['actor']) actor = random.choice(terms['actor'])
terms['actor'].remove(actor)
action = random.choice(terms['action']) action = random.choice(terms['action'])
terms['action'].remove(action)
prefix = '' prefix = ''
sort = random.choice(terms['sort']) sort = random.choice(terms['sort'])
terms['sort'].remove(sort)
media = random.choice(terms['media']) media = random.choice(terms['media'])
terms['media'].remove(media)
if random.randint(0,2) == 0: if random.randint(0,2) == 0:
prefix = random.choice(terms['prefix']) + '-' prefix = random.choice(terms['prefix'])
terms['prefix'].remove(prefix)
prefix += '-'
return actor + ' ' + action + ' ' + prefix + sort + ' ' + media return actor + ' ' + action + ' ' + prefix + sort + ' ' + media

Loading…
Cancel
Save