def upload(arguments): """ :param arguments: handoff_name, product (str) :return: void """ if arguments.product not in ['support', 'chat', 'help', 'bime', 'explore']: print('The product name is invalid. Try again.') exit() ho = Handoff(arguments.handoff_name, arguments.product) ho.upload_handoff()
def clean(arguments): """ :param arguments: handoff_name (str), product (str), write (bool) :return: void """ if arguments.product not in ['support', 'chat', 'help', 'bime', 'explore']: print('The product name is invalid. Try again.') exit() ho = Handoff(arguments.handoff_name, arguments.product) ho.strip_comments(arguments.write)
def publish(arguments): """ :param arguments: handoff_name (str), product (str), locales (list), write (bool) :return: void """ if arguments.product not in ['support', 'chat', 'help', 'bime', 'explore']: print('The product name is invalid. Try again.') exit() ho = Handoff(arguments.handoff_name, arguments.product) ho.publish_handoff(arguments.locales, arguments.write)
def create(arguments): """ :param arguments: handoff_name (str), product (str), loader (str) :return: void """ if arguments.product not in ['support', 'chat', 'help', 'bime', 'explore']: print('The product name is invalid. Try again.') exit() ho = Handoff(arguments.handoff_name, arguments.product) if arguments.loader: ho.write_files(arguments.loader) else: ho.write_files()
def check_images(arguments): """ :param arguments: handoff_name (str), product (str), exclude (list of ints) :return: void """ if arguments.product not in ['support', 'chat', 'help', 'bime', 'explore']: print('The product name is invalid. Try again.') exit() ho = Handoff(arguments.handoff_name, arguments.product) if arguments.exclude: ho.check_images(arguments.exclude) # [203664236, 203664256, 203664246, 203664226] else: ho.check_images()
def copy_images(arguments): """ :param arguments: handoff_name (str), product (str), months (int), exclude (list of ints) :return: void """ if arguments.product not in ['support', 'chat', 'help', 'bime', 'explore']: print('The product name is invalid. Try again.') exit() ho = Handoff(arguments.handoff_name, arguments.product) if arguments.months: arguments.months = int(arguments.months) # function takes an int ho.copy_images(arguments.months, arguments.exclude) else: ho.copy_images(exclude=arguments.exclude)
def relink(arguments): """ :param arguments: handoff_name (str), product (str), articles (bool), images (bool), locales (list), write (bool) :return: void """ if arguments.product not in ['support', 'chat', 'help', 'bime', 'explore']: print('The product name is invalid. Try again.') exit() ho = Handoff(arguments.handoff_name, arguments.product) if arguments.hrefs or arguments.srcs: if arguments.hrefs: ho.update_hrefs(arguments.locales, arguments.write) if arguments.srcs: ho.update_srcs(arguments.locales, arguments.write) else: ho.update_hrefs(arguments.locales, arguments.write) ho.update_srcs(arguments.locales, arguments.write)
def check_images(arguments): """ :param arguments: handoff_name (str), product (str), exclude (list of ints) :return: void """ if arguments.product not in ['support', 'chat', 'help', 'bime', 'explore']: print('The product name is invalid. Try again.') exit() ho = Handoff(arguments.handoff_name, arguments.product) if arguments.exclude: ho.check_images( arguments.exclude) # [203664236, 203664256, 203664246, 203664226] else: ho.check_images()