Exemplo n.º 1
0
Arquivo: ho.py Projeto: chucknado/zep
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()
Exemplo n.º 2
0
Arquivo: ho.py Projeto: chucknado/zep
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
Arquivo: ho.py Projeto: chucknado/zep
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)
Exemplo n.º 5
0
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()
Exemplo n.º 6
0
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)
Exemplo n.º 7
0
Arquivo: ho.py Projeto: chucknado/zep
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()
Exemplo n.º 8
0
Arquivo: ho.py Projeto: chucknado/zep
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()
Exemplo n.º 9
0
Arquivo: ho.py Projeto: chucknado/zep
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)
Exemplo n.º 10
0
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)
Exemplo n.º 11
0
Arquivo: ho.py Projeto: chucknado/zep
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)
Exemplo n.º 12
0
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()
Exemplo n.º 13
0
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)
Exemplo n.º 14
0
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()