flux.cli.fortune module
- class flux.cli.fortune.FortuneCmd(prog, usage=None, description=None, exclude_io=False)
Bases:
MiniCmdSurprise the user with some beautiful, hidden Flux fortunes and art!
Usage: flux fortune
flux fortune -c all # this is the default flux fortune -c valentines # show valentine fortune flux fortune -c art # show art flux fortune -c facts # show learning facts / tidbits flux fortune -c fun # show fun fortune
- check_valentines()
Check if we are within a few weeks of Valentine's Day
- static create_parser(prog, usage=None, description=None, exclude_io=False, add_help=True)
Create a largely empty parser for flux fortune (no arguments or exposed)
- generate_fortune(args)
Generate the fortune, meaning:
Choose to print a fortune (a) or the (rare) ascii art.
If a, choose a color and print.
If b, print the ascii and exit.
- main(args)
- random_fortune()
A random fortune can be art, fun, valenties, or factoid.
- show_art()
Show ascii art.
- show_fortune(listing)
Randomly select a fortune from a list and colorize.