def cli(ctx, all_colors, color, inversion, background, size, mask, stroke, text, source): ctx.allColors = all_colors ctx.force = ctx.force or all_colors ctx.colors = [c for c in color] ctx.invert = inversion == 'True' if inversion is not None else None ctx.background = background ctx.colorOverlay = mask ctx.stroke = stroke ctx.text = text if all_colors or color or inversion or background or mask or stroke[ 0] or text: ctx.mode = OpMode.IMAGE if len(size) != 2: ctx.imageSize = ctx.config.thumbnailSize else: ctx.imageSize = size for s in source: if isinstance(s, pathlib.Path): p = str(s) helpers.handlePath(ctx, p, checkFile=shouldProcessFile, handleFile=processSingleFile) else: processTeamsSpecs(ctx, s)
def cli(ctx, path): for p in path: fmtPath = os.path.abspath(click.format_filename(p)) helpers.handlePath(ctx, fmtPath, checkFile=shouldProcess, handleFile=processFile)
def cli(ctx, skip_ext, target_root, path): ctx.skipExt = skip_ext if target_root is not None: ctx.config.moveTarget = target_root for p in path: fmtPath = os.path.abspath(click.format_filename(p)) helpers.handlePath(ctx, fmtPath, checkFile=helpers.isVideoFile, handleFile=moveAssociatedFiles)
def cli(ctx, older, path): ctx.cutoffTime = None delta = parsing.parseTimedelta(older) if delta is not None: ctx.force = True now = datetime.now() ctx.cutoffTime = now - delta for p in path: fmtPath = os.path.abspath(click.format_filename(p)) helpers.handlePath(ctx, fmtPath, checkFile=checkFile, handleFile=cleanAssociatedFiles)
def cli(ctx, path, no_black_white, all_colors, rename, interactive, tint): # ctx.force = True ctx.noBW = no_black_white ctx.allColors = all_colors or interactive ctx.rename = rename or interactive ctx.interactive = interactive ctx.tint = tint if rename or interactive or all_colors or no_black_white or tint: ctx.mode = OpMode.IMAGE ctx.outDir = os.getcwd() for p in path: # fmtPath = os.path.abspath(click.format_filename(p)) fmtPath = click.format_filename(p) helpers.handlePath(ctx, fmtPath, checkFile=shouldProcessFile, handleFile=analyzeSingleFile)