Fixed up argument count, added some comments

This commit is contained in:
A.M. Rowsell 2021-03-31 11:57:21 -04:00
commit d051b56cd2
Signed by: amr
GPG key ID: 0B6E2D8375CF79A9

View file

@ -8,19 +8,24 @@
import sys import sys
print("MS Paint file converter utility v0.1") print("MS Paint file converter utility v0.1")
print("Written by A.M. Rowsell, MPL Version 2.0 license\n\n") print("Written by A.M. Rowsell, MPL Version 2.0 license\n")
if len(sys.argv) < 1: if len(sys.argv) < 2:
print("Please provide filename (without extension)!") print("Please provide filename (without extension)!")
print("Example usage:\n./mspconvert.py DONUT")
sys.exit(255)
filename = sys.argv[1] filename = sys.argv[1]
width = 0 width = 0
height = 0 height = 0
# The output file follows the very simple XBM format
# which is just a basic C syntax array variable
outputString = ''' outputString = '''
#define {0}_width {1} #define {0}_width {1}
#define {0}_height {2} #define {0}_height {2}
static unsigned char {0}_bits [] = static unsigned char {0}_bits [] =
''' '''
# Output data starts as an empty bytearray
outputData = b'' outputData = b''
try: try: