X-Git-Url: http://git.hcoop.net/clinton/Smoothieware.git/blobdiff_plain/79f3832eda16b783c1c0d8727b5832f34a22cbb1..26044858c076705223a2e5c523112853562e814e:/smoothie-upload.py diff --git a/smoothie-upload.py b/smoothie-upload.py index ff5e17f3..b15c078a 100644 --- a/smoothie-upload.py +++ b/smoothie-upload.py @@ -8,6 +8,7 @@ import sys import argparse import socket import os +import re # Define command line argument interface parser = argparse.ArgumentParser(description='Upload a file to Smoothie over network.') parser.add_argument('file', type=argparse.FileType('r'), @@ -20,6 +21,8 @@ parser.add_argument('-o','--output', help='Set output filename') parser.add_argument('-q','--quiet',action='store_true', help='suppress all output to terminal') +parser.add_argument('-s','--space',action='store_true', + help='Leave whitespaces in output filename') args = parser.parse_args() @@ -28,6 +31,8 @@ verbose = args.verbose output = args.output if output == None : output= args.file.name +if not args.space: + output = re.sub("\s", "_", output) filesize= os.path.getsize(args.file.name)