mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Remove unused minimisation code
This commit is contained in:
parent
592c70e655
commit
1291841d98
3
Makefile
3
Makefile
@ -64,9 +64,6 @@ clean-src:
|
|||||||
docs:
|
docs:
|
||||||
LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 $(MAKE) -C docs/en_US -f Makefile.sphinx html
|
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:
|
msg-compile:
|
||||||
cd web && pybabel compile -d pgadmin/translations
|
cd web && pybabel compile -d pgadmin/translations
|
||||||
|
|
||||||
|
@ -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)
|
|
Loading…
Reference in New Issue
Block a user