def getFilePaths(ARGS): cmd_line_files = [f.decode('utf-8') for f in ARGS.files] if ARGS.update_library: filepaths = movie.loadFiles(cmd_line_files, add_movie=movie.addMovie) else: filepaths = movie.queryFiles(cmd_line_files) return filepaths
parser.add_argument('--shuffle', default=True, type=util.flexibleBoolean, help='shuffle file list') parser.add_argument('--update-library', action='store_true', default=False) parser.add_argument('--extra', default='') parser.add_argument('--clip-tag', default='cumshot') ARGS = parser.parse_args() try: script.standardSetup() logging.info('****** Starting new script ********') cmd_line_files = [f.decode('utf-8') for f in ARGS.files] if ARGS.update_library: filepaths = movie.loadFiles(cmd_line_files, add_movie=movie.addMovie) else: filepaths = movie.queryFiles(cmd_line_files) logging.debug('filepaths: %s', len(filepaths)) db.getSession().commit() logging.debug('%s files loaded', len(filepaths)) PROJECT = project.getProject(ARGS) all_filters = [ filters.ExcludeTags( ['pmv', 'c**k.hero', 'compilation', 'solo', 'lesbian']) ] if ARGS.clip_tag.lower != 'none': all_filters.append(ExcludeClipTag(PROJECT, ARGS.clip_tag)) all_filters.extend(filters.applyArgs(ARGS, db.getSession()))
parents=[filters.getParser(), project.getParser()]) parser.add_argument('files', nargs='*', help='files to play; play entire collection if omitted') parser.add_argument('--shuffle', default=True, type=util.flexibleBoolean, help='shuffle file list') parser.add_argument('--update-library', action='store_true', default=False) parser.add_argument('--extra', default='') parser.add_argument('--clip-tag', default='cumshot') ARGS = parser.parse_args() try: script.standardSetup() logging.info('****** Starting new script ********') cmd_line_files = [f.decode('utf-8') for f in ARGS.files] if ARGS.update_library: filepaths = movie.loadFiles(cmd_line_files, add_movie=movie.addMovie) else: filepaths = movie.queryFiles(cmd_line_files) logging.debug('filepaths: %s', len(filepaths)) db.getSession().commit() logging.debug('%s files loaded', len(filepaths)) PROJECT = project.getProject(ARGS) all_filters = [filters.ExcludeTags(['pmv', 'c**k.hero', 'compilation', 'solo', 'lesbian'])] if ARGS.clip_tag.lower != 'none': all_filters.append(ExcludeClipTag(PROJECT, ARGS.clip_tag)) all_filters.extend(filters.applyArgs(ARGS, db.getSession())) inventory = movie.MovieInventory(filepaths, ARGS.shuffle, all_filters)
import argparse from porntool import db from porntool import movie from porntool import script parser = argparse.ArgumentParser() parser.add_argument('directory') args = parser.parse_args() try: script.standardSetup(copy_db=False, file_handler=False) movie.loadFiles(args.directory, movie.addMovie) db.getSession().commit() finally: script.standardCleanup()
except StopIteration: logging.debug('Exiting!') raise urwid.ExitMainLoop() finally: db.getSession().commit() parser = argparse.ArgumentParser( description='Play your p**n collection', parents=[filters.getParser()]) parser.add_argument('files', nargs='*', help='files to play; play entire collection if omitted') parser.add_argument('--shuffle', default=True, type=flexibleBoolean) args = parser.parse_args() script.standardSetup() try: filepaths = movie.loadFiles(args.files, add_movie=movie.addMovie) db.getSession().commit() all_filters = [filters.Exists()] all_filters.extend(filters.applyArgs(args, db.getSession())) inventory = movie.MovieInventory(filepaths, args.shuffle, all_filters) iinventory = iter(inventory) NORMALRATINGS = rating.NormalRatings(db.getSession()) CONTROLLER = None fill = reviewer.UrwidReviewWidget(valign='bottom') loop = urwid.MainLoop(fill, unhandled_input=handleKey, handle_mouse=False) loop.set_alarm_in(1, nextMovie)
import argparse from porntool import db from porntool import movie from porntool import script from porntool import tag parser = argparse.ArgumentParser(description='Play your p**n collection') parser.add_argument('files', nargs='+', help='files to play') parser.add_argument('--tags', nargs='+', help='tags to add to each file') args = parser.parse_args() if not args.tags: raise Exception("Must specify at least one tag") script.standardSetup(file_handler=False, copy_db=False) try: tags = [tag.getTag(t) for t in args.tags] filepaths = movie.loadFiles(args.files, add_movie=movie.addMovie) for fp in filepaths: for tag_ in tags: if tag_ not in fp.pornfile.tags: fp.pornfile.tags.append(tag_) finally: db.getSession().commit() script.standardCleanup()