-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyfucks.py
63 lines (60 loc) · 2.44 KB
/
pyfucks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import click
from typing import Tuple
from fucks.fucks import Fucks
from sys import stdout
singles = ["asshole", "awesome", "bag", "because", "bucket", "bye", "cool",
"cup", "diabetes", "everyone", "everything", "family",
"fascinating", "flying", "fyyff", "give", "horse", "immensity",
"life", "looking", "maybe", "me", "mornin", "no", "pink",
"programmer", "question", "retard", "ridiculous", "rtfm", "sake",
"shit", "single", "thanks", "that", "this", "too", "tucker",
"what", "zayn", "zero"]
doubles = ["anyway", "bday", "blackadder", "bm", "bus", "caniuse", "chainsaw",
"cocksplat", "dalton", "deraadt", "donut", "equity", "gfy",
"greed", "king", "keepcalm", "linus", "keep", "look", "madison",
"nugget", "off", "offwith", "outside", "particular", "problem",
"pulp", "shakespeare", "shutup", "think", "thinking", "thumbs",
"xmas", "yoda", "you"]
triples = ["ballmer", "dosomething", "field"]
all_fucks = sorted(singles + doubles + triples)
a = str(', '.join(all_fucks))
@click.command()
@click.argument("fuck", nargs=-1, required=True)
def opts(fuck: Tuple) -> None:
if (len(fuck) == 1):
stdout.write ("\nReceived no further arguments! List of operations:")
stdout.write ("\n\n" + a + '\n')
exit(0)
else:
try:
f = getattr(Fucks, fuck[1])
except AttributeError:
stdout.write ("\nUnexpected fuckery! List of operations:")
stdout.write ("\n\n" + a + '\n')
exit(0)
num_args = str(len(fuck)-2)
if (fuck[1] in singles):
if (len(fuck) != 3):
stdout.write ("\nExpected 1 argument! Received "
+ num_args + " argument(s).\n")
exit(0)
else:
f(fuck[2])
elif (fuck[1] in doubles):
if (len(fuck) != 4):
stdout.write ("\nExpected 2 arguments! Received "
+ num_args + " argument(s).\n")
exit(0)
else:
f(fuck[2], fuck[3])
elif (fuck[1] in triples):
if (len(fuck) != 5):
stdout.write ("\nExpected 3 arguments! Received "
+ num_args + " argument(s).\n")
exit(0)
else:
f(fuck[2], fuck[3], fuck[4])
else:
f()
if __name__ == '__main__':
opts()