资源简介
/Method-Draw-master/method-draw/index.html启用查看;
代码片段和文件信息
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ship.py
#
# Licensed under the Apache 2 License as is the rest of the project
# Copyright (c) 2011 Jeff Schiller
#
# This script has very little real-world application. It is only used in our pure-client web app
# served on GoogleCode so we can have one HTML file run a build script and generate a ‘release‘
# version without having to maintain two separate HTML files. It does this by evaluating
# ‘processing comments‘ that are suspicously similar to IE conditional comments and then outputting
# a new HTML file after evaluating particular variables.
#
# This script takes the following inputs:
#
# * a HTML file (--i=in.html)
# * a series of flag names (--on=Foo --on=Bar)
#
# Example:
#
# in.html:
#
# BAR!
#
#
# $ ship.py --i in.html --on foo
#
# out.html:
#
# FOO!
#
#
# It has the following limitations:
#
# 1) Only if-else-endif are currently supported.
# 2) All processing comments must be on one line with no other non-whitespace characters.
# 3) Comments cannot be nested.
import optparse
import os
inside_if = False
last_if_true = False
_options_parser = optparse.OptionParser(
usage=‘%prog --i input.html [--on flag1]‘
description=(‘Rewrites an HTML file based on conditional comments and flags‘))
_options_parser.add_option(‘--i‘
action=‘store‘ dest=‘input_html_file‘ help=‘Input HTML filename‘)
_options_parser.add_option(‘--on‘
action=‘append‘ type=‘string‘ dest=‘enabled_flags‘
help=‘name of flag to enable‘)
def parse_args(args=None):
options rargs = _options_parser.parse_args(args)
return options (None None)
def parseComment(line line_num enabled_flags):
global inside_if
global last_if_true
start = line.find(‘{‘)
end = line.find(‘}‘)
statement = line[start+1:end].strip()
if statement.startswith(‘if ‘):
if inside_if == True:
print ‘Fatal Error: Nested {if} found on line ‘ + str(line_num)
print line
quit()
# Evaluate whether the expression is true/false.
# only one variable name allowed for now
variable_name = statement[3:].strip()
if variable_name in enabled_flags:
last_if_true = True
line = ‘‘
else:
last_if_true = False
line = ‘‘
# invert the logic so the endif clause is closed properly
last_if_true = not last_if_true
# ensure we don‘t have two else statements in the same i
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-12-24 10:11 svg编辑器源码\
目录 0 2018-12-24 10:11 svg编辑器源码\Method-Draw-master\
文件 184 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\.gitignore
目录 0 2018-12-24 10:11 svg编辑器源码\Method-Draw-master\.idea\
目录 0 2018-11-26 14:04 svg编辑器源码\Method-Draw-master\.idea\inspectionProfiles\
文件 469 2018-11-26 13:57 svg编辑器源码\Method-Draw-master\.idea\Method-Draw-master.iml
文件 179 2018-11-26 13:57 svg编辑器源码\Method-Draw-master\.idea\misc.xm
文件 295 2018-11-26 13:57 svg编辑器源码\Method-Draw-master\.idea\modules.xm
文件 22516 2018-12-18 17:27 svg编辑器源码\Method-Draw-master\.idea\workspace.xm
目录 0 2018-12-24 10:11 svg编辑器源码\Method-Draw-master\build\
目录 0 2018-12-24 10:11 svg编辑器源码\Method-Draw-master\build\tools\
文件 3939454 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\build\tools\closure-compiler.jar
文件 11358 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\build\tools\COPYING
文件 7143 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\build\tools\README
文件 4264 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\build\tools\ship.py
文件 891148 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\build\tools\yuicompressor-2.4.7.jar
目录 0 2018-12-24 10:11 svg编辑器源码\Method-Draw-master\docs\
目录 0 2018-12-24 10:11 svg编辑器源码\Method-Draw-master\docs\files\
文件 284514 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\docs\files\svgcanvas-js.html
目录 0 2018-12-24 10:11 svg编辑器源码\Method-Draw-master\docs\index\
文件 94 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\docs\index.html
文件 8185 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\docs\index\Files.html
文件 30774 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\docs\index\Functions.html
文件 32026 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\docs\index\General.html
目录 0 2018-12-24 10:11 svg编辑器源码\Method-Draw-master\docs\ja
文件 25346 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\docs\ja
文件 2170 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\docs\ja
目录 0 2018-12-24 10:11 svg编辑器源码\Method-Draw-master\docs\search\
文件 4328 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\docs\search\FilesS.html
文件 3648 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\docs\search\FunctionsA.html
文件 4296 2018-02-27 08:41 svg编辑器源码\Method-Draw-master\docs\search\FunctionsC.html
............此处省略1289个文件信息
- 上一篇:一个简单的HTML5网页设计
- 下一篇:班级介绍网站
评论
共有 条评论