Fix some stylistic issues found by various linters.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Sun, 19 Apr 2015 11:37:39 +0000 (13:37 +0200)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Sun, 19 Apr 2015 11:37:39 +0000 (13:37 +0200)
src/pwl6.css
tools/generate-appcache
tools/generate-nw
tools/generate-osx-app

index 180d159..12c330a 100644 (file)
@@ -15,9 +15,9 @@ html, body {
 }
 
 .yuu-overlay *:focus {
 }
 
 .yuu-overlay *:focus {
-    box-shadow: 0 0 5px hsla(276, 66%, 80%, 1.0);
     -moz-box-shadow: 0 0 5px hsla(276, 66%, 80%, 1.0);
     -webkit-box-shadow: 0 0 5px hsla(276, 66%, 80%, 1.0);
     -moz-box-shadow: 0 0 5px hsla(276, 66%, 80%, 1.0);
     -webkit-box-shadow: 0 0 5px hsla(276, 66%, 80%, 1.0);
+    box-shadow: 0 0 5px hsla(276, 66%, 80%, 1.0);
     outline: none;
 }
 
     outline: none;
 }
 
@@ -39,9 +39,9 @@ input[type=range][data-yuu-command]::-moz-range-thumb {
 }
 
 input[type=checkbox][data-yuu-command]:focus + label[for] {
 }
 
 input[type=checkbox][data-yuu-command]:focus + label[for] {
-    box-shadow: 0 0 5px hsla(276, 66%, 80%, 1.0);
     -moz-box-shadow: 0 0 5px hsla(276, 66%, 80%, 1.0);
     -webkit-box-shadow: 0 0 5px hsla(276, 66%, 80%, 1.0);
     -moz-box-shadow: 0 0 5px hsla(276, 66%, 80%, 1.0);
     -webkit-box-shadow: 0 0 5px hsla(276, 66%, 80%, 1.0);
+    box-shadow: 0 0 5px hsla(276, 66%, 80%, 1.0);
     outline: 0;
 }
 
     outline: 0;
 }
 
index a729f0b..674a864 100755 (executable)
@@ -1,19 +1,28 @@
 #!/usr/bin/env python
 
 #!/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 os
 import re
-import shutil
 import time
 
 import time
 
+
 def is_html(filename):
     return filename.lower().endswith(".html")
 
 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)
 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:
     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)
     else:
         main(appdir)
-        
index 62b535c..ea99e69 100755 (executable)
@@ -6,15 +6,18 @@
 
 import os
 import re
 
 import os
 import re
-import shutil
 import time
 import json
 
 import time
 import json
 
+
 def is_html(filename):
     return filename.lower().endswith(".html")
 
 def is_html(filename):
     return filename.lower().endswith(".html")
 
+
 def attr(name):
 def attr(name):
-    return "data-" + name + """=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']?"""
+    return ("data-" + name
+            + """=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']?""")
+
 
 def main(appdir, version=None):
     if not os.path.isdir(appdir):
 
 def main(appdir, version=None):
     if not os.path.isdir(appdir):
@@ -24,10 +27,10 @@ def main(appdir, version=None):
     for root, dirnames, filenames in os.walk(appdir):
         root = os.path.relpath(root, appdir)
         for filename in filenames:
     for root, dirnames, filenames in os.walk(appdir):
         root = os.path.relpath(root, appdir)
         for filename in filenames:
-            if filename.lower() == "index.html":
+            flower = filename.lower()
+            if flower == "index.html":
                 indexes.append(os.path.join(root, filename))
                 indexes.append(os.path.join(root, filename))
-            if ("icon" in filename.lower()
-                and filename.lower().endswith((".ico", ".png"))):
+            if ("icon" in flower and flower.endswith((".ico", ".png"))):
                 icons.append(os.path.join(root, filename))
 
     indexes.sort(key=lambda fn: (fn.count("/"), fn))
                 icons.append(os.path.join(root, filename))
 
     indexes.sort(key=lambda fn: (fn.count("/"), fn))
index 57d80a0..86e5c46 100755 (executable)
@@ -6,24 +6,26 @@ import re
 import plistlib
 import shutil
 import json
 import plistlib
 import shutil
 import json
-import re
 
 
-from os.path import join, basename
+from os.path import join
+
 
 def xp_filename(basename):
     return re.sub('["<>*?|\\\\]', "_",
                   basename.replace("/", "-").replace(":", "."))
 
 
 def xp_filename(basename):
     return re.sub('["<>*?|\\\\]', "_",
                   basename.replace("/", "-").replace(":", "."))
 
+
 def versionify(version):
     return ".".join(filter(lambda x: x.isdigit(),
                            re.split("[-+.]", version))[:3])
 
 def versionify(version):
     return ".".join(filter(lambda x: x.isdigit(),
                            re.split("[-+.]", version))[:3])
 
+
 def main(nwdir, nwpackage):
     if not os.path.isdir(nwdir):
         raise StandardError("input (%r) is not a directory" % nwdir)
     nwzip = zipfile.ZipFile(nwpackage)
     icnss = filter(lambda f: f.lower().endswith(".icns"),
 def main(nwdir, nwpackage):
     if not os.path.isdir(nwdir):
         raise StandardError("input (%r) is not a directory" % nwdir)
     nwzip = zipfile.ZipFile(nwpackage)
     icnss = filter(lambda f: f.lower().endswith(".icns"),
-                  nwzip.namelist())
+                   nwzip.namelist())
     package = json.load(nwzip.open("package.json"))
     app = join(nwdir, "nwjs.app")
     title = package["window"]["title"]
     package = json.load(nwzip.open("package.json"))
     app = join(nwdir, "nwjs.app")
     title = package["window"]["title"]
@@ -56,4 +58,3 @@ def main(nwdir, nwpackage):
 if __name__ == "__main__":
     import sys
     main(*sys.argv[1:])
 if __name__ == "__main__":
     import sys
     main(*sys.argv[1:])
-