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

Initial release


git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/trunk@1913 b32b6428-25c9-4566-ad07-03861ab6144f
parent 95cb0158
No related branches found
No related tags found
No related merge requests found
from setuptools import setup,find_packages
with open('README.rst') as f:
long_description = f.read()
VERSION = "0.1"
setup(
name='xaal.gtknotify',
version=VERSION,
license='GPL License',
author='Jerome Kerdreux',
author_email='Jerome.Kerdreux@imt-atlantique.fr',
#url='',
description=('xAAL Desktop notification device' ),
long_description=long_description,
classifiers=[
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords=['xaal', 'gtk','notify'],
platforms='any',
packages=find_packages(),
include_package_data=True,
install_requires=[
'xaal.lib',
'PyGObject',
]
)
[config]
addr = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
from . import dev
dev.main()
from xaal.lib import tools,Engine,Device
import platform
PACKAGE_NAME = "xaal.gtknotify"
logger = tools.get_logger(PACKAGE_NAME,'DEBUG')
import gi
gi.require_version('Notify', '0.7')
from gi.repository import Notify
def register_device(engine):
cfg = tools.load_cfg_or_die(PACKAGE_NAME)
dev = Device("notification.desktop")
dev.address = cfg['config']['addr']
dev.product_id = "GTK Notification device"
dev.vendor_id = "IHSEV TEAM"
dev.version = 0.1
dev.info = "%s@%s" % (PACKAGE_NAME,platform.node())
dev.add_method('notify',notify)
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")
try:
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()
from xaal.lib import Device,Engine,tools
dev = Device("test.basic",tools.get_random_uuid())
eng = Engine()
eng.add_device(dev)
eng.start()
eng.send_request(dev,['057e4c2e-6c09-4720-91d2-2e1a24273e62',],'notify',{'title' : 'Foo','msg' : 'Bar'})
eng.loop()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment