Remove unused minimisation code

This commit is contained in:
Dave Page 2017-07-06 13:04:13 +01:00
parent 592c70e655
commit 1291841d98
2 changed files with 0 additions and 68 deletions

View File

@ -64,9 +64,6 @@ clean-src:
docs:
LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 $(MAKE) -C docs/en_US -f Makefile.sphinx html
minimise:
python web/tools/minimise.py ./web
msg-compile:
cd web && pybabel compile -d pgadmin/translations

View File

@ -1,65 +0,0 @@
#!/usr/bin/env python
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2017, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
# config.py - Core application configuration settings
#
##########################################################################
"""Minimises CSS and JS files found under the given directory"""
import argparse
import os
from rcssmin import cssmin
from rjsmin import jsmin
parser = argparse.ArgumentParser()
parser.add_argument("directory",
help="the directory to minimise recursively")
args = parser.parse_args()
def minimise(dummy, dirname, filesindir):
"""
Minimises any .js or .css files found
Args:
dummy: unused
dirname: the directory in which to minimise files
filesindir: lists the files in the directory
"""
for fname in filesindir:
if fname[-4:] == '.css' and fname[-8:] != '.min.css':
oldfile = os.path.join(dirname, fname)
newfile = os.path.join(dirname, fname[:-4] + '.min.css')
print("CSS: Minimising: " + oldfile +
" -> " + newfile)
fp_old = open(oldfile, "rb")
fp_new = open(newfile, "wb")
fp_new.write(cssmin(fp_old.read(), keep_bang_comments=False))
fp_old.close()
fp_new.close()
elif fname[-3:] == '.js' and fname[-7:] != '.min.js':
oldfile = os.path.join(dirname, fname)
newfile = os.path.join(dirname, fname[:-3] + '.min.js')
print("JS : Minimising: " + oldfile +
" -> " + newfile)
fp_old = open(oldfile, "rb")
fp_new = open(newfile, "wb")
fp_new.write(jsmin(fp_old.read(), keep_bang_comments=False))
fp_old.close()
fp_new.close()
os.path.walk(args.directory, minimise, None)