Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions | Variables
gen_manifest Namespace Reference

Functions

 matches (file)
 
 findFiles (rootDir)
 

Variables

 cacheDir = sys.argv[1]
 
 extensions = sys.argv[2].split(',')
 
 manifestName = sys.argv[3]
 
 htmlFiles = sys.argv[4:]
 
 patterns = extensions + htmlFiles
 
list manifest = []
 
 cachedHtmlFile = htmlFile.replace('.html', '-cache.html')
 
 text = open(htmlFile, 'r').read()
 

Detailed Description

Usage: gen_manifest.py DIRECTORY EXTENSIONS CACHE-FILE HTML-FILES...

Outputs an app cache manifest file including (recursively) all files with the
provided in the directory with the given extensions. Each html files is then
processed and a corresponding <name>-cache.html file is created, pointing at
the appropriate cache manifest file, which is saved as <name>-cache.manifest.

Example:
gen_manifest.py war *.css,*.html,*.js,*.png cache.manifest foo.html bar.html

Produces: foo-cache.html, bar-cache.html, and cache.manifest

Function Documentation

◆ findFiles()

gen_manifest.findFiles (   rootDir)

Definition at line 45 of file gen_manifest.py.

45def findFiles(rootDir):
46 for root, dirs, files in os.walk(rootDir):
47 for f in files:
48 # yields this file relative to the given directory
49 yield os.path.join(root, f)[(len(rootDir) + 1):]
50
51

◆ matches()

gen_manifest.matches (   file)

Definition at line 38 of file gen_manifest.py.

38def matches(file):
39 for pattern in patterns:
40 if fnmatch.fnmatch(file, pattern):
41 return True
42 return False
43
44

Variable Documentation

◆ cachedHtmlFile

gen_manifest.cachedHtmlFile = htmlFile.replace('.html', '-cache.html')

Definition at line 74 of file gen_manifest.py.

◆ cacheDir

gen_manifest.cacheDir = sys.argv[1]

Definition at line 27 of file gen_manifest.py.

◆ extensions

gen_manifest.extensions = sys.argv[2].split(',')

Definition at line 28 of file gen_manifest.py.

◆ htmlFiles

gen_manifest.htmlFiles = sys.argv[4:]

Definition at line 30 of file gen_manifest.py.

◆ manifest

list gen_manifest.manifest = []

Definition at line 52 of file gen_manifest.py.

◆ manifestName

gen_manifest.manifestName = sys.argv[3]

Definition at line 29 of file gen_manifest.py.

◆ patterns

gen_manifest.patterns = extensions + htmlFiles

Definition at line 35 of file gen_manifest.py.

◆ text

gen_manifest.text = open(htmlFile, 'r').read()

Definition at line 75 of file gen_manifest.py.