# Path: confduino/boardlist.py
# def board_names(hwpack='arduino'):
#     """return installed board names."""
#     ls = list(boards(hwpack).keys())
#     ls.sort()
#     return ls
# 
# Path: confduino/boardlist.py
# def boards_txt(hwpack='arduino'):
#     """path of boards.txt."""
#     x = arduino_path() / 'hardware' / hwpack / 'boards.txt'
#     assert x.exists(), x
#     return x
# 
# Path: confduino/boardremove.py
# @entrypoint
# def remove_board(board_id):
#     """remove board.
# 
#     :param board_id: board id (e.g. 'diecimila')
#     :rtype: None
# 
#     """
# 
#     log.debug('remove %s', board_id)
#     lines = boards_txt().lines()
#     lines = filter(lambda x: not x.strip().startswith(board_id + '.'), lines)
#     boards_txt().write_lines(lines)
# 
# Path: confduino/hwpacklist.py
# def hwpack_names():
#     """return installed hardware package names."""
#     ls = hwpack_dir().listdir()
#     ls = [x.name for x in ls]
#     ls = [x for x in ls if x != 'tools']
#     arduino_included = 'arduino' in ls
#     ls = [x for x in ls if x != 'arduino']
#     ls.sort()
#     if arduino_included:
#         ls = ['arduino'] + ls  # move to 1st pos
#     return ls


from confduino.boardlist import board_names
from confduino.boardlist import boards_txt
from confduino.boardremove import remove_board
from confduino.hwpacklist import hwpack_names
from entrypoint2 import entrypoint
import psidialogs


@entrypoint
def remove_boards_gui(hwpack=''):
    """remove boards by GUI."""
    if not hwpack:
        if len(hwpack_names()) > 1:

# Path: confduino/boardlist.py
# def board_names(hwpack='arduino'):
#     """return installed board names."""
#     ls = list(boards(hwpack).keys())
#     ls.sort()
#     return ls
# 
# Path: confduino/boardlist.py
# def boards_txt(hwpack='arduino'):
#     """path of boards.txt."""
#     x = arduino_path() / 'hardware' / hwpack / 'boards.txt'
#     assert x.exists(), x
#     return x
# 
# Path: confduino/boardremove.py
# @entrypoint
# def remove_board(board_id):
#     """remove board.
# 
#     :param board_id: board id (e.g. 'diecimila')
#     :rtype: None
# 
#     """
# 
#     log.debug('remove %s', board_id)
#     lines = boards_txt().lines()
#     lines = filter(lambda x: not x.strip().startswith(board_id + '.'), lines)
#     boards_txt().write_lines(lines)
# 
# Path: confduino/hwpacklist.py
# def hwpack_names():
#     """return installed hardware package names."""
#     ls = hwpack_dir().listdir()
#     ls = [x.name for x in ls]
#     ls = [x for x in ls if x != 'tools']
#     arduino_included = 'arduino' in ls
#     ls = [x for x in ls if x != 'arduino']
#     ls.sort()
#     if arduino_included:
#         ls = ['arduino'] + ls  # move to 1st pos
#     return ls


# Path: confduino/examples/remove_boards.py
from confduino.boardlist import board_names
from confduino.boardlist import boards_txt
from confduino.boardremove import remove_board
from confduino.hwpacklist import hwpack_names
from entrypoint2 import entrypoint
import psidialogs



@entrypoint
def remove_boards_gui(hwpack=''):
    """remove boards by GUI."""
    if not hwpack:
        if len(hwpack_names()) > 1:

            hwpack = psidialogs.choice(hwpack_names(),