From 5e175c16b3f40d07ea66356a4c6ece5abe884769 Mon Sep 17 00:00:00 2001 From: Taka Date: Thu, 4 May 2017 07:15:20 +0000 Subject: [PATCH] Worked around a Ghostscript problem when extracting files on a network share. --- asl_cards/parse.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/asl_cards/parse.py b/asl_cards/parse.py index 2ecde3d..5f13f76 100644 --- a/asl_cards/parse.py +++ b/asl_cards/parse.py @@ -89,6 +89,9 @@ class PdfParser: def parse( self , target , max_pages=-1 , image_res=None ) : """Extract the cards from a PDF file.""" + # FUDGE! The Qt directory browser always returns paths using forward slashes, which confuses Ghostscript :-/ + if sys.platform == "win32" and target.startswith("//") : + target = target.replace( "/" , "\\" ) # locate the files we're going to parse if os.path.isfile( target ) : fnames = [ target ]