2022-03-02 05:32:31 +00:00
|
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
2022-03-05 04:35:57 +00:00
|
|
|
|
import datetime
|
|
|
|
|
|
|
|
|
|
|
2022-03-05 04:41:12 +00:00
|
|
|
|
class readHead():
|
2022-03-05 04:35:57 +00:00
|
|
|
|
outHead = ""
|
2022-03-05 07:04:26 +00:00
|
|
|
|
sTime = []
|
2022-03-05 04:35:57 +00:00
|
|
|
|
sTitle = ""
|
|
|
|
|
|
2022-03-09 01:48:18 +00:00
|
|
|
|
def __init__(self, sTitle):
|
2022-03-05 07:04:26 +00:00
|
|
|
|
self.sTitle = sTitle
|
2022-03-09 01:48:18 +00:00
|
|
|
|
# self.outHead = ""
|
2022-03-05 07:04:26 +00:00
|
|
|
|
self.stime = []
|
|
|
|
|
|
|
|
|
|
def __str__(self):
|
2022-03-09 01:48:18 +00:00
|
|
|
|
return(str(self.genHead())) #TODO: pick css theme and append to output
|
|
|
|
|
|
|
|
|
|
# Start genHead()
|
|
|
|
|
def genHead(self):
|
|
|
|
|
|
|
|
|
|
# Generate html <head> element
|
|
|
|
|
getTime = datetime.datetime.now()
|
|
|
|
|
timeMod = str(getTime.strftime("%A, %B %d, %Y at %X UTC−06:00")) #TODO: I don't want to hard-code this but the %z utc offset isn't printing
|
|
|
|
|
timeCreate = timeMod
|
|
|
|
|
|
|
|
|
|
headerStr = "<!DOCTYPE HTML>\n<html>\n<head>\n\t<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>\n\t<title>"
|
|
|
|
|
headerStr1 = "</title>\n\t<meta name=\"generator\" content=\"HTML.xonsh https://git.nixnet.services/amber/html.xonsh\"/>\n\t<meta name=\"created\" content=\""
|
|
|
|
|
headerStr2 = "\">\n\t<meta name=\"changed\" content=\""
|
|
|
|
|
headerStr3 = "\"/>\n</head>\n<body>\n\t"
|
2022-03-05 07:04:26 +00:00
|
|
|
|
|
2022-03-09 01:48:18 +00:00
|
|
|
|
outHead = headerStr + str(self.sTitle) + headerStr1 + timeMod + headerStr2 + timeCreate + headerStr3
|
|
|
|
|
return(outHead)
|