# Path: confduino/exampallcreate.py
# def create_examples_all():
# 
# Path: confduino/libinstall.py
# @entrypoint
# def install_lib(url, replace_existing=False, fix_wprogram=True):
#     """install library from web or local files system.
# 
#     :param url: web address or file path
#     :param replace_existing: bool
#     :rtype: None
# 
#     """
#     d = tmpdir(tmpdir())
#     f = download(url)
#     Archive(f).extractall(d)
# 
#     clean_dir(d)
#     d, src_dlib = find_lib_dir(d)
#     move_examples(d, src_dlib)
#     fix_examples_dir(src_dlib)
#     if fix_wprogram:
#         fix_wprogram_in_files(src_dlib)
# 
#     targ_dlib = libraries_dir() / src_dlib.name
#     if targ_dlib.exists():
#         log.debug('library already exists: %s', targ_dlib)
#         if replace_existing:
#             log.debug('remove %s', targ_dlib)
#             targ_dlib.rmtree()
#         else:
#             raise ConfduinoError('library already exists:' + targ_dlib)
# 
#     log.debug('move %s -> %s', src_dlib, targ_dlib)
#     src_dlib.move(targ_dlib)
# 
#     libraries_dir().copymode(targ_dlib)
#     for x in targ_dlib.walk():
#         libraries_dir().copymode(x)
#     return targ_dlib.name


from confduino import exampallcreate
from confduino.libinstall import install_lib
from entrypoint2 import entrypoint
    inst('http://arduino.cc/playground/uploads/Code/TimedAction-1_6.zip')

# can't install
# inst('http://www.arduino.cc/playground/uploads/Code/Time.zip')

    inst('http://arduino.cc/playground/uploads/Code/EventFuse.zip')
    inst('http://arduino.cc/playground/uploads/Code/Charlieplex.zip')
    inst('http://arduino.cc/playground/uploads/Code/DigitalToggle.zip')
    inst('http://arduino.cc/playground/uploads/Code/Enerlib.zip')

    inst('http://arduino.cc/playground/uploads/Code/AdvButton_11.zip')

    # old version
    # inst('http://arduino.cc/playground/uploads/Code/AdvButton.zip')

# can't install
# inst('http://arduino.cc/playground/uploads/Code/SerialDebugger.zip') #

    inst('http://arduino.cc/playground/uploads/Code/MatrixMath.zip')
    inst('http://arduino.cc/playground/uploads/Code/StackArray.zip')
    inst('http://arduino.cc/playground/uploads/Code/StackList.zip')
    inst('http://arduino.cc/playground/uploads/Code/QueueArray.zip')
    inst('http://arduino.cc/playground/uploads/Code/QueueList.zip')
    inst('http://arduino.cc/playground/uploads/Code/Ping-1_3.zip')
    inst('http://www.arduino.cc/playground/uploads/Code/LED.zip')

#    inst('')

    if create_examples_all:
        print('create "all" menu item')

# Path: confduino/exampallcreate.py
# def create_examples_all():
# 
# Path: confduino/libinstall.py
# @entrypoint
# def install_lib(url, replace_existing=False, fix_wprogram=True):
#     """install library from web or local files system.
# 
#     :param url: web address or file path
#     :param replace_existing: bool
#     :rtype: None
# 
#     """
#     d = tmpdir(tmpdir())
#     f = download(url)
#     Archive(f).extractall(d)
# 
#     clean_dir(d)
#     d, src_dlib = find_lib_dir(d)
#     move_examples(d, src_dlib)
#     fix_examples_dir(src_dlib)
#     if fix_wprogram:
#         fix_wprogram_in_files(src_dlib)
# 
#     targ_dlib = libraries_dir() / src_dlib.name
#     if targ_dlib.exists():
#         log.debug('library already exists: %s', targ_dlib)
#         if replace_existing:
#             log.debug('remove %s', targ_dlib)
#             targ_dlib.rmtree()
#         else:
#             raise ConfduinoError('library already exists:' + targ_dlib)
# 
#     log.debug('move %s -> %s', src_dlib, targ_dlib)
#     src_dlib.move(targ_dlib)
# 
#     libraries_dir().copymode(targ_dlib)
#     for x in targ_dlib.walk():
#         libraries_dir().copymode(x)
#     return targ_dlib.name


# Path: confduino/examples/upgrademany.py
from confduino import exampallcreate
from confduino.libinstall import install_lib
from entrypoint2 import entrypoint

    inst('http://arduino.cc/playground/uploads/Code/TimedAction-1_6.zip')

# can't install
# inst('http://www.arduino.cc/playground/uploads/Code/Time.zip')

    inst('http://arduino.cc/playground/uploads/Code/EventFuse.zip')
    inst('http://arduino.cc/playground/uploads/Code/Charlieplex.zip')
    inst('http://arduino.cc/playground/uploads/Code/DigitalToggle.zip')
    inst('http://arduino.cc/playground/uploads/Code/Enerlib.zip')

    inst('http://arduino.cc/playground/uploads/Code/AdvButton_11.zip')

    # old version
    # inst('http://arduino.cc/playground/uploads/Code/AdvButton.zip')

# can't install
# inst('http://arduino.cc/playground/uploads/Code/SerialDebugger.zip') #

    inst('http://arduino.cc/playground/uploads/Code/MatrixMath.zip')
    inst('http://arduino.cc/playground/uploads/Code/StackArray.zip')
    inst('http://arduino.cc/playground/uploads/Code/StackList.zip')
    inst('http://arduino.cc/playground/uploads/Code/QueueArray.zip')
    inst('http://arduino.cc/playground/uploads/Code/QueueList.zip')
    inst('http://arduino.cc/playground/uploads/Code/Ping-1_3.zip')
    inst('http://www.arduino.cc/playground/uploads/Code/LED.zip')

#    inst('')

    if create_examples_all:
        print('create "all" menu item')

        exampallcreate.create_examples_all()