Skip to content
Snippets Groups Projects
Commit eac528a8 authored by jkerdreu's avatar jkerdreu
Browse files

New run_package API

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/trunk@2071 b32b6428-25c9-4566-ad07-03861ab6144f
parent 613ec5ac
Branches
No related tags found
No related merge requests found
......@@ -25,6 +25,7 @@ setup(
include_package_data=True,
install_requires=[
'xaal.lib',
'pycairo',
'PyGObject',
]
)
from . import dev
dev.main()
from xaal.lib import helpers
helpers.run_package(dev.PACKAGE_NAME,dev.setup)
from xaal.lib import tools,Engine,Device
from xaal.lib import tools,helpers,Engine,Device
import platform
import logging
PACKAGE_NAME = "xaal.gtknotify"
logger = tools.get_logger(PACKAGE_NAME,'DEBUG')
logger = logging.getLogger(PACKAGE_NAME)
import gi
gi.require_version('Notify', '0.7')
......@@ -25,7 +26,6 @@ def register_device(engine):
engine.add_device(dev)
notify(PACKAGE_NAME,'started')
def notify(_title,_msg):
if Notify.init("xAALNotifications"):
notify = Notify.Notification.new('xAAL: %s' % _title,_msg,"dialog-information")
......@@ -33,16 +33,6 @@ def notify(_title,_msg):
notify.show()
except:pass
def run():
eng = Engine()
register_device(eng)
eng.run()
def main():
try:
run()
except KeyboardInterrupt:
print("Bye Bye...")
if __name__ == '__main__':
main()
def setup(engine):
register_device(engine)
return True
from xaal.lib import Device,Engine,tools
import sys
if (len(sys.argv) !=3):
print("Usage : %s title message" % sys.argv[0])
else:
# try to find the same address
cfg = tools.load_cfg_or_die('xaal.gtknotify')
target = cfg['config']['addr']
......@@ -8,12 +11,10 @@ target = cfg['config']['addr']
dev = Device("test.basic",tools.get_random_uuid())
eng = Engine()
eng.add_device(dev)
eng.start()
title = sys.argv[1]
msg = sys.argv[2]
eng.send_request(dev,[target,],'notify',{'title' : title,'msg' : msg})
eng.start()
eng.loop()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment