"

function! QuotedPrintableDecode() range
	execute a:firstline . ',' . a:lastline . '!python -c "import quopri,sys;quopri.decode(sys.stdin,sys.stdout)"'
endfunction
function! QuotedPrintableEncode() range
	execute a:firstline . ',' . a:lastline . '!python -c "import quopri,sys;quopri.encode(sys.stdin,sys.stdout)"'
endfunction
command! -range -nargs=0 QPDecode <line1>,<line2>call QuotedPrintableDecode()
command! -range -nargs=0 QPEncode <line1>,<line2>call QuotedPrintableEncode()

function! QuotedPrintableDecodeFile(filename) 
	"execute 'new +.!python\ -c\ "import\ quopri,sys;quopri.decode(open(sys.argv[1]),sys.stdout)"\ ' .  a:filename . ''
	execute 'new'
	execute '.!python -c "import quopri,sys;quopri.decode(open(sys.argv[1]),sys.stdout)" ' .  a:filename
	execute 'file ' . a:filename . '.decoded'
endfunction
function! QuotedPrintableEncodeFile(filename) 
	execute 'new'
	execute '.!python -c "import quopri,sys;quopri.encode(open(sys.argv[1]),sys.stdout)" ' .  a:filename
	execute 'file ' . a:filename . '.quopri'
endfunction
command! -range -nargs=1 -complete=file QPDecodeFile call QuotedPrintableDecodeFile(<f-args>)
command! -range -nargs=1 -complete=file QPEncodeFile call QuotedPrintableEncodeFile(<f-args>)

