Browse Source
the apps module contains functions for running specific apps. The apps are 'installed' as console script within setup.py's entry pointsmaster

3 changed files with 30 additions and 0 deletions
After Width: | Height: | Size: 161 KiB |
@ -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) |
Loading…
Reference in new issue