-
Notifications
You must be signed in to change notification settings - Fork 0
/
BMovie.py
126 lines (93 loc) · 3.63 KB
/
BMovie.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/usr/bin/env python
from __future__ import print_function
import argparse
import string
from BMovieConstants import *
from WeightedTuple import WeightedTuple
from BMovieTitles import getTitle, titleTypes
#//**********************************************************************
#//
#// constants
#//
#//**********************************************************************
PROGRAM_NAME = "BMovie"
VERSION = "0.5.0"
PROGRAM_DESCRIPTION = "B-Movie title generator"
COPYRIGHT_MESSAGE = "copyright (c) 2013, Rick Gutleber"
DESCRIPTION = PROGRAM_NAME + " " + VERSION + ", " + PROGRAM_DESCRIPTION + ", " + COPYRIGHT_MESSAGE
#//**********************************************************************
#//
#// main
#//
#//**********************************************************************
def main( ):
parser = argparse.ArgumentParser( prog=PROGRAM_NAME, description=DESCRIPTION )
parser.add_argument( '-n', '--count', type=int, action='store', default=1 )
parser.add_argument( '-s', '--stats', action='store_true' )
args = parser.parse_args( )
count = args.count
for i in range( 0, count ):
print( getTitle( ) )
# print( getWord( nameVillainSingularProper ) )
if args.stats:
print( titleTypes )
#//**********************************************************************
#//
#// __main__
#//
#//**********************************************************************
if __name__ == '__main__':
main( )
#//**********************************************************************
#//
#// index
#//
#//**********************************************************************
def index( req ):
pageTitle = DESCRIPTION
site = siteHeader( pageTitle )
site += siteBody( pageTitle )
site += siteFooter( )
return site
#//**********************************************************************
#//
#// siteHeader
#//
#//**********************************************************************
def siteHeader( title ):
str = "<html><head><title>"
str += title
str += "</title></head><body>\n"
return str
#//**********************************************************************
#//
#// siteBody
#//
#//**********************************************************************
def siteBody( title ):
result = "<h2>" + title + "</h2>"
result += "Inspired by Mike Nelson in the Rifftrax presentation of 'Prisoners of the Lost Universe'"
result += "<h2>" + getTitle( ) + "</h2>"
result += "<h2>" + getTitle( ) + "</h2>"
result += "<h2>" + getTitle( ) + "</h2>"
result += "<h2>" + getTitle( ) + "</h2>"
result += "<h2>" + getTitle( ) + "</h2>"
result += "<h2>" + getTitle( ) + "</h2>"
result += "<h2>" + getTitle( ) + "</h2>"
result += "<h2>" + getTitle( ) + "</h2>"
result += "<h2>" + getTitle( ) + "</h2>"
result += "<h2>" + getTitle( ) + "</h2>"
result += "Hit 'Refresh' for more names. Props to Richard Hatch!<br>"
result += "Thanks for many additional suggestions from Ian, Francine and Jeremy.<br>"
result += "If you see a real movie name, it's luck... nothing is hard-coded.<br><br>"
result += 'Your B-Movie needs a hero! Why not give him a <a href="http://conceptjunkie.gotdns.com/BigMcLargeHuge.py">name</a>?<br>'
result += 'Send suggestions, complaints or meandering stories about your goiter to <a href="mailto:[email protected]?subject=BigMcLargeHuge">[email protected]</a><br><br><br>'
return result
#//**********************************************************************
#//
#// siteFooter
#//
#//**********************************************************************
def siteFooter( ):
str = "\n</body></html>"
return str