# Path: confduino/proginstall.py
# def install_programmer(programmer_id, programmer_options, replace_existing=False):
#     """install programmer in programmers.txt.
# 
#     :param programmer_id: string identifier
#     :param programmer_options: dict like
#     :param replace_existing: bool
#     :rtype: None
# 
#     """
#     doaction = 0
#     if programmer_id in programmers().keys():
#         log.debug('programmer already exists: %s', programmer_id)
#         if replace_existing:
#             log.debug('remove programmer: %s', programmer_id)
#             remove_programmer(programmer_id)
#             doaction = 1
#     else:
#         doaction = 1
# 
#     if doaction:
#         lines = bunch2properties(programmer_id, programmer_options)
#         programmers_txt().write_lines([''] + lines, append=1)
# 
# Path: confduino/util.py
# class AutoBunch (Munch):
# 
#     def __getattr__(self, k):
#         '''
#         Bunch is created for missing keys:
# 
#         >>> x=AutoBunch()
#         >>> x.mega.name = 'xy'
#         '''
#         try:
#             return self[k]
#         except KeyError:
#             #            raise AttributeError(k)
#             self[k] = AutoBunch()
#             return self[k]
# 
#     def __setattr__(self, k, v):
#         """Recursive.
# 
#         >>> x=AutoBunch()
#         >>> setattr(x, 'mega.name', 'xy')
# 
#         """
#         k2, _, k3 = k.partition('.')
#         if k3:
#             self.__getattr__(k2).__setattr__(k3, v)
#         else:
#             Munch.__setattr__(self, k, v)


from confduino.proginstall import install_programmer
from confduino.util import AutoBunch
from entrypoint2 import entrypoint


@entrypoint
def install(replace_existing=False):
    """install stk200 programmer."""
    bunch = AutoBunch()
    bunch.name = 'STK200'
    bunch.protocol = 'stk200'
    # bunch.force = 'true'
    # bunch.delay=200


# Path: confduino/proginstall.py
# def install_programmer(programmer_id, programmer_options, replace_existing=False):
#     """install programmer in programmers.txt.
# 
#     :param programmer_id: string identifier
#     :param programmer_options: dict like
#     :param replace_existing: bool
#     :rtype: None
# 
#     """
#     doaction = 0
#     if programmer_id in programmers().keys():
#         log.debug('programmer already exists: %s', programmer_id)
#         if replace_existing:
#             log.debug('remove programmer: %s', programmer_id)
#             remove_programmer(programmer_id)
#             doaction = 1
#     else:
#         doaction = 1
# 
#     if doaction:
#         lines = bunch2properties(programmer_id, programmer_options)
#         programmers_txt().write_lines([''] + lines, append=1)
# 
# Path: confduino/util.py
# class AutoBunch (Munch):
# 
#     def __getattr__(self, k):
#         '''
#         Bunch is created for missing keys:
# 
#         >>> x=AutoBunch()
#         >>> x.mega.name = 'xy'
#         '''
#         try:
#             return self[k]
#         except KeyError:
#             #            raise AttributeError(k)
#             self[k] = AutoBunch()
#             return self[k]
# 
#     def __setattr__(self, k, v):
#         """Recursive.
# 
#         >>> x=AutoBunch()
#         >>> setattr(x, 'mega.name', 'xy')
# 
#         """
#         k2, _, k3 = k.partition('.')
#         if k3:
#             self.__getattr__(k2).__setattr__(k3, v)
#         else:
#             Munch.__setattr__(self, k, v)


# Path: confduino/examples/stk200.py
from confduino.proginstall import install_programmer
from confduino.util import AutoBunch
from entrypoint2 import entrypoint



@entrypoint
def install(replace_existing=False):
    """install stk200 programmer."""
    bunch = AutoBunch()
    bunch.name = 'STK200'
    bunch.protocol = 'stk200'
    # bunch.force = 'true'
    # bunch.delay=200


    install_programmer('stk200', bunch, replace_existing=replace_existing)