4 import manga.lib, manga.reader
5 import glib, gobject, gtk
11 out.write("usage: automanga [-h] [DIR]\n")
12 out.write(" automanga [-h] -l LIBRARY ID\n")
13 out.write(" automanga [-h] -s LIBRARY NAME\n")
17 opts, args = getopt.getopt(sys.argv[1:], "hl:s")
32 lib = manga.lib.libraries[args[0]]
34 sys.stderr.write("automanga: no such library: %s\n" % args[0])
36 for manga in lib.byname(args[1]):
37 sys.stdout.write("\"%s\": %s\n" % (manga.name, manga.id))
40 if libname is not None:
45 lib = manga.lib.libraries[libname]
47 sys.stderr.write("automanga: no such library: %s\n" % libname)
50 mng = lib.byid(args[0])
52 sys.stderr.write("automanga: no such manga: %s\n" % args[0])
55 sys.stderr.write("automanga: local manga not yet implemented\n")
58 reader = manga.reader.reader(mng)