Exemple #1
0
 def test_packs(self):
     d = tmpdir(suffix='_test')
     os.environ['ARDUINO_HOME'] = d
     (d / 'hardware').makedirs()
     eq_(hwpack_names(), [])
     boards_txt = d / 'hardware' / 'p1' / 'boards.txt'
     boards_txt.parent.makedirs()
     boards_txt.write_text('')
     eq_(hwpack_names(), ['p1'])
     boards_txt = d / 'hardware' / 'p2' / 'boards.txt'
     boards_txt.parent.makedirs()
     boards_txt.write_text('')
     eq_(hwpack_names(), ['p1', 'p2'])
Exemple #2
0
def mcus():
    """MCU list."""
    ls = []
    for h in hwpack_names():
        for b in board_names(h):
            ls += [mcu(b, h)]
    ls = sorted(list(set(ls)))
    return ls
Exemple #3
0
def remove_boards_gui(hwpack=""):
    """remove boards by GUI."""
    if not hwpack:
        if len(hwpack_names()) > 1:
            hwpack = psidialogs.choice(hwpack_names(), "select hardware package to select board from!", title="select")
        else:
            hwpack = hwpack_names()[0]
    print("%s selected" % hwpack)

    if hwpack:
        sel = psidialogs.multi_choice(
            board_names(hwpack), "select boards to remove from %s!" % boards_txt(hwpack), title="remove boards"
        )
        print("%s selected" % sel)

        if sel:
            for x in sel:
                remove_board(x)
                print("%s was removed" % x)
Exemple #4
0
def remove_boards_gui(hwpack=''):
    """remove boards by GUI."""
    if not hwpack:
        if len(hwpack_names()) > 1:
            hwpack = psidialogs.choice(
                hwpack_names(),
                'select hardware package to select board from!',
                title='select')
        else:
            hwpack = hwpack_names()[0]
    print('%s selected' % hwpack)

    if hwpack:
        sel = psidialogs.multi_choice(board_names(hwpack),
                                      'select boards to remove from %s!' %
                                      boards_txt(hwpack),
                                      title='remove boards')
        print('%s selected' % sel)

        if sel:
            for x in sel:
                remove_board(x)
                print('%s was removed' % x)