资源简介
NULL
博文链接:https://ssh-2009-126-com.iteye.com/blog/715747
代码片段和文件信息
#!/usr/bin/python
# This code is original from jsmin by Douglas Crockford it was translated to
# Python by Baruch Even. The original code had the following copyright and
# license.
#
# /* jsmin.c
# 2007-05-22
#
# Copyright (c) 2002 Douglas Crockford (www.crockford.com)
#
# Permission is hereby granted free of charge to any person obtaining a copy of
# this software and associated documentation files (the “Software“) to deal in
# the Software without restriction including without limitation the rights to
# use copy modify merge publish distribute sublicense and/or sell copies
# of the Software and to permit persons to whom the Software is furnished to do
# so subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# The Software shall be used for Good not Evil.
#
# THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
# IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# */
from StringIO import StringIO
def jsmin(js):
ins = StringIO(js)
outs = StringIO()
javascriptMinify().minify(ins outs)
str = outs.getvalue()
if len(str) > 0 and str[0] == ‘\n‘:
str = str[1:]
return str
def isAlphanum(c):
“““return true if the character is a letter digit underscore
dollar sign or non-ASCII character.
“““
return ((c >= ‘a‘ and c <= ‘z‘) or (c >= ‘0‘ and c <= ‘9‘) or
(c >= ‘A‘ and c <= ‘Z‘) or c == ‘_‘ or c == ‘$‘ or c == ‘\\‘ or (c is not None and ord(c) > 126));
class UnterminatedComment(Exception):
pass
class UnterminatedStringLiteral(Exception):
pass
class UnterminatedRegularexpression(Exception):
pass
class javascriptMinify(object):
def _outA(self):
self.outstream.write(self.theA)
def _outB(self):
self.outstream.write(self.theB)
def _get(self):
“““return the next character from stdin. Watch out for lookahead. If
the character is a control character translate it to a space or
linefeed.
“““
c = self.theLookahead
self.theLookahead = None
if c == None:
c = self.instream.read(1)
if c >= ‘ ‘ or c == ‘\n‘:
return c
if c == ‘‘: # EOF
return ‘\000‘
if c == ‘\r‘:
return ‘\n‘
return ‘ ‘
def _peek(self):
self.theLookahead = self._get()
return self.theLookahead
def _next(self):
“““get the next charact
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2010-07-16 18:05 firebug
文件 10248 2010-06-25 09:42 firebug\ChangeLog
目录 0 2010-07-16 18:05 firebug\CVS
文件 862 2010-06-25 09:42 firebug\CVS\Entries
文件 19 2010-06-24 11:06 firebug\CVS\Repository
文件 43 2010-06-24 11:06 firebug\CVS\Root
文件 136 2010-06-25 09:42 firebug\deploy
文件 457 2010-06-25 09:42 firebug\errorIcon.png
文件 78968 2010-06-25 09:42 firebug\firebug-lite-compressed.js
文件 16333 2010-06-25 09:42 firebug\firebug-lite.css
文件 107183 2010-06-25 09:42 firebug\firebug-lite.js
文件 1043 2010-06-25 09:42 firebug\firebug.gif
文件 499 2010-06-25 09:42 firebug\firebug_logo.png
文件 524 2010-06-25 09:42 firebug\infoIcon.png
文件 7842 2010-06-25 09:42 firebug\jsmin.py
文件 286 2010-06-25 09:42 firebug\minifier.py
文件 63 2010-06-25 09:42 firebug\minify
文件 63 2010-06-25 09:42 firebug\minify.bat
文件 5203 2010-06-25 09:42 firebug\progress.gif
文件 64 2010-06-25 09:42 firebug\spacer.gif
文件 300 2010-06-25 09:42 firebug\tree_close.gif
文件 202 2010-06-25 09:42 firebug\tree_open.gif
文件 516 2010-06-25 09:42 firebug\warningIcon.png
----------- --------- ---------- ----- ----
230854 23
相关资源
-
[原创]Hba
seClient - treePanel与gridPanel技术实现页面的增删
- myeclipse免安装方法
- 发个普通类转成json的工具类,功能比
- Ubuntu16.04源码安装Mininet
- 大数据视频及源码资料
- 喜马拉雅win10文件改名工具
- SpringMVC+MyBatis企业应用实战+源码
- DDOS压力测试工具
- Exaware OnTop And PushPin 窗口置顶好工具
- VS2010 完整彻底卸载工具
- 串口调试助手易语言源码
- md5生成及校验工具
- QJson库包括源码文件和dll以及libqjson
- putty中文版69950
- MCPF跟踪算法源码
- TCP/IP调试助手
- 语音识别系统源码和开发文档
- 虚拟机模拟防火墙专用工具--piped
- 四川大学软件开发环境与工具—复习
- Xilinx Zynq-7000嵌入式系统设计及实现
- 700个H5网站模板源码
- BIOS备份工具
- 仿QQ消息列表(ListView)滑动删除效果
- libsvm-mat-2.89-3[FarutoUltimate3.0].rar
- CAD工具箱5.2.VLX
- 池塘夜降彩色雨源码
- 百度文库工具.rar
- 微信小程序源码-小商城高级版
- 微信小程序源码-机器人智能回复
评论
共有 条评论