Ejemplo n.º 1
0
def BuildJAM(jam_files):
    """Compress the files into LEGO.JAM"""
    try:
        os.chdir(jam_files)
        JAMExtractor.build(jam_files, verbose=False)

    # We don't have the rights to compress the JAM
    except PermissionError:  # lint:ok
        logging.warning("Error number '13'")
        logging.exception('''Oops! Something went wrong! Here's what happened

''', exc_info=True)
        logging.warning('''

PatchIt! does not have the rights to save LEGO.JAM to
{0}
'''.format(jam_files))

        # User did not want to reload with Administrator rights
        if not runasadmin.AdminRun().launch(
            ['''PatchIt! does not have the rights to save LEGO.JAM to
{0}'''.format(jam_files)]):
            # Do nothing, go to main menu
            pass

    # Go back to the menu
    finally:
        os.chdir(const.app_folder)
        main()