Browse Source

added apps module

the apps module contains functions for running specific apps. The apps
are 'installed' as console script within setup.py's entry points
master
Holger Frey 8 years ago
parent
commit
b0e121efcc
  1. BIN
      arduino_timetable/appicons/Household-Mouse-Trap.ico
  2. 17
      arduino_timetable/apps.py
  3. 13
      setup.py

BIN
arduino_timetable/appicons/Household-Mouse-Trap.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

17
arduino_timetable/apps.py

@ -0,0 +1,17 @@
import os
from . import run_application
def check_icon(icon_name):
own_path = os.path.abspath(__file__)
own_dir = os.path.dirname(own_path)
icon_path = os.path.join(own_dir, 'appicons', icon_name)
if os.path.isfile(icon_path):
return icon_path
return None
def run_magnetic_trap():
arduino_commands = {'open': 'o', 'close': 'c'}
icon = check_icon('Household-Mouse-Trap.ico')
run_application(arduino_commands, "It's a trap!", icon=icon)

13
setup.py

@ -117,4 +117,17 @@ setup(
# 'test': ['pytest'], # 'test': ['pytest'],
# }, # },
# if and what non python files be included?
include_package_data=True,
package_data={
'arduino_timetable': ['appicons/*.ico'],
},
# defining entry points, escpecially console script:
entry_points={
'console_scripts': [
'magnetictrap = arduino_timetable.apps:run_magnetic_trap',
],
},
) )

Loading…
Cancel
Save