Fix some stylistic issues found by various linters.
[pwl6.git] / tools / generate-appcache
index a729f0b..674a864 100755 (executable)
@@ -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)
-