Commit graph

45 commits

Author SHA1 Message Date
John (J5) Palmieri
b4b85685f1 * Fix my name in previous changelog ;)
* python/proxies.py (ProxyObject.__getattr__): add further patch
  from Anthony Baxter to throw an AttributeError when python
  __special__ functions are called instead of marshling them over
  the bus (Bug#1685 comment 3).
2005-05-05 18:27:34 +00:00
John (J5) Palmieri
425257ddf9 * python/Makefile.am: changed to use pyexecdir for the binding
shared libraries (Bug#2494)

* python/exceptions.py: bring exceptions over from the bindings
  so they can be used in applications (Bug#2036)
  Make all exceptions derive from DBusException

* python/_dbus.py, python/proxies.py: implement __repr__ in a couple
  of classes so that print obj doesn't throw an exception (Bug #1685)
2005-05-05 18:01:45 +00:00
John (J5) Palmieri
ac3b8d0a70 * python/dbus_bindings.pyx.in:
- added new type classes for hinting to the marashaler what type
to send over the wire
- added int16 and uint16 marshalers
- Fixed a bug in the type constants that caused int32 to go out
as uint16 over the wire
* python/dbus.py: split up into different files and renamed _dbus.py
* python/__init__.py, python/_util.py, python/decorators.py,
python/exceptions.py, python/proxies.py, python/services.py,
python/types.py: new files split off from dbus.py
* python/Makefile.am: Add new files, remove dbus.py and
install all python files to <python module dir>/dbus
* python/examples/*: Added #!/usr/bin/env python to the top of
every example.  Patch provided by Tatavarty Kalyan
2005-05-01 19:34:58 +00:00
John (J5) Palmieri
8d40569d8a * python/dbus_bindings.pyx.in (send_with_reply_handlers): New send
method for doing async calls
(_pending_call_notification): New C function for handling pendning call
callbacks
(set_notify): New method for setting pending call notification

* python/dbus.py: new version tuple "version" is set at (0, 40, 0)
Async capabilities added to remote method calls
(Sender): class removed
(RemoteService): class removed
(ObjectTree): class removed for now
(RemoteObject): Renamed to ProxyObject
(RemoteMethod): Renamed to ProxyMethod
(method): Decorator added for decorating python methods as dbus methods
(signal): Decorator added for decorating python methods as signal emitters
(ObjectType): Metaclass added for generating introspection data and the
method callback vtable
(Interface): Wrapper class added to wrap objects in a dbus interface
(Object): Uses ObjectType as its metaclass and exports Introspect
of the org.freedesktop.DBus.Introspectable interface
(ValidationException, UnknownMethodException): new exceptions

* python/examples/*: Modified to fit with the new bindings
2005-04-25 22:54:28 +00:00
John (J5) Palmieri
8f5a88e1e2 * python/lvalue_cast_post_process.py - removed. Patch has been
submitted to Pyrex maintainers that fixes gcc4.0 error

* python/Makefile.am: removed refrences to lvalue_cast_post_process.py
2005-03-29 17:01:43 +00:00
John (J5) Palmieri
11519c46c4 * python/lvalue_cast_post_process.py - added post processor to fix Pyrex
code so that it compiles with gcc4.0

* python/Makefile.am: Added lvalue_cast_post_process.py to EXTRA_DIST
  run dbus_bindings.c through lvalue_cast_post_process.py and copy the
  results back to dbus_binding.c
2005-03-21 21:13:56 +00:00
John (J5) Palmieri
d3f1b8bc89 python/dbus_bindings.pyx.in (PendingCall::get_reply):
s/dbus_pending_call_get_reply/dbus_pending_call_steal_reply
2005-02-23 19:36:24 +00:00
John (J5) Palmieri
38dad64ace * python/dbus.py (class Sender): added to support dbus signals better
(Bus::add_signal_receiver): added expand_args parameter which defaults
to True.  When expand args is True the signal handler will pass the
message arguments as parameters to the signal handler.  If False
revert to previous behavior where the signal handler must get the
argument list from the message.  This is to help port applications
like HAL that have a tendancy to send variable length argument lists.
self._match_rule_to_receivers is now a dict of dicts.
(Bus::remove_signal_receiver): pop handler off the dict intead of
removing it from a list
(Bus::_signal_func): change signal handlers so that interface,
signal_name, service, path and message are packed into a Sender
object and that is passed to the handler.  If expand_args is True
extract the args list from the message and append it to the parameter
list

* python/dbus_bindings.pyx.in (class Signature): added to support
signiature types
(MessageIter::__init__): changed iteration limit to match D-BUS
(MessageIter::get*): added INT16, UINT16, SIGNATURE, DICT_ENTRY,
STRUCT and VARIENT type support
(MessageIter::python_value_to_dbus_sig): made recursive to support
recursive types
(MessageIter::append*): added Signature, dict, tuple
support

* python/examples/example-client.py: added examples of getting tuples
and dicts

* python/examples/example-service.py: added examples of sending tuples
and dicts

* python/examples/example-signal-recipient.py: Fixed to handle new
signal callback format
2005-02-11 19:51:18 +00:00
John (J5) Palmieri
216fa619f3 * python/dbus_bindings.pyx.in: Updated to handle new D-BUS type system
- BUS_ACTIVATION -> BUS_STARTER
	- DBUS_BUS_ACTIVATION -> DBUS_BUS_STARTER
	- class MessageIter (__init__): Added recursion checking
	so we throw a nice error instead of just disconnecting from the
	bus.
	(get): Added arg_type parameter for recursion.
	Removed the nil type
	Added signiture type placeholder (not implemented)
	Added struct type placeholder (not implemented)
	Added varient type placeholder (not implemented)
	Commented out dict type for now
	(get_element_type): renamed from get_array_type
	(get_*): changed to use the dbus_message_iter_get_basic API
	(get_*_array): removed in favor of recursive get_array method
	(get_array): new recursive method which calls get to marshal
        the elements of the array
	(value_to_dbus_sig): New method returns the corrasponding
	dbus signiture to a python value
	(append): Comment out dict handling for now
	Handle lists with the new recursive API
	Comment out None handling for now
	(append_nil): removed
	(append_*): changed to use dbus_message_iter_append_basic API
	(append_*_array): removed in favor of recursive append_array
	method
	(__str__): Make it easier to print out recursive iterators
	for debugging
	- class Message (__str__): moved type inspection to the
	MessageIter class' __str__ method
	(get_iter): Added an append parameter wich defaults to False
	If True use the new API's to create an append iterator

* python/dbus.py: Update to use new bindings API
	- TYPE_ACTIVATION -> TYPE_STARTER
	- class Bus (_get_match_rule): GetServiceOwner -> GetNameOwner
	- class ActivationBus -> class StarterBus
	- class RemoteObject (__call__): get an append iterator
	- (_dispatch_dbus_method_call): get an append iterator
	- class Object (emit_signal): get an append iterator

* python/examples/: Fixed up the examples to work with the new API
2005-01-28 19:09:55 +00:00
John (J5) Palmieri
f4d4d5ace5 * python/dbus_bindings.pyx.in: Rename of methods and bindings
- get_base_service->get_unique_name
	- bus_get_base_service->bus_get_unique_name
	- dbus_bus_get_base_service -> dbus_bus_get_unique_name
	- ACTIVATION_REPLY_ACTIVATED -> DBUS_START_REPLY_SUCCESS
	- ACTIVATION_REPLY_ALREADY_ACTIVE -> DBUS_START_REPLY_ALREADY_RUNNING
	- bus_activate_service -> bus_start_service_by_name
	- dbus_bus_activate_service -> dbus_bus_start_service_by_name
	- bus_acquire_service -> bus_request_name
	- dbus_bus_acquire_service -> dbus_bus_request_name
	- bus_service_exists -> bus_name_has_owner
	- dbus_bus_service_exists -> dbus_bus_name_has_owner

* python/dbus.py: Rename of methods
	- activate_service -> start_service_by_name
	- bus_acquire_service -> bus_request_name
	- ACTIVATION_REPLY_ACTIVATED -> START_REPLY_SUCCESS
	- ACTIVATION_REPLY_ALREADY_ACTIVE -> START_REPLY_ALREADY_RUNNING
2005-01-25 19:06:53 +00:00
John (J5) Palmieri
7da3315f8c 2004-12-30 John (J5) Palmieri <johnp@redhat.com>
* python/dbus.py: s/ACTIVATION_REPLY_ACTIVE/ACTIVATION_REPLY_ACTIVATED
2004-12-30 18:28:03 +00:00
John (J5) Palmieri
63586e48f4 2004-12-30 John (J5) Palmieri <johnp@redhat.com>
* python/dbus_bindings.pyx.in: Change DBUS_ACTIVATION_REPLY_ACTIVATED
        and DBUS_ACTIVATION_REPLY_ALREADY_ACTIVE to match the values in
        dbus-protocol.h.  Because they are defines and not enums they are not
        autogenerated.
2004-12-30 14:19:54 +00:00
John (J5) Palmieri
a11bbc91a7 2004-12-26 John (J5) Palmieri <johnp@redhat.com>
* python/dbus_bindings.pyx.in (bus_activate_service): Bind
	dbus_bus_activate_service

	* python/dbus.py (Bus.activate_service): activate a service on the
	bus.
2004-12-27 16:01:13 +00:00
John (J5) Palmieri
f06f148871 * patch from Rob Taylor <robtaylor@fastmail.fm>
- wrap bus_get_unix_user method in low level bindings
	- add get_unix_user method to the Bus class
	- fix extract.py so it can handle unsigned long return types
2004-12-23 00:50:37 +00:00
David Zeuthen
31b1e75289 2004-09-16 David Zeuthen <david@fubar.dk>
* python/dbus_bindings.pyx.in: Add support for int64 and uint64
2004-09-16 19:56:26 +00:00
Anders Carlsson
b72fe8c67d 2004-07-28 Anders Carlsson <andersca@gnome.org>
* python/dbus.py:
	* python/dbus_bindings.pyx.in:
	Add dbus.init_gthreads (), allow emit_signal to pass
	arguments to the signal.
2004-07-28 18:14:55 +00:00
Seth Nickell
5d0ed9c704 2004-07-18 Seth Nickell <seth@gnome.org>
* python/dbus.py:
	* python/dbus_bindings.pyx.in:
	* python/tests/test-client.py:

	Add dbus.ByteArray and dbus_bindings.ByteArray
	types so that byte streams can be passed back.

	Give jdahlin the heaps of credit that are so
	rightfully his.
2004-07-18 21:44:37 +00:00
Seth Nickell
5afe4265ea 2004-07-12 Seth Nickell <seth@gnome.org>
* python/dbus.py:

	Add message argument to the default object_method_handler
	function.

	* python/dbus_bindings.pyx.in:

	Automatically return NIL when passed an empty list
	(we can't pass back a list since lists are typed
	and we don't have any idea what type the the client
	intended the list to be... :-( )
2004-07-12 06:29:00 +00:00
Seth Nickell
dd4ff748c1 2004-07-10 Seth Nickell <seth@gnome.org>
* python/examples/Makefile.am:

	Fix distcheck breakage caused by new examples.
2004-07-11 03:09:03 +00:00
Seth Nickell
233f8d0e33 2004-07-10 Seth Nickell <seth@gnome.org>
* python/dbus.py:

	Add "message" argument to service-side dbus.Object
	methods. This will break existing services written
	using the python bindings, but will allow extraction
	of all the message information (e.g. who its from).

	Add improved "object oriented" signal handling/emission.

	* python/examples/example-service.py:

	Nix this example.

	* python/examples/example-signal-emitter.py:
	* python/examples/example-signal-recipient.py:

	Two new examples that show how to emit and receive
	signals using the new APIs.

	* python/examples/example-signals.py:
	* python/examples/gconf-proxy-service.py:
	* python/examples/gconf-proxy-service2.py:

	Add "message" argument to service methods.
2004-07-11 03:02:14 +00:00
John (J5) Palmieri
5d58a04018 * switched include directory from glib/ to dbus/
since dbus-glib.h moved
2004-06-23 14:59:44 +00:00
Owen Fraser-Green
e7ec62bcb0 Fixed typo for python/examples make 2004-06-10 12:13:39 +00:00
John (J5) Palmieri
118f72cd0c * Python bindings are updated to reflect C API changes which now
accept plain path strings instead of an array of path elements.
2004-06-08 02:35:44 +00:00
Seth Nickell
241878cded Update .cvsignore files 2004-06-01 06:16:13 +00:00
Seth Nickell
736f76ba97 2004-06-01 Seth Nickell <seth@gnome.org>
* python/dbus_bindings.pyx.in:
	* python/tests/test-client.py:

	Round off basic type support. Add dicts (yay!), and
	remaining array types.

	Make MessageIter more general so it works for dicts too.

	Mark all loop variables as C integers.
2004-06-01 06:13:31 +00:00
Seth Nickell
23e9d3d504 * python/dbus_bindings.pyx.in:
* python/tests/test-client.py:

	Test Suite: 1
	Python Bindings: 0

	(fix string array memory trashing bug... oops)
2004-06-01 01:20:59 +00:00
Seth Nickell
d027c99375 2004-05-30 Seth Nickell <seth@gnome.org>
* python/dbus.py:

	Add a nicer-but-less-flexible alternate API for handling
	calls to virtual objects in dbus.ObjectTree.

	Screw up the argument order to the dbus.Object constructor
	for consistency with dbus.ObjectTree (and to make dbus_methods
	optional for future extension)

	* python/examples/Makefile.am:
	* python/examples/gconf-proxy-service.py:
	* python/examples/gconf-proxy-service2.py:

	Alternate implementation of gconf-proxy-service using the
	nicer dbus.ObjectTree API.

	* python/examples/example-service.py:
	* python/tests/test-server.py

	Reverse the argument order to deal with dbus.Object constructor
	changes.
2004-05-30 08:20:58 +00:00
Seth Nickell
7dc64ab60a 2004-05-30 Seth Nickell <seth@gnome.org>
* python/examples/example-client.py:
	* python/examples/example-service.py:

	Take it back. Lists seem to work but they're broken
	in the test suite. Make the base examples use
	lists (works fine).
2004-05-30 06:26:24 +00:00
Seth Nickell
8a10d91cc0 2004-05-30 Seth Nickell <seth@gnome.org>
* python/dbus_bindings.pyx.in:
	* python/tests/test-client.py:

	Add some more tests and fix errors that crop up.
	Unfortunately, currently it seems like marshalling
	and unmarshalling of lists is completely broken :-(
2004-05-30 06:21:00 +00:00
Seth Nickell
26c937cb30 2004-05-30 Seth Nickell <seth@gnome.org>
* python/dbus_bindings.pyx.in:

	Add support for ObjectPath type.

	* python/dbus.py:

	Refactor message handling code to a common function.

	* python/tests/test-client.py:
	* python/tests/test-server.py:

	Add tests that check to make sure values of all types
	can be echoed from a service w/o mangling.
2004-05-30 05:30:09 +00:00
Seth Nickell
2e8a06bb8f 2004-05-29 Seth Nickell <seth@gnome.org>
* python/dbus.py:

	Add ObjectTree class which allows implementation
	of trees of "virtual" objects. Basically the python
	wrapper for "register_fallback".

	* python/examples/Makefile.am
	* python/examples/gconf-proxy-client.py:
	* python/examples/gconf-proxy-service.py:

	Implement a simple GConf proxy service that supports
	get/set on string and int GConf keys using the ObjectTree.
2004-05-30 02:26:48 +00:00
Seth Nickell
5d6113aaa0 2004-05-29 Seth Nickell <seth@gnome.org>
* python/dbus.py:
	* python/examples/example-client.py:
	* python/examples/example-service.py:
	* python/examples/list-system-services.py:

	Add SessionBus, SystemBus and ActivationBus classes
	so you don't need to know the special little BUS_TYPE
	flag.
2004-05-29 22:37:13 +00:00
Seth Nickell
841bf8a026 * python/examples/Makefile.am:
Forget to add Makefile.am. Do not pass go.
2004-05-28 18:43:55 +00:00
Seth Nickell
f33553eae3 * configure.in:
* python/Makefile.am:

	Include the example python apps in the tarball.

	* python/examples/list-system-services.py

	Add a python new example that fetches the list of services
	from the system bus.
2004-05-28 02:52:23 +00:00
Seth Nickell
9e262d565e 2004-05-27 Seth Nickell <seth@gnome.org>
* python/dbus.py:
	* python/dbus_bindings.pyx.in:

	Fix failure to notify that a signal was not handled,
	resulted in hung functions.
2004-05-28 02:16:11 +00:00
John (J5) Palmieri
c718526cbe * Fixed python bindings by defining all need parameter and variable types 2004-05-10 18:16:29 +00:00
Michael Meeks
d7a044a138 hush. 2004-03-29 12:50:45 +00:00
Havoc Pennington
4fd4d52dd6 2004-03-19 Havoc Pennington <hp@redhat.com>
* NEWS: 0.21 updates

	* configure.in: 0.21

	* doc/Makefile.am: add all XMLTO usage to DBUS_XML_DOCS_ENABLED

	* python/Makefile.am: change to avoid dist of dbus_bindings.c so
	you don't need pyrex to make dist

	* qt/Makefile.am (libdbus_qt_1_la_SOURCES): add integrator.h to
	sources; run moc
2004-03-19 22:36:31 +00:00
David Zeuthen
3e77824dff 2003-12-01 David Zeuthen <david@fubar.dk>
* python/dbus.py: Add the actual message when calling the reciever
	of a signal such that parameters can be inspected. Add the method
	remove_signal_receiver
2003-12-01 20:49:53 +00:00
David Zeuthen
ddc560a9aa 2003-10-28 David Zeuthen <david@fubar.dk>
* python/dbus_bindings.pyx.in: add get_dict to handle dictionaries
        return types. Fixup TYPE_* to reflect changes in dbus/dbus-protocol.h
2003-10-29 00:06:07 +00:00
David Zeuthen
9b9dd4b80e 2003-10-14 David Zeuthen <david@fubar.dk>
* python/dbus_bindings.pyx.in (MessageIter.get): fixed typo in
        argtype to arg_type when raising unknown arg type exception.
        Changed type list to reflect the changes in dbus-protocol.h so
        the bindings actually work.
2003-10-15 21:25:13 +00:00
Seth Nickell
9f2d0d86bb Fix makefile.am 2003-10-15 11:56:12 +00:00
Seth Nickell
bfb5de511c 2003-10-13 Seth Nickell <seth@gnome.org>
* python/Makefile.am:

	Pass "make distcheck": remove a couple files from DIST_FILES
	that weren't included in the final version.
2003-10-13 23:07:34 +00:00
Havoc Pennington
0469cdb2c7 add examples 2003-09-30 02:41:13 +00:00
Havoc Pennington
42019c9625 forgot to add files... 2003-09-30 02:40:49 +00:00