X-Git-Url: https://git.yukkurigames.com/?p=pwl6.git;a=blobdiff_plain;f=tools%2Fgenerate-appcache;h=674a864f74866a0b5791dc706a31223a2ce9026b;hp=a729f0b8e185c1fa3a10e88602d0b926feef0d95;hb=bbc9f232f882b7d4b64ae4c1e21260c1fa196a09;hpb=9ceff62f76f5ae2049cac00465d7756b0bc3cb9b diff --git a/tools/generate-appcache b/tools/generate-appcache index a729f0b..674a864 100755 --- a/tools/generate-appcache +++ b/tools/generate-appcache @@ -1,19 +1,28 @@ #!/usr/bin/env python -# Turn a website into an HTML5 application with an application cache -# manifest. -# -# http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html -# https://developer.mozilla.org/en/docs/HTML/Using_the_application_cache +"""Turn a website into an HTML5 application + + +This turns a directory into the simplest possible offline web +application, by making a manifest containing every file in the +directory, then inserting it into each HTML document. + +For more information about the HTML5 application cache, see: + +- http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html +- https://developer.mozilla.org/en/docs/HTML/Using_the_application_cache + +""" import os import re -import shutil import time + def is_html(filename): return filename.lower().endswith(".html") + def main(appdir): if not os.path.isdir(appdir): raise StandardError("input (%r) is not a directory" % appdir) @@ -45,8 +54,6 @@ if __name__ == "__main__": try: appdir = sys.argv[1] except IndexError: - raise SystemExit("Usage: %s appdir" %( - sys.argv[0])) + raise SystemExit("Usage: %s appdir" % sys.argv[0]) else: main(appdir) -