Thread: PRS-500 HTML2LRF
View Single Post
Old 01-04-2007, 12:24 AM   #45
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,452
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
One final (I hope) problem with command line options. BBeBook lowercases the input filename when deriving the output filename, for e.g.
Code:
java -jar /home/kovid/download/BBeBook-0.2.jar  Test.html && ls *.lrf
test.html.lrf
Is this intentional? Or will it be fixed in a future version. I'm asking all these questions because I'm planning to integrate BBeBook into libprs500 and I need a stable commandline interface.

Thanks,

Kovid.

EDIT: Here's a modified makeBook function that fixes the lowercasing
Code:
// Process command line arguments
        for (int i=0; i < args.length; i++) {
            String oarg = args[i].trim();
            String arg = oarg.toLowerCase();
            if ("-t".equals(arg) || "--title".equals(arg)) {
                bookTitle.setLength(0);
                bookTitle.append(args[i+1]);
            } else if ("-a".equals(arg) || "--author".equals(arg)) {
                bookAuthor.setLength(0);
                bookAuthor.append(args[i+1]);
            } else if ("-r".equals(arg) || "--raster".equals(arg)) {
                rasterize = true;
            } else if ("--thumbnail".equals(arg)) {
                bookIconName.setLength(0);
                bookIconName.append(args[i+1]);
            } else {
                if (arg.endsWith(".pdf")) {
                    makeBookFromPdf(oarg, rasterize);
                    break;
                } else if (arg.endsWith(".html") || arg.endsWith(".htm")) {
                    makeBookFromHtml(oarg);
                    break;
                } else if (arg.endsWith(".xml")) {
                    makeBookFromXmlConfig(oarg);
                    break;
                }

            }
        }

Last edited by kovidgoyal; 01-04-2007 at 03:22 AM.
kovidgoyal is online now   Reply With Quote