From 5da5d510a07f649cd24cf6c08dc41071f1ab3fe4 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Tue, 27 Jan 2015 00:16:45 -0600 Subject: [PATCH] fixed some problems with new dal and SQLHTML --- applications/examples/views/default/download.html | 2 +- gluon/sqlhtml.py | 2 +- scripts/cleanhtml.py | 13 ++++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/applications/examples/views/default/download.html b/applications/examples/views/default/download.html index 90f023a2..e5da5a91 100644 --- a/applications/examples/views/default/download.html +++ b/applications/examples/views/default/download.html @@ -30,7 +30,7 @@ Manual Change Log - Report a Bug + Report a Bug diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index 36a146b4..c95a3275 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -27,7 +27,7 @@ from gluon.html import FORM, INPUT, LABEL, OPTION, SELECT, COL, COLGROUP from gluon.html import TABLE, THEAD, TBODY, TR, TD, TH, STYLE, SCRIPT from gluon.html import URL, FIELDSET, P, DEFAULT_PASSWORD_DISPLAY from pydal.base import DEFAULT -from pydal.objects import Table, Row, Expression +from pydal.objects import Table, Row, Expression, Field from pydal.adapters.base import CALLABLETYPES from pydal.helpers.methods import smart_query, bar_encode from pydal.helpers.classes import Reference, SQLCustomType diff --git a/scripts/cleanhtml.py b/scripts/cleanhtml.py index e0df55b2..e4f71df0 100755 --- a/scripts/cleanhtml.py +++ b/scripts/cleanhtml.py @@ -57,8 +57,11 @@ def read_file(filename): finally: f.close() -file = sys.argv[1] -if file[-4:] == '.css': - print cleancss(read_file(file)) -if file[-5:] == '.html': - print cleanhtml(read_file(file)) +for file in sys.argv[1:]: + data = read_file(file) + open(file+'.bak2', 'w').write(data) + if file[-4:] == '.css': + data = cleancss(data) + if file[-5:] == '.html': + data = cleanhtml(data) + open(file, 'w').write(data)