forked from cocagne/txdbus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tcocagne
committed
Jul 2, 2012
1 parent
922a113
commit d373d00
Showing
64 changed files
with
11,413 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*\.pyc | ||
_trial_temp* | ||
*\.html | ||
dist | ||
MANIFEST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
include setup.py | ||
include tx | ||
global-exclude _trial_temp | ||
graft doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
Twisted DBus README | ||
=================== | ||
Tom Cocagne <tom.cocagne@gmail.com> | ||
v1.0, July 2012 | ||
|
||
Introduction | ||
------------ | ||
Twisted DBus is a native Python implementation of the | ||
http://dbus.freedesktop.org/doc/dbus-specification.html[DBus protocol] | ||
for the http://twistedmatrix.com/trac/[Twisted] networking framework. | ||
|
||
In addition to a link:doc/tutorial.asciidoc[Tutorial], and collection | ||
of link:doc/tutorial_examples[Examples], the | ||
documentation for this project also inclues | ||
link:doc/dbus_overview.asciidoc[An Overview of the DBus Protocol] | ||
|
||
*License*: http://www.opensource.org/licenses/mit-license.php[MIT] | ||
|
||
Quick Example | ||
------------- | ||
|
||
[source,python] | ||
---------------------------------------------------------------------- | ||
#!/usr/bin/python | ||
from twisted.internet import reactor, defer | ||
from tx.dbus import error, client | ||
@defer.inlineCallbacks | ||
def show_desktop_notification(): | ||
''' | ||
Displays "Hello World!" in a desktop notification window for 3 seconds | ||
''' | ||
con = yield client.connect(reactor, 'session') | ||
notifier = yield con.getRemoteObject('org.freedesktop.Notifications', | ||
'/org/freedesktop/Notifications') | ||
nid = yield notifier.callRemote('Notify', | ||
'Example Application', | ||
0, | ||
'', | ||
'Twisted DBus Example', | ||
'Hello World!', | ||
[], dict(), | ||
10) | ||
d = defer.Deferred() | ||
reactor.callLater(3, lambda : d.callback(None)) | ||
yield d | ||
yield notifier.callRemote('CloseNotification', nid) | ||
reactor.stop() | ||
reactor.callWhenRunning(show_desktop_notification) | ||
reactor.run() | ||
---------------------------------------------------------------------- | ||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.