def parseTwoArgCall(cmd, val): if cmd == "import": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return autoImporter.importDirectories(val) return if cmd == "organize": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return autOrg.organizeFolder(val) return elif cmd == "rename": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return autOrg.renameSeriesToMatchMangaUpdates(val) return elif cmd == "lookup": print("Passed name = '%s'" % val) import nameTools as nt haveLookup = nt.haveCanonicalMangaUpdatesName(val) if not haveLookup: print("Item not found in MangaUpdates name synonym table") print("Processed item as searched = '%s'" % nt.prepFilenameForMatching(val)) else: print("Item found in lookup table!") print("Canonical name = '%s'" % nt.getCanonicalMangaUpdatesName(val)) elif cmd == "purge-dir": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return utilities.dedupDir.purgeDedupTemps(val) return elif cmd == "purge-dir-phash": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return utilities.dedupDir.purgeDedupTempsPhash(val) return elif cmd == "dirs-restore": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return utilities.dedupDir.runRestoreDeduper(val) return elif cmd == "sort-dir-contents": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return utilities.approxFileSorter.scanDirectories(val) return elif cmd == "clean-archives": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return utilities.cleanFiles.cleanArchives(val) return elif cmd == "h-clean": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return utilities.dedupDir.runHDeduper(val) return else: print("Did not understand command!") print("Sys.argv = ", sys.argv)
def parseTwoArgCall(cmd, val): if cmd == "import": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return autoImporter.importDirectories(val) elif cmd == "organize": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return autOrg.organizeFolder(val) elif cmd == "run": utilities.runPlugin.runPlugin(val) elif cmd == "rename": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return autOrg.renameSeriesToMatchMangaUpdates(val) elif cmd == "lookup": print("Passed name = '%s'" % val) import nameTools as nt haveLookup = nt.haveCanonicalMangaUpdatesName(val) if not haveLookup: print("Item not found in MangaUpdates name synonym table") print("Processed item as searched = '%s'" % nt.prepFilenameForMatching(val)) else: print("Item found in lookup table!") print("Canonical name = '%s'" % nt.getCanonicalMangaUpdatesName(val) ) elif cmd == "purge-dir": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return utilities.dedupDir.purgeDedupTemps(val) elif cmd == "purge-dir-phash": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return utilities.dedupDir.purgeDedupTempsPhash(val) elif cmd == "dirs-restore": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return utilities.dedupDir.runRestoreDeduper(val) elif cmd == "sort-dir-contents": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return utilities.approxFileSorter.scanDirectories(val) elif cmd == "clean-archives": if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return utilities.cleanFiles.cleanArchives(val) else: print("Did not understand command!") print("Sys.argv = ", sys.argv)
def two_arg_import(val): if not os.path.exists(val): print("Passed path '%s' does not exist!" % val) return autoImporter.importDirectories(val)