4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the Revised BSD License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 Revised BSD License for more details.
12 Copyright 2011-2015 Game Maker 2k - https://github.com/GameMaker2k
13 Copyright 2011-2015 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
15 $FileInfo: httpd.py - Last Update: 1/30/2019 Ver. 0.4.7 RC 4 - Author: cooldude2k $
18 import tempfile
, uuid
, re
, os
, sys
, cherrypy
, pymotherless
, argparse
, time
, datetime
;
19 if(sys
.version
[0]=="2"):
21 from cStringIO
import StringIO
;
23 from StringIO
import StringIO
;
24 # From http://python-future.org/compatible_idioms.html
25 from urlparse
import urlparse
, urlunparse
, urlsplit
, urlunsplit
, urljoin
;
26 from urllib
import urlencode
;
27 from urllib2
import urlopen
, Request
, HTTPError
;
28 import urllib2
, urlparse
, cookielib
;
29 if(sys
.version
[0]>="3"):
30 from io
import StringIO
, BytesIO
;
31 # From http://python-future.org/compatible_idioms.html
32 from urllib
.parse
import urlparse
, urlunparse
, urlsplit
, urlunsplit
, urljoin
, urlencode
;
33 from urllib
.request
import urlopen
, Request
;
34 from urllib
.error
import HTTPError
;
35 import urllib
.request
as urllib2
;
36 import urllib
.parse
as urlparse
;
37 import http
.cookiejar
as cookielib
;
38 import logging
as log
;
40 __project__
= pymotherless
.__project
__;
41 __program_name__
= pymotherless
.__program
_name
__;
42 __project_url__
= pymotherless
.__project
_url
__;
43 __version_info__
= pymotherless
.__version
_info
__;
44 __version_date_info__
= pymotherless
.__version
_date
_info
__;
45 __version_date__
= pymotherless
.__version
_date
__;
46 __version_date_plusrc__
= pymotherless
.__version
_date
_plusrc
__
47 __version__
= pymotherless
.__version
__;
48 __version_date_plusrc__
= pymotherless
.__version
_date
_plusrc
__;
50 geturls_cj
= pymotherless
.geturls_cj
;
51 geturls_ua
= pymotherless
.geturls_ua
;
52 geturls_ua_firefox_windows7
= pymotherless
.geturls_ua_firefox_windows7
;
53 geturls_ua_seamonkey_windows7
= pymotherless
.geturls_ua_seamonkey_windows7
;
54 geturls_ua_chrome_windows7
= pymotherless
.geturls_ua_chrome_windows7
;
55 geturls_ua_chromium_windows7
= pymotherless
.geturls_ua_chromium_windows7
;
56 geturls_ua_palemoon_windows7
= pymotherless
.geturls_ua_palemoon_windows7
;
57 geturls_ua_opera_windows7
= pymotherless
.geturls_ua_opera_windows7
;
58 geturls_ua_vivaldi_windows7
= pymotherless
.geturls_ua_chromium_windows7
;
59 geturls_ua_internet_explorer_windows7
= pymotherless
.geturls_ua_internet_explorer_windows7
;
60 geturls_ua_microsoft_edge_windows7
= pymotherless
.geturls_ua_microsoft_edge_windows7
;
61 geturls_ua_pymotherless_python
= pymotherless
.geturls_ua_pymotherless_python
;
62 geturls_ua_pymotherless_python_alt
= pymotherless
.geturls_ua_pymotherless_python_alt
;
63 geturls_ua_googlebot_google
= pymotherless
.geturls_ua_googlebot_google
;
64 geturls_ua_googlebot_google_old
= pymotherless
.geturls_ua_googlebot_google_old
;
65 geturls_headers
= pymotherless
.geturls_headers
;
66 geturls_headers_firefox_windows7
= pymotherless
.geturls_headers_firefox_windows7
;
67 geturls_headers_seamonkey_windows7
= pymotherless
.geturls_headers_seamonkey_windows7
;
68 geturls_headers_chrome_windows7
= pymotherless
.geturls_headers_chrome_windows7
;
69 geturls_headers_chromium_windows7
= pymotherless
.geturls_headers_chromium_windows7
;
70 geturls_headers_palemoon_windows7
= pymotherless
.geturls_headers_palemoon_windows7
;
71 geturls_headers_opera_windows7
= pymotherless
.geturls_headers_opera_windows7
;
72 geturls_headers_vivaldi_windows7
= pymotherless
.geturls_headers_vivaldi_windows7
;
73 geturls_headers_internet_explorer_windows7
= pymotherless
.geturls_headers_internet_explorer_windows7
;
74 geturls_headers_microsoft_edge_windows7
= pymotherless
.geturls_headers_microsoft_edge_windows7
;
75 geturls_headers_pymotherless_python
= pymotherless
.geturls_headers_pymotherless_python
;
76 geturls_headers_pymotherless_python_alt
= pymotherless
.geturls_headers_pymotherless_python_alt
;
77 geturls_headers_googlebot_google
= pymotherless
.geturls_headers_googlebot_google
;
78 geturls_headers_googlebot_google_old
= pymotherless
.geturls_headers_googlebot_google_old
;
79 geturls_download_sleep
= pymotherless
.geturls_download_sleep
;
81 parser
= argparse
.ArgumentParser(description
="A web server that draws barcodes with PyUPC-EAN powered by CherryPy web server.");
82 parser
.add_argument("--port", "--port-number", default
=8080, help="port number to use for server.");
83 parser
.add_argument("--host", "--host-name", default
="127.0.0.1", help="host name to use for server.");
84 parser
.add_argument("--verbose", "--verbose-mode", help="show log on terminal screen.", action
="store_true");
85 parser
.add_argument("--gzip", "--gzip-mode", help="enable gzip http requests.", action
="store_true");
86 parser
.add_argument("--gzipfilter", "--gzipfilter-mode", help="enable gzipfilter mode.", action
="store_true");
87 parser
.add_argument("--accesslog", "--accesslog-file", help="location to store access log file.");
88 parser
.add_argument("--errorlog", "--errorlog-file", help="location to store error log file.");
89 parser
.add_argument("--timeout", "--response-timeout", default
=6000, help="the number of seconds to allow responses to run.");
90 parser
.add_argument("--environment", "--server-environment", default
="production", help="The server.environment entry controls how CherryPy should run.");
91 getargs
= parser
.parse_args();
92 if(getargs
.verbose
==True):
93 log
.basicConfig(format
="%(levelname)s: %(message)s", level
=log
.DEBUG
);
94 if(getargs
.port
is not None):
95 port
= int(getargs
.port
);
98 if(getargs
.host
is not None):
99 host
= str(getargs
.host
);
102 if(getargs
.timeout
is not None):
103 timeout
= int(getargs
.timeout
);
106 if(getargs
.accesslog
is not None):
107 accesslog
= str(getargs
.accesslog
);
109 accesslog
= "./access.log";
110 if(getargs
.errorlog
is not None):
111 errorlog
= str(getargs
.errorlog
);
113 errorlog
= "./errors.log";
114 if(getargs
.environment
is not None):
115 serv_environ
= str(getargs
.environment
);
117 serv_environ
= "production";
118 pro_app_name
= "Barcode Generator 2k";
119 pro_app_subname
= "(PyUPC-EAN)";
120 pro_app_version
= pymotherless
.__version
__;
125 while(radsta
<=radmax
):
127 radout
+= "<option value=\""+str(radsta
)+"\" selected=\"selected\">"+str(radsta
)+" °</option>\n";
129 radout
+= "<option value=\""+str(radsta
)+"\">"+str(radsta
)+" °</option>\n";
130 radsta
= radsta
+ radinc
;
131 ServerSignature
= "<address><a href=\"https://github.com/GameMaker2k/PyUPC-EAN\" title=\"PyUPC-EAN barcode generator\">PyUPC-EAN</a>/%s (<a href=\"http://www.cherrypy.org/\" title=\"CherryPy python web server\">CherryPy</a>/%s)</address>" % (pymotherless
.__version
__, cherrypy
.__version
__);
132 IndexHTMLCode
= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">\n<head>\n<title> "+pro_app_name
+" "+pro_app_subname
+" </title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<meta http-equiv=\"Content-Language\" content=\"en\" />\n<meta name=\"generator\" content=\"CherryPy\" />\n<meta name=\"author\" content=\"Game Maker 2k\" />\n<meta name=\"keywords\" content=\"barcode,upc,ean,stf,itf,itf14,upca,upce,ean2,ean5,ean8,ean13,code11,code39,code93,codabar,msi\" />\n<meta name=\"description\" content=\"Barcode Generator with PyUPC-EAN\" /><meta name=\"resource-type\" content=\"document\" />\n<meta name=\"distribution\" content=\"global\" />\n<link rel=\"Generator\" href=\"http://www.cherrypy.org/\" title=\"CherryPy\" />\n</head>\n<body>\n<form name=\"pymotherless\" id=\"pymotherless\" method=\"get\" action=\"/pymotherless/\" onsubmit=\"location.href='/generate/'+pymotherless.bctype.value+'/'+pymotherless.size.value+'/'+pymotherless.rotate.value+'/'+pymotherless.upc.value+'.'+pymotherless.imgtype.value; return false;\">\n<fieldset>\n<legend>Barcode Info: </legend>\n<label style=\"cursor: pointer;\" for=\"upc\">Enter UPC/EAN: </label><br />\n<input type=\"text\" id=\"upc\" name=\"upc\" /><br />\n<label style=\"cursor: pointer;\" for=\"imgtype\">Select a image type: </label><br />\n<select id=\"imgtype\" name=\"imgtype\">\n<option value=\"png\" selected=\"selected\">PNG Image</option>\n<option value=\"gif\">GIF Image</option>\n<option value=\"jpeg\">JPEG Image</option>\n<option value=\"bmp\">BMP Image</option>\n<option value=\"tiff\">TIFF Image</option>\n</select><br />\n<label style=\"cursor: pointer;\" for=\"size\">Select barcode size: </label><br />\n<select id=\"size\" name=\"size\">\n<option value=\"1\" selected=\"selected\">1x</option>\n<option value=\"2\">2x</option>\n<option value=\"3\">3x</option>\n<option value=\"4\">4x</option>\n<option value=\"5\">5x</option>\n<option value=\"6\">6x</option>\n<option value=\"7\">7x</option>\n<option value=\"8\">8x</option>\n<option value=\"9\">9x</option>\n<option value=\"10\">10x</option>\n</select><br />\n<label style=\"cursor: pointer;\" for=\"bctype\">Select barcode type: </label><br />\n<select id=\"bctype\" name=\"bctype\">\n<option value=\"upca\" selected=\"selected\">UPC-A</option>\n<option value=\"upce\">UPC-E</option>\n<option value=\"ean13\">EAN-13</option>\n<option value=\"ean8\">EAN-8</option>\n<option value=\"ean2\">EAN-2</option>\n<option value=\"ean5\">EAN-5</option>\n<option value=\"stf\">STF</option>\n<option value=\"itf\">ITF</option>\n<option value=\"itf14\">ITF-14</option>\n<option value=\"code11\">Code 11</option>\n<option value=\"code39\">Code 39</option>\n<option value=\"code93\">Code 93</option>\n<option value=\"codabar\">Codabar</option>\n<option value=\"msi\">MSI</option>\n</select><br />\n<label style=\"cursor: pointer;\" for=\"rotate\">Select degrees to rotate image by: </label><br />\n<select id=\"rotate\" name=\"rotate\">"+radout
+"</select><br />\n<input type=\"submit\" value=\"Generate\" />\n</fieldset>\n</form><br />\n"+ServerSignature
+"\n</body>\n</html>";
133 class GenerateIndexPage(object):
135 def default(self
, *args
, **kwargs
):
136 cherrypy
.response
.headers
['Content-Type'] = 'text/html; charset=UTF-8';
137 getpyurlpath
= urlparse
.urlparse(cherrypy
.url()).path
;
138 getpymotherless
= "http://motherless.com"+getpyurlpath
;
139 pymotherlessinfo
= pymotherless
.get_motherless_link_type_alt(getpymotherless
);
140 IndexHTMLCode
= getpyurlpath
+" - "+pymotherlessinfo
['motherlessinfo'];
141 if(pymotherlessinfo
['motherlessinfo']=="sample" or pymotherlessinfo
['motherlessinfo']=="sample-videos"):
143 getpyurlinfo
= pymotherless
.get_motherless_sample_links(geturls_headers
, geturls_cj
, numoflinks
=15, urltype
="video");
146 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
['videos']['recent'][counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
['videos']['recent'][counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
['videos']['recent'][counti
]['title']+"\" title=\""+getpyurlinfo
['videos']['recent'][counti
]['title']+"\" /></a>\n";
148 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
151 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
['videos']['favorited'][counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
['videos']['favorited'][counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
['videos']['favorited'][counti
]['title']+"\" title=\""+getpyurlinfo
['videos']['favorited'][counti
]['title']+"\" /></a>\n";
153 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
156 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
['videos']['viewed'][counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
['videos']['viewed'][counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
['videos']['viewed'][counti
]['title']+"\" title=\""+getpyurlinfo
['videos']['viewed'][counti
]['title']+"\" /></a>\n";
158 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
161 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
['videos']['commented'][counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
['videos']['commented'][counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
['videos']['commented'][counti
]['title']+"\" title=\""+getpyurlinfo
['videos']['commented'][counti
]['title']+"\" /></a>\n";
163 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
166 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
['videos']['popular'][counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
['videos']['popular'][counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
['videos']['popular'][counti
]['title']+"\" title=\""+getpyurlinfo
['videos']['popular'][counti
]['title']+"\" /></a>\n";
168 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
171 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
['videos']['live'][counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
['videos']['live'][counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
['videos']['live'][counti
]['title']+"\" title=\""+getpyurlinfo
['videos']['live'][counti
]['title']+"\" /></a>\n";
173 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
176 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
['videos']['random'][counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
['videos']['random'][counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
['videos']['random'][counti
]['title']+"\" title=\""+getpyurlinfo
['videos']['random'][counti
]['title']+"\" /></a>\n";
178 if(pymotherlessinfo
['motherlessinfo']=="sample-images"):
180 getpyurlinfo
= pymotherless
.get_motherless_sample_links(geturls_headers
, geturls_cj
, numoflinks
=15, urltype
="image");
183 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
['images']['recent'][counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
['images']['recent'][counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
['images']['recent'][counti
]['title']+"\" title=\""+getpyurlinfo
['images']['recent'][counti
]['title']+"\" /></a>\n";
185 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
188 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
['images']['favorited'][counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
['images']['favorited'][counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
['images']['favorited'][counti
]['title']+"\" title=\""+getpyurlinfo
['images']['favorited'][counti
]['title']+"\" /></a>\n";
190 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
193 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
['images']['viewed'][counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
['images']['viewed'][counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
['images']['viewed'][counti
]['title']+"\" title=\""+getpyurlinfo
['images']['viewed'][counti
]['title']+"\" /></a>\n";
195 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
198 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
['images']['commented'][counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
['images']['commented'][counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
['images']['commented'][counti
]['title']+"\" title=\""+getpyurlinfo
['images']['commented'][counti
]['title']+"\" /></a>\n";
200 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
203 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
['images']['popular'][counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
['images']['popular'][counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
['images']['popular'][counti
]['title']+"\" title=\""+getpyurlinfo
['images']['popular'][counti
]['title']+"\" /></a>\n";
205 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
208 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
['images']['live'][counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
['images']['live'][counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
['images']['live'][counti
]['title']+"\" title=\""+getpyurlinfo
['images']['live'][counti
]['title']+"\" /></a>\n";
210 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
213 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
['images']['random'][counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
['images']['random'][counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
['images']['random'][counti
]['title']+"\" title=\""+getpyurlinfo
['images']['random'][counti
]['title']+"\" /></a>\n";
215 if(pymotherlessinfo
['motherlessinfo']=="gallery"):
218 getpage
=int(cherrypy
.request
.params
.get('page', None));
223 getpyurlinfo
= pymotherless
.get_motherless_galleries_links(getpymotherless
, geturls_headers
, geturls_cj
, page
=getpage
);
225 maxi
= getpyurlinfo
['numoflinks'];
227 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
[counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
[counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
[counti
]['title']+"\" title=\""+getpyurlinfo
[counti
]['title']+"\" /></a>\n";
229 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
231 maxi
= getpyurlinfo
['pages'];
234 IndexHTMLCode
= IndexHTMLCode
+" <a href=\"?page="+str(counti
)+"\">"+str(counti
)+"</a>\n";
236 if(pymotherlessinfo
['motherlessinfo']=="group"):
239 getpage
=int(cherrypy
.request
.params
.get('page', None));
244 getpyurlinfo
= pymotherless
.get_motherless_groups(getpymotherless
, geturls_headers
, geturls_cj
, page
=getpage
);
246 maxi
= getpyurlinfo
['numoflinks'];
248 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
[counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
[counti
]['thumbnail']+"\" alt=\""+getpyurlinfo
[counti
]['title']+"\" title=\""+getpyurlinfo
[counti
]['title']+"\" /></a>\n";
250 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
252 maxi
= getpyurlinfo
['pages'];
255 IndexHTMLCode
= IndexHTMLCode
+" <a href=\"?page="+str(counti
)+"\">"+str(counti
)+"</a>\n";
257 if(pymotherlessinfo
['motherlessinfo']=="member"):
260 getpage
=int(cherrypy
.request
.params
.get('page', None));
265 getpyurlinfo
= pymotherless
.get_motherless_search_members(getpymotherless
, geturls_headers
, geturls_cj
, page
=getpage
);
267 maxi
= getpyurlinfo
['numoflinks'];
269 IndexHTMLCode
= IndexHTMLCode
+" <a href=\""+getpyurlinfo
[counti
]['url'].replace('http://motherless.com', '')+"\"><img src=\""+getpyurlinfo
[counti
]['avatarurl']+"\" alt=\""+getpyurlinfo
[counti
]['username']+"\" title=\""+getpyurlinfo
[counti
]['username']+"\" /></a>\n";
271 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
273 maxi
= getpyurlinfo
['pages'];
276 IndexHTMLCode
= IndexHTMLCode
+" <a href=\"?page="+str(counti
)+"\">"+str(counti
)+"</a>\n";
278 if(pymotherlessinfo
['motherlessinfo']=="link"):
280 getpyurlinfo
= pymotherless
.get_motherless_links(getpymotherless
, geturls_headers
, geturls_cj
);
281 if(getpyurlinfo
['type']=="images"):
282 IndexHTMLCode
= "<img src=\""+getpyurlinfo
['url']+"\" alt=\""+getpyurlinfo
['title']+"\" title=\""+getpyurlinfo
['title']+"\" style=\"width: "+str(getpyurlinfo
['width'])+"px; height: "+str(getpyurlinfo
['height'])+"px;\" />";
283 if(getpyurlinfo
['type']=="videos"):
284 IndexHTMLCode
= "<video width=\"632\" height=\"432\" controls><source src=\""+getpyurlinfo
['url']+"\" type=\"video/mp4\">Your browser does not support the video tag.</video>";
285 IndexHTMLCode
= IndexHTMLCode
+"<div><br /> <br /></div>\n";
286 getpyurlcomet
= pymotherless
.get_motherless_links_comments(getpymotherless
, geturls_headers
, geturls_cj
);
288 maxi
= getpyurlcomet
['numofallposts'];
290 IndexHTMLCode
= IndexHTMLCode
+"<fieldset><legend>"+getpyurlcomet
[counti
]['username']+"</legend><img src=\""+getpyurlcomet
[counti
]['avatarurl']+"\" alt=\""+getpyurlcomet
[counti
]['username']+"\" title=\""+getpyurlcomet
[counti
]['username']+"\" /><br />"+getpyurlcomet
[counti
]['post']+"</fieldset>";
292 return IndexHTMLCode
;
293 default
.exposed
= True;
295 cherrypy
.config
.update({"environment": serv_environ
,
296 "log.error_file": errorlog
,
297 "log.access_file": accesslog
,
298 "log.screen": getargs
.verbose
,
299 "gzipfilter.on": getargs
.gzipfilter
,
300 "tools.gzip.on": getargs
.gzip
,
301 "tools.gzip.mime_types": ['text/*'],
302 "server.socket_host": host
,
303 "server.socket_port": port
,
304 "response.timeout": timeout
,
306 cherrypy
.quickstart(GenerateIndexPage());