X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FMain.java;h=41206560a3bde407bf0d1f12ddc1f9081dc00d4d;hp=f413a2d66e95ce296d8d7d1388103b98c41e7722;hb=9b863b20370118c95c6801b73dda951c7e507871;hpb=5895a95876fe63e76e726ef7fc4c97efe2ebd5b1 diff --git a/src/be/nikiroo/fanfix/Main.java b/src/be/nikiroo/fanfix/Main.java index f413a2d..4120656 100644 --- a/src/be/nikiroo/fanfix/Main.java +++ b/src/be/nikiroo/fanfix/Main.java @@ -21,7 +21,7 @@ import be.nikiroo.fanfix.reader.BasicReader; import be.nikiroo.fanfix.reader.Reader; import be.nikiroo.fanfix.reader.Reader.ReaderType; import be.nikiroo.fanfix.supported.BasicSupport; -import be.nikiroo.fanfix.supported.BasicSupport.SupportType; +import be.nikiroo.fanfix.supported.SupportType; import be.nikiroo.utils.Progress; import be.nikiroo.utils.Version; import be.nikiroo.utils.serial.server.ServerObject; @@ -309,8 +309,8 @@ public class Main { case VERSION: System.out .println(String.format("Fanfix version %s" - + "\nhttps://github.com/nikiroo/fanfix/" - + "\n\tWritten by Nikiroo", + + "%nhttps://github.com/nikiroo/fanfix/" + + "%n\tWritten by Nikiroo", Version.getCurrentVersion())); updates.ok(); // we consider it read break; @@ -351,6 +351,20 @@ public class Main { } } + // We cannot do it when in GUI mode, because it is async... + // So if we close the temp files before it is actually used, + // we have a problem... + // TODO: close it at the correct time (for now, finalize try to do it) + if (false) { + try { + Instance.getTempFiles().close(); + } catch (IOException e) { + Instance.getTraceHandler().error( + new IOException( + "Cannot dispose of the temporary files", e)); + } + } + if (exitCode == 255) { syntax(false); } @@ -506,7 +520,7 @@ public class Main { * * @return the exit return code (0 = success) */ - private static int convert(String urlString, String typeString, + public static int convert(String urlString, String typeString, String target, boolean infoCover, Progress pg) { int exitCode = 0; @@ -538,7 +552,7 @@ public class Main { pg.addProgress(pgOut, 1); } - Story story = support.process(source, pgIn); + Story story = support.process(pgIn); try { target = new File(target).getAbsolutePath(); BasicOutput.getOutput(type, infoCover, infoCover)