drop six and python2 support
This commit is contained in:
parent
955b4a4e9b
commit
adad3be419
31 changed files with 54 additions and 426 deletions
7
ox/js.py
7
ox/js.py
|
|
@ -2,19 +2,12 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# vi:si:et:sw=4:sts=4:ts=4
|
||||
|
||||
from six import PY2
|
||||
from .utils import json
|
||||
|
||||
def minify(source, comment=''):
|
||||
# see https://github.com/douglascrockford/JSMin/blob/master/README
|
||||
def get_next_non_whitespace_token():
|
||||
pass
|
||||
# python2 performance with unicode string is terrible
|
||||
if PY2:
|
||||
if isinstance(source, unicode): # pylint: disable=undefined-variable
|
||||
source = source.encode('utf-8')
|
||||
if isinstance(comment, unicode): # pylint: disable=undefined-variable
|
||||
comment = comment.encode('utf-8')
|
||||
tokens = tokenize(source)
|
||||
length = len(tokens)
|
||||
minified = '/*' + comment + '*/' if comment else ''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue