fwenzel / stapler

A small utility making use of the pypdf library to provide a (somewhat) lighter alternative to pdftk
Other
23 stars 1 forks source link

Expand glob expressions #4

Closed fwenzel closed 10 years ago

fwenzel commented 10 years ago

From Barry Dillon:

Firstly thanks for making stapler available it is very useful and pdfTk was getting rather fragile.

I added 4 lines of code which are important for windows users but not for Linux. You may care to incorporate them.

Basically if you do in windows :

C:>stapler cat *.pdf report.pdf

it will give ‘error *.pdf does not exist’. Windows does not automatically expand wildcards.

I added :

from glob import glob

and in main body of stapler :

arg1 = glob(' '.join(args[1:2])) ## added by BD to expand *.pdf

arg1.append(args[2])  # reinstate the output file name

args=arg1 #

I hope that helps and apologies if this is the wrong route to suggest additions.