From c83eb3989afef7e89bf6e770695d2d2fab30ab2f Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Sun, 30 Jun 2019 12:21:52 +0300 Subject: [PATCH] v3.4.4.4 Del deprecated html module --- app/add.py | 18 +++++++++++------- app/config.py | 1 - app/create_db.py | 1 - app/delver.py | 2 +- app/ha.py | 2 +- app/ihap.py | 2 +- app/login.py | 1 - app/logs.py | 2 +- app/options.py | 7 +++---- app/servers.py | 2 +- app/settings.py | 1 - app/templates/base.html | 2 +- app/viewsttats.py | 2 +- 13 files changed, 21 insertions(+), 22 deletions(-) diff --git a/app/add.py b/app/add.py index 84f3c89e..1b2ea36c 100644 --- a/app/add.py +++ b/app/add.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -import html import cgi import os import funct @@ -55,7 +54,7 @@ if form.getvalue('mode') is not None: ssl = "" ssl_check = "" - if form.getvalue('balance') is not None: + if form.getvalue('balance') is not None: balance = " balance " + form.getvalue('balance') + "\n" if form.getvalue('ip') is not None: @@ -118,23 +117,28 @@ if form.getvalue('mode') is not None: if form.getvalue('cookie'): cookie = " cookie "+form.getvalue('cookie_name') - rewrite = "" - prefix = "" - nocache = "" - postonly = "" - dynamic = "" if form.getvalue('cookie_domain'): cookie += " domain "+form.getvalue('cookie_domain') if form.getvalue('rewrite'): rewrite = form.getvalue('rewrite') + else: + rewrite = "" if form.getvalue('prefix'): prefix = form.getvalue('prefix') + else: + prefix = "" if form.getvalue('nocache'): nocache = form.getvalue('nocache') + else: + nocache = "" if form.getvalue('postonly'): postonly = form.getvalue('postonly') + else: + postonly = "" if form.getvalue('dynamic'): dynamic = form.getvalue('dynamic') + else: + dynamic = "" cookie += " "+rewrite+" "+prefix+" "+nocache+" "+postonly+" "+dynamic+"\n" options_split += cookie if form.getvalue('dynamic'): diff --git a/app/config.py b/app/config.py index d4708d2e..8c2ae807 100644 --- a/app/config.py +++ b/app/config.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -import html import cgi import os import http.cookies diff --git a/app/create_db.py b/app/create_db.py index 9f89d4c7..70a55594 100644 --- a/app/create_db.py +++ b/app/create_db.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 import cgi -import html import os import sys import funct diff --git a/app/delver.py b/app/delver.py index 3541792c..3f0dfc9b 100644 --- a/app/delver.py +++ b/app/delver.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -import html, http.cookies +import http.cookies import cgi import os import funct, sql diff --git a/app/ha.py b/app/ha.py index 6d34ad3e..782e017b 100644 --- a/app/ha.py +++ b/app/ha.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -import html, http.cookies +import http.cookies import cgi import os import funct, sql diff --git a/app/ihap.py b/app/ihap.py index 1595bda3..57d4b7e8 100644 --- a/app/ihap.py +++ b/app/ihap.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -import html, http.cookies +import http.cookies import cgi import os import funct, sql diff --git a/app/login.py b/app/login.py index 750c8e40..adb7207a 100644 --- a/app/login.py +++ b/app/login.py @@ -2,7 +2,6 @@ # -*- coding: utf-8 -*- import cgi -import html import os import sys import funct diff --git a/app/logs.py b/app/logs.py index 8b0cad56..7dc60e90 100644 --- a/app/logs.py +++ b/app/logs.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -import html + import cgi import funct import sql diff --git a/app/options.py b/app/options.py index 2b103111..79932952 100644 --- a/app/options.py +++ b/app/options.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*-" -import html import cgi import os, sys import funct @@ -337,7 +336,7 @@ if serv is not None and act == "configShow": env = Environment(loader=FileSystemLoader('templates/ajax'),extensions=['jinja2.ext.loopcontrols']) template = env.get_template('config_show.html') - template = template.render(conf=conf, view=form.getvalue('view'), serv=serv, configver=form.getvalue('configver')) + template = template.render(conf=conf, view=form.getvalue('view'), serv=serv, configver=form.getvalue('configver'), role=funct.is_admin(level=2)) print(template) if form.getvalue('configver') is None: @@ -460,7 +459,7 @@ if form.getvalue('metrics'): x_max = df.index.max() + pd.Timedelta(minutes=1) p[serv] = figure( - tools="pan,box_zoom,reset,xwheel_zoom", + tools="pan,box_zoom,reset,xwheel_zoom", title=metric[0][0], x_axis_type="datetime", y_axis_label='Connections', x_range = (x_max.timestamp()*1000-60*100000, x_max.timestamp()*1000) @@ -645,4 +644,4 @@ if form.getvalue('get_ldap_email'): except: print('error: user not found') finally: - l.unbind() + l.unbind() \ No newline at end of file diff --git a/app/servers.py b/app/servers.py index bb993e92..98c1d85f 100644 --- a/app/servers.py +++ b/app/servers.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -import html, http +import http import cgi import sys import os diff --git a/app/settings.py b/app/settings.py index 2183d30c..eb99e61b 100644 --- a/app/settings.py +++ b/app/settings.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -import html import cgi import os import funct diff --git a/app/templates/base.html b/app/templates/base.html index c6c1ad60..a11c42db 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -115,7 +115,7 @@ diff --git a/app/viewsttats.py b/app/viewsttats.py index 6d4fe31c..7ac3b339 100644 --- a/app/viewsttats.py +++ b/app/viewsttats.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -import html, http.cookies, os +import http.cookies, os import cgi import funct import sql