[Swift-commit] r6706 - SwiftApps/modis/bin

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Fri Aug 2 09:41:11 CDT 2013


Author: wozniak
Date: 2013-08-02 09:41:11 -0500 (Fri, 02 Aug 2013)
New Revision: 6706

Modified:
   SwiftApps/modis/bin/rgb_to_png.py
Log:
Add usage message


Modified: SwiftApps/modis/bin/rgb_to_png.py
===================================================================
--- SwiftApps/modis/bin/rgb_to_png.py	2013-08-02 14:25:15 UTC (rev 6705)
+++ SwiftApps/modis/bin/rgb_to_png.py	2013-08-02 14:41:11 UTC (rev 6706)
@@ -49,6 +49,13 @@
         s2 = (s2 + s1) % 65521
     return (s2 << 16) + s1
 
+def usage():
+    print("usage: rgb_to_png.py <rgb file> <png file>")
+
+if (len(sys.argv) != 2):
+    usage()
+    exit(1)
+
 img = open(sys.argv[1], 'r').read()
 w, h = int(sys.argv[2]), int(sys.argv[3])
 open(sys.argv[4], 'wb').write(to_png(w, h, img))




More information about the Swift-commit mailing list