Exemple #1
0
 def GET(self):
     te = getTemplate("pixiv/pixivgen.html")
     if te is None:
         web.HTTPError('500 Internal Server Error')
         return 'Error'
     lan = getlang()
     i18n = getdict('pixiv/pixivgen', lan)
     i18n2 = {}
     mapToDict(i18n, i18n2, ['ND'])
     trans = getTranslator(manage=i18n)
     web.header('Content-Language', lan)
     if web.input().get('hl') is None:
         web.header('Vary', 'Accept-Language')
     s = settings()
     s.ReadSettings()
     if s.webpageCacheTime is not None:
         setCacheControl(s.webpageCacheTime)
     return te(lan, trans, i18n, embScr, genLangLink, dictToJSON(i18n2))
Exemple #2
0
 def GET(self):
     te = getTemplate("tools/mdToHtml.html")
     if te is None:
         web.HTTPError('500 Internal Server Error')
         return 'Error'
     lan = getlang()
     i18n = getdict('tools/mdToHtml', lan)
     trans = getTranslator(mdToHtml=i18n)
     i18n2 = {}
     mapToDict(i18n, i18n2, ['SOPTIONS', 'HOPTIONS', 'SEXT', 'HEXT', 'UF', 'UT'])  # noqa: E501
     i18n2 = dictToJSON(i18n2)
     web.header('Content-Language', lan)
     if web.input().get('hl') is None:
         web.header('Vary', 'Accept-Language')
     s = settings()
     s.ReadSettings()
     if s.webpageCacheTime is not None:
         setCacheControl(s.webpageCacheTime)
     return te(lan, i18n, trans, embScr, genLangLink, i18n2)
Exemple #3
0
 def GET(self):
     te = getT("sendMsgToMe.html")
     se = settings()
     se.ReadSettings()
     sitekey = se.captcha2sitekey
     if te is None or sitekey is None:
         web.HTTPError('500 Internal Server Error')
         return 'Error'
     lan = getlang()
     i18n = getdict('basic', lan)
     i18n2 = getdict('sendMsgToMe', lan)
     i18n3 = {}
     mapToDict(i18n2, i18n3, ['OK', 'FAILED', 'NEEDCON', 'NEEDN'])
     mapToDict(i18n, i18n3, ['NETERR', 'RECAP2'])
     i18n3 = dictToJSON(i18n3)
     trans = getTranslator(basic=i18n, sendMsgToMe=i18n2)
     web.header('Content-Language', lan)
     if web.input().get('hl') is None:
         web.header('Vary', 'Accept-Language')
     if se.webpageCacheTime is not None:
         setCacheControl(se.webpageCacheTime)
     return te(sitekey, lan, i18n, i18n2, i18n3, embScr, trans)
Exemple #4
0
 def GET(self):
     te = getTemplate("proxy/manage.html")
     if te is None:
         web.HTTPError('500 Internal Server Error')
         return 'Error'
     lan = getlang()
     i18n = getdict('proxy/manage', lan)
     trans = getTranslator(manage=i18n)
     i18n2 = {}
     mapToDict(i18n, i18n2, [
         'SEVERR', 'UNAUTH', 'REQ', 'OR', 'PN', 'SUCDEL', 'FADEL', 'COADD',
         'SUCADD', 'UNDOW', 'CODEL', 'CODEA', 'SC', 'HC'
     ])  # noqa: E501
     i18n2 = dictToJSON(i18n2)
     web.header('Content-Language', lan)
     if web.input().get('hl') is None:
         web.header('Vary', 'Accept-Language')
     s = settings()
     s.ReadSettings()
     if s.webpageCacheTime is not None:
         setCacheControl(s.webpageCacheTime)
     return te(lan, trans, i18n, embScr, genLangLink, i18n2)
Exemple #5
0
 def GET(self):
     te = getTemplate("salt.html")
     if te is None:
         web.HTTPError('500 Internal Server Error')
         return 'Error'
     lan = getlang()
     i18n = getdict('salt', lan)
     trans = getTranslator(salt=i18n)
     i18n2 = {}
     mapToDict(i18n, i18n2,
               ["UKNHASH", "NOSKEY", "SHOWX", "HIDEX", "SEK", "PAS"])
     i18n2 = dictToJSON(i18n2)
     s = settings()
     s.ReadSettings()
     web.header('Content-Language', lan)
     vary = 'User-Agent'
     if web.input().get('hl') is None:
         vary += ',Accept-Language'
     web.header('Vary', vary)
     if s.webpageCacheTime is not None:
         setCacheControl(s.webpageCacheTime)
     return te(lan, trans, i18n, embScr, addWikiLinkToText, i18n2, isIE,
               genLangLink)