Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def nailedit(rest):
"Nail that interview"
random.shuffle(phrases.interview_excuses)
yield "Sorry, but " + phrases.interview_excuses[0]
yield ("/me Nailed it!")
def passagg(recipient, sender):
"""
Generate a passive-aggressive statement to recipient from sender.
"""
adj = random.choice(pmxbot.phrases.adjs)
if random.choice([False, True]):
# address the recipient last
lead = ""
trail = recipient if not recipient else ", %s" % recipient
else:
# address the recipient first
lead = recipient if not recipient else "%s, " % recipient
trail = ""
body = random.choice(pmxbot.phrases.adj_intros) % adj
if not lead:
body = body.capitalize()
msg = "{lead}{body}{trail}.".format(**locals())
fw = random.choice(pmxbot.phrases.farewells)
return "{msg} {fw}, {sender}.".format(**locals())
def job():
"Generate a job title, http://www.cubefigures.com/job.html"
j1 = random.choice(phrases.jobs1)
j2 = random.choice(phrases.jobs2)
j3 = random.choice(phrases.jobs3)
return '%s %s %s' % (j1, j2, j3)
def golfclap(rest):
"Clap for something"
clapv = random.choice(phrases.clapvl)
adv = random.choice(phrases.advl)
adj = random.choice(phrases.adjl)
if rest:
clapee = rest.strip()
karma.Karma.store.change(clapee, 1)
return "/me claps %s for %s, %s %s." % (clapv, rest, adv, adj)
return "/me claps %s, %s %s." % (clapv, adv, adj)
def job():
"Generate a job title, http://www.cubefigures.com/job.html"
j1 = random.choice(phrases.jobs1)
j2 = random.choice(phrases.jobs2)
j3 = random.choice(phrases.jobs3)
return '%s %s %s' % (j1, j2, j3)
def passagg(recipient, sender):
"""
Generate a passive-aggressive statement to recipient from sender.
"""
adj = random.choice(pmxbot.phrases.adjs)
if random.choice([False, True]):
# address the recipient last
lead = ""
trail = recipient if not recipient else ", %s" % recipient
else:
# address the recipient first
lead = recipient if not recipient else "%s, " % recipient
trail = ""
body = random.choice(pmxbot.phrases.adj_intros) % adj
if not lead:
body = body.capitalize()
msg = "{lead}{body}{trail}.".format(**locals())
fw = random.choice(pmxbot.phrases.farewells)
return "{msg} {fw}, {sender}.".format(**locals())
def featurecreep():
"Generate feature creep (P+C http://www.dack.com/web/bullshit.html)"
verb = random.choice(phrases.fcverbs).capitalize()
adjective = random.choice(phrases.fcadjectives)
noun = random.choice(phrases.fcnouns)
return '%s %s %s!' % (verb, adjective, noun)
def featurecreep():
"Generate feature creep (P+C http://www.dack.com/web/bullshit.html)"
verb = random.choice(phrases.fcverbs).capitalize()
adjective = random.choice(phrases.fcadjectives)
noun = random.choice(phrases.fcnouns)
return '%s %s %s!' % (verb, adjective, noun)
def job():
"Generate a job title, http://www.cubefigures.com/job.html"
j1 = random.choice(phrases.jobs1)
j2 = random.choice(phrases.jobs2)
j3 = random.choice(phrases.jobs3)
return '%s %s %s' % (j1, j2, j3)
def featurecreep():
"Generate feature creep (P+C http://www.dack.com/web/bullshit.html)"
verb = random.choice(phrases.fcverbs).capitalize()
adjective = random.choice(phrases.fcadjectives)
noun = random.choice(phrases.fcnouns)
return '%s %s %s!' % (verb, adjective, noun)