Exemplo n.º 1
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import serial
import sys
import QP
import MT2625
import argparse
import os.path
from os.path import join
from TEXT import *

msg = TEXT()


def res(cond=False, ok_txt="", err_txt=""):
    if cond:
        msg.ok(ok_txt)
    else:
        msg.error(err_txt)


''' Argument Parser '''
usage_str = "\033[36mbla.py [--backup] --cfg <cfg_file>\n       bla.py [--backup] <app_file>\033[0m"
parser = argparse.ArgumentParser(usage=usage_str)
parser.add_argument("--backup", help="Backup NVDM", action="store_true")
parser.add_argument("--cfg",
                    help="Loads cfg instead of app file",
                    action="store_true")
parser.add_argument("fp", help="Full path to app-file or cfg file")