Пример #1
0
    def test_prog(self):
        d = tmpdir(suffix='_test')
        os.environ['ARDUINO_HOME'] = d
        programmers_txt = d / 'hardware' / 'arduino' / 'programmers.txt'

        programmers_txt.parent.makedirs()

        programmers_txt.write_text('')
        check_keys(programmers().keys(), [])

        programmers_txt.write_text('''
brd.x1.y1=foo
brd.x2=foo
brd.x3=foo
        ''')
        check_keys(programmers().keys(), ['brd'])

        install_programmer('ardu', dict(x1='hi'))
        check_keys(programmers().keys(), ['ardu', 'brd'])

        install_programmer('ardu', dict(x1='hi'))
        check_keys(programmers().keys(), ['ardu', 'brd'])

        remove_programmer('brd')
        check_keys(programmers().keys(), ['ardu'])
Пример #2
0
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)
Пример #3
0
def install(replace_existing=False):
    """install dapa programmer."""
    bunch = AutoBunch()
    bunch.name = 'DAPA'
    bunch.protocol = 'dapa'
    bunch.force = 'true'
    # bunch.delay=200

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