]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Merge pull request #73 from joshuaflanagan/example_script_variables
authorJacob Alexander <haata@kiibohd.com>
Tue, 10 Nov 2015 19:24:03 +0000 (11:24 -0800)
committerJacob Alexander <haata@kiibohd.com>
Tue, 10 Nov 2015 19:24:03 +0000 (11:24 -0800)
Stop requiring editing of example scripts

1  2 
Scan/STLcd/bitmap2Struct.py

index f0790a29aa5f5b1ceb46da830ed81999076c08d2,4e682ca48134d0d81da26d0c2419cb1097151acd..6f2cbf128bf8c971766983c41485e2c234059774
@@@ -19,7 -19,7 +19,7 @@@
  import sys
  
  from array import *
 -from PIL import Image
 +from PIL import Image # Use pillow instead of PIL, it works with Python 3
  
  
  # Convenience class to deal with converting images to a C array
@@@ -110,7 -110,10 +110,10 @@@ class STLcdGraphic
                return display
  
  
- filename = "ic_logo_lcd.bmp"
+ filename = sys.argv[1]
+ if filename is None:
+       print( "You must specify a bitmap filename. Try './bitmap2Struct.py ic_logo_lcd.bmp'" )
+       sys.exit( 1 )
  max_height = 32
  max_width = 128
  x_offset = 0