Commit graph

1165 commits

Author SHA1 Message Date
Ross Burton
4e2b0d94ec Add a NoReply annotation 2005-10-25 08:54:57 +00:00
Robert McQueen
ef47e01f75 2005-10-24 Robert McQueen <robot101@debian.org>
* python/dbus_bindings.pyx (String, MessageIter): make D-Bus strings
    derive from unicode instead of str, and encode/decode UTF-8 when
    marshalling/unmarshalling bus messages

    * python/introspect_parser.py: encode introspection data as UTF-8
    before passing the buffer into libxml2

    * test/python/test-client.py: add unicode test strings

    * test/data/valid-service-files/.cvsignore, test/python/.cvsignore:
    ignore generated python test files
2005-10-24 18:29:50 +00:00
Harald Fernengel
396b9c9e70 applied patch by Timo Hoenig <thoenig at suse de> for better Qt 3 detection 2005-10-20 14:56:24 +00:00
John (J5) Palmieri
2b9417707a * glib/dbus-gvalue-utils.c (hash_free_from_gtype): handle gdouble
and G_TYPE_VALUE_ARRAY (DBUS_TYPE_STRUCT)
(gvalue_from_hash_value, hash_value_from_gvalue): handle gdouble

* glib/dbus-gvalue.c (dbus_gvalue_to_signature): add missing
DBUS_STRUCT_BEGIN_CHAR and DBUS_STRUCT_END_CHAR charaters
when constructing struct signatures

* python/_dbus.py (Bus): handle private connections using the
private keyword in the constructor. defaults to private=False
(Bus::close): new method to close a connection to the bus

* python/dbus_bindings.pyx (Connection::close): renamed method
was previously called disconnect
(bus_get): now supports getting a private connection

* python/proxies.py (ProxyMethod::__call__): check if ignore_reply
keyword is set to True.  if it is, execute the method without waiting
for a reply
(ProxyObject::_introspect_execute_queue): new method for executing
all the pending methods that were waiting for the introspect to
finish.  this is called when introspect either succeeds or fails
(ProxyObject::_introspect_error_handler): call queued methods
2005-10-18 04:38:05 +00:00
John (J5) Palmieri
0ae9f138ad * python/dbus_bindings.pyx (MessageIter::append_strict): check for
STRUCT_BEGIN not TYPE_STRUCT in indicate we are marshalling a struct

* python/service.py (Object::_message_cb): handle exceptions correctly
  by sending them over the wire to the calling app.  This makes sure
  the client returns immediately instead of waiting the 15 seconds to
  timeout.

* test/python/test-client.py (TestDBusBindings::testBenchmarkIntrospect):
  Add a test to benchmark how long it takes to introspect a service and
  call a method which returns a large element (pretty fast)

* test/python/test-service.py (TestObject::GetComplexArray): new test
  method which pushes a lot of data
2005-10-14 21:44:00 +00:00
John (J5) Palmieri
7667a2ae4a * python/service.py(ObjectType::_reflect_on_signal, _reflect_on_method):
reclaim memory outside of the loop and use del istead of just setting
the key to None
2005-10-13 23:34:12 +00:00
John (J5) Palmieri
9cbcbb20ed * python/service.py (ObjectType::_reflect_on_signal): Always close
signal tag even when there are no arguments
2005-10-13 23:26:00 +00:00
John (J5) Palmieri
0e466b00e4 * (configure.in) Set mono, mono-docs and Qt3 to default
to no instead of auto when building.  These bindings do not
   have full time maintainers and will not be supported for the
   1.0 release.
2005-10-13 22:53:54 +00:00
John (J5) Palmieri
8d2fe98783 patches from Michael Krivoruchko <misha at sun.com>:
* dbus/dbus-connection.c (_dbus_connection_queue_received_message_link,
_dbus_connection_message_sent,
_dbus_connection_send_preallocated_unlocked_no_update,
_dbus_connection_pop_message_link_unlocked): handle the case when path
is NULL when calling _dbus_verbose

* configure.in: check for functions getpeerucred and getpeereid

* dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): provides
support of auth EXTERNAL on Solaris 10+ (getpeerucred), FreeBSD 4.6+,
OpenBSD 3.0+ and FreeBSD 5.0+ as well as MacOSX 10.2+ (getpeereid).
Patch was only tested on Solaris 10 x86 so it might be issues
with other platforms (i.e. BSDs and MacOSX)
2005-10-12 22:15:37 +00:00
John (J5) Palmieri
f9e96c54cd * actualy add the introspection parser to CVS :-) 2005-10-06 04:43:52 +00:00
John (J5) Palmieri
86b9f6ad4a * glib/dbus-gvalue.c (marshal_variant): call _dbus_gvalue_marshal
instead of marshal basic so we can handle recursive types in a variant

* test/glib/test-dbus-glib.c: Add test for marshaling recurive types
  in variants

* test/glib/test-service-glib.c, test-service-glib.xml
  (my_object_echo_variant [EchoVariant],
  my_object_process_variant_of_array_of_ints123
  [ProcessVariantOfArrayOfInts123]):
  Add two test methods

* python/introspect_parser.py: New module for parsing introspect
  data.

* python/dbus_bindings.pyx:
  (various places): when throwing errors fix to use errormsg instead
  of message local variable because Pyrex can get confused with other
  message variables (initial patch by Robert McQueen
  <robert.mcqueen at collabora.co.uk>)
  (MessageIter::parse_signature_block): new method for getting the next
  block in a signiture.
  (MessageIter::append_strict): new method for appending values strictly
  using the passed in signature instead of guessing at the type
  (MessageItter:: append_dict, append_struct, append_array): use
  signatures to marshal children if the signature is available

* python/exceptions.py (IntrospectionParserException): new exception

* python/proxies.py (ProxyMethod::__call__): Marshal args with
  introspected signatures if available, else we fall back to the
  old way of doing things.
  (ProxyObject::_introspect_reply_handler ): parse introspection data

* python/service.py (ObjectType::_reflect_on_method): Properly
  terminate <method> if there are no args in the reflection data

* test/python/test-client.py: add tests for talking with the GLib
  test server.  This gives us better coverage for introspection since
  python to python will always generate arguments as variants.  It also
  allows us to test the robustness of the GLib bindings and interlanguage
  communications.
2005-10-05 20:43:46 +00:00
John (J5) Palmieri
66e1cb9e68 * bus/driver.c (bus_driver_handle_introspect): Add signals
to the introspect data. (patch from Daniel P. Berrange
  <dan at berrange.com>)

* bus/dispatch.c (check_existent_ping): Add testcase for Ping

* dbus/dbus-connection.c (_dbus_connection_peer_filter,
  _dbus_connection_run_builtin_filters): Changed these to
  be unlock_no_update functions and call
  _dbus_connection_send_unlocked_no_update instead of
  dbus_connection_send to avoid locking errors.

* doc/TODO: Removed the make Ping test TODO
2005-10-03 19:55:56 +00:00
Harald Fernengel
9a821f4c13 ignore me 2005-09-30 15:21:44 +00:00
Harald Fernengel
57b6fd3894 bring Qt3 library back. Some apps that are not in the KDE trunk are using it. 2005-09-30 15:20:08 +00:00
Harald Fernengel
fe9f471950 compile out of the box 2005-09-30 15:05:33 +00:00
Harald Fernengel
7183318f69 revert the parts that were accidently comitted. Thanks to Ross Burton for spotting it. 2005-09-30 13:55:55 +00:00
John (J5) Palmieri
68d1880e56 * glib/dbus-glib-tool.c: removed extra comma at the end of the
DBusBindingOutputMode enum which was causing a warning.
  #include <time.h> so using time_t is explicitly defined
2005-09-26 22:26:38 +00:00
John (J5) Palmieri
c1974650ee * dbus/Python.pyx: Fixed memory leaks when throwing errors.
We now copy the message from a DBusError and then free
  the error object befor throwing the error
2005-09-26 22:12:17 +00:00
John (J5) Palmieri
9ad0aafe37 * Integrate patches from Lennart Poettering <mzsqb at 0pointer.de>:
- dbus/dbus-bus.c
(internal_bus_get): new method that take over the heavy lifting
of dbus_bus_get and adds the ability to get a private connection
to the bus
(dbus_bus_get): wrapper to internal_bus_get that provides the same
interface as in previous versions
(dbus_bus_get_private): new method that is a wrapper to
internal_bus_get to get a private connection to the bus

- dbus/dbus-bus.h
(dbus_bus_get_private): add as a public libdbus interface

- dbus-1.pc.in: output system_bus_default_address and
sysconfdir variables so apps can use them when compiling
2005-09-26 18:49:53 +00:00
Harald Fernengel
cd883ae043 adding an autotest and "dbus-ify" the build process and include scheme 2005-09-23 16:24:36 +00:00
Harald Fernengel
ac2de419da new Qt bindings 2005-09-23 14:25:05 +00:00
Harald Fernengel
cc2119a0a1 whoops... 2005-09-23 13:28:23 +00:00
Harald Fernengel
d0d0d4afe9 With the permission of the original authors, removing the non-working and hopelessly unmaintained old Qt D-BUS bindings and adding the ones from KDE's SVN. 2005-09-23 13:08:26 +00:00
Waldo Bastian
8b34c2c538 * dbus/dbus-marshal-validate.c, doc/dbus-specification.xml,
test/Makefile.am, test/test-names.c: allow hyphens in bus names.
2005-09-12 08:19:33 +00:00
Mark McLoughlin
5e8110d79a 2005-09-11 Mark McLoughlin <mark@skynet.ie>
* test/data/auth/fallback.auth-script: we don't
	retry the EXTERNAL method when we know its going
	to fail anymore.

2005-09-11  Mark McLoughlin  <mark@skynet.ie>

	* dbus/dbus-connection-internal.h: rename
	(add|remove|toggle)_(watch|timeout) to unlocked()

	* dbus/dbus-connection.c: ditto.

	* dbus/dbus-timeout.c, dbus/dbus-transport-unix.c:
	Update some callers for the renaming.

2005-09-10  Mark McLoughlin  <mark@skynet.ie>

	* dbus/dbus-auth.c: (record_mechanisms): don't
	retry the first auth mechanism because we know
	we're just going to get rejected again.

	* dbus/dbus-keyring.c: (_dbus_keyring_reload):
	Fix thinko ... and what a nasty little bugger to
	track down you were ...

	* dbus/dbus-connection.c:
	(_dbus_connection_add_watch),
	(_dbus_connection_remove_watch): add note about
	these needing the connection to be locked.
	(_dbus_connection_get_dispatch_status_unlocked):
	set status to DATA_REMAINS when we queue the
	disconnected message.

	* bus/dispatch.c:
	(bus_dispatch): fix warning.
	(check_existent_service_no_auto_start):
	Expect ChildSignaled error too.
	(check_existent_hello_from_self): fix another
	couple of warnings.
2005-09-11 10:02:47 +00:00
Joe Shaw
24c6ddc1a4 2005-09-08 Joe Shaw <joeshaw@novell.com>
Patches from James Willcox <snorp@snorp.net>

	* mono/Makefile.am: Add Int16.cs and UInt16.cs

	* mono/DBusType/Array.cs: Handle multidimensional arrays, and
	support array "out" parameters.

	* mono/DBusType/Int16.cs, mono/DBusType/UInt16.cs: New files,
	for 16-bit int support.
2005-09-08 18:54:42 +00:00
John (J5) Palmieri
76faf9aa9c - update to next release version 2005-09-06 22:42:54 +00:00
John (J5) Palmieri
bc564a69c2 * Released 0.50
* Patch from Steve Grubb:
- bus/activation.c (bus_activation_service_reload_test): clean up
some indentation
- dbus/dbus-keyring.c (_dbus_keyring_reload): fix conditional
- dbus/dbus-message-factory.c (generate_special): fix a couple of
buffer overflows in the test suite.  This is non critical because
it can not be exploited and this code is only run when doing a
make check.

* Patch from Yaakov Selkowitz: Build fixes for Cygwin
- configure.in: Don't check and link against kdecore, only qt headers
- dbus/Makefile.am: Add -no-undefined to libdbus_1_la_LDFLAGS
- gcj/org/freedesktop/dbus/Makefile.am:
add libdbus_gcj_1_la_LDFLAGS = -no-undefined
- glib/Makefile.am: Add -no-undefined to libdbus_glib_1_la_LDFLAGS
and $(DBUS_GLIB_LIBS) to dbus_binding_tool_LDADD
- qt/Makefile.am: Add -no-undefined to libdbus_qt_1_la_LDFLAGS
- tools/Makefile.am: Add platform extentions to binaries
(i.e. .exe on windows)

* configure.in:
- Make it so if no suitable version of python is found we only
disable building python instead of exiting the configure script
- Require version 2.4 of glib for glib bindings
- Up version to 0.50

* python/__init__.py: Sync version with libdbus to (0,50,0)
2005-09-06 22:38:54 +00:00
Olivier Andrieu
bbc0cee637 2005-09-05 Olivier Andrieu <oliv__a@users.sourceforge.net>
* dbus/dbus-object-tree.c (find_subtree_recurse):
	a couple of optimizations (bug #710):
	- do a binary search in the tree
	- insert a new child at the right place directly, no need for
	  qsort anymore
	- do the "double alloc" thing when allocating children
2005-09-05 19:37:19 +00:00
John (J5) Palmieri
236c7b7384 * python/Makefile.am: Break on pyrexc errors instead of ignoring them
* python/dbus_bindings.pyx: Memory management foo
(global): remove hacky _user_data_references global list
(GIL_safe_cunregister_function_handler): userdata now stuffed into
tuples. Unref user_data
(GIL_safe_cmessage_function_handler): userdata now stuffed into tuples
(Connection::__del__): Remove and replace with __dealloc__ method
(Connection::add_filter): Stuff user_data into a tuple.  Use Py_INCREF
to keep tuple from being deallocated instead of the global var hack
(Connection::register_object_path): Stuff user_data into a tuple.
Use Py_INCREF to keep tuple from being deallocated instead of the
global var hack
(Connection::register_fallback): Stuff user_data into a tuple.
Use Py_INCREF to keep tuple from being deallocated instead of the
global var hack
(GIL_safe_pending_call_notification): Don't unref the message
because it gets unreffed when going out of scope.  Py_XDECREF
the user_data
(PendingCall::__del__): Remove and replace with __dealloc__ method
(PendingCall::set_notify): ref the pending call because we will
need it to stick around for when the notify callback gets called
(Message::__del__): Remove and replace with __dealloc__ method

* python/dbus_glib_bindings.pyx (init_gthreads): Changed to
gthreads_init to match up with the dbus call

* python/glib.py (init_threads): Changed to threads_init to match
up with gobject.threads_init().  init_threads is kept for backwards
compat but will most likely be deprecated in the future

* test/python/test-client.py:
- revamp to use Python's unittest functionality
- add async call tests
- setup threads in glib and dbus so we make sure locks are working
2005-09-01 01:22:06 +00:00
John (J5) Palmieri
1ea5d42dc0 * python/dbus_bindings.pyx
(_pending_call_notification, cunregister_function_handler,
cmessage_function_handler): All callback functions have been rearranged
to workaround a bug in Pyrex when working with the GIL which is Python's
global lock when dealing with threads.  They have been split into
a wrapper function (which assumes the name of the old function) and
a _GIL_safe_<function name> function which contains the functionality
of the old function.  This ensures that Pyrex does not write code
the lock is released.
2005-08-31 02:18:43 +00:00
John (J5) Palmieri
46a1e648fe * python/dbus_bindings.pyx (_pending_call_notification): Obtain the
GIL global lock when calling back into Python
2005-08-30 15:21:04 +00:00
John (J5) Palmieri
b701a78aca * Release 0.36.2
* Add Havoc's patch that never got applied to HEAD (Bug #2436):

* bus/policy.c (bus_policy_allow_user): change default "user is
allowed" to be "user has same uid as the bus itself"; any
allow/deny rules will override.

* bus/session.conf.in: don't allow all users, since now by default
the user that ran the bus can connect.
2005-08-29 20:19:19 +00:00
Harald Fernengel
5625232196 fixed two typos in API docs 2005-08-26 17:34:59 +00:00
Colin Walters
b2d215da38 2005-08-26 Colin Walters <walters@verbum.org>
* tools/dbus-print-message.c (print_message): Flush stdout
	after printing a message, so that redirecting to a file, then
	hitting Ctrl-C works.
2005-08-26 15:41:31 +00:00
John (J5) Palmieri
18170dd986 * s/Message(_create=0)/EmptyMessage everywhere else
* test/python/test-{server|client}.py: add the python/.libs directory
  to the lookup path so dbus_bindings and dbus_glib_bindings don't
  get picked up from the system
2005-08-26 04:23:33 +00:00
John (J5) Palmieri
64e468d21c * python/dbus_bindings.pyx: Tracked down a major memleak and fixed it
(EmptyMessage): new class that subclasses Message.  This is a workaround
 to a Pyrex bug that fails to call __del__ when the Message object goes out
 of scope.  For some reason subclassing Message fixes this bug
 (Bus::send_with_reply_and_block): use EmptyMessage instead of Message
2005-08-26 03:09:59 +00:00
Colin Walters
c2ff73e5c6 2005-08-25 Colin Walters <walters@verbum.org>
* glib/dbus-gproxy.c (dbus_g_proxy_call): Doc update, thanks
	to Ryan Lortie for the suggestion.
2005-08-26 02:00:37 +00:00
Havoc Pennington
51c609c340 links to some pending tasks 2005-08-25 03:15:46 +00:00
John (J5) Palmieri
7aa6075445 * forgot to add the service file 2005-08-25 00:27:35 +00:00
John (J5) Palmieri
781b0cdef9 * test/python: Add python regression test
* configure.in: Add test/python/Makefile

* test/Makefile.am: Add the python directory to SUBDIRS
2005-08-25 00:20:41 +00:00
John (J5) Palmieri
329ac511e9 - Merged changed from the DBUS_0_36_1 bugfix branch 2005-08-24 19:58:32 +00:00
John (J5) Palmieri
4fef8ed39c - Bumped version 2005-08-23 20:11:39 +00:00
John (J5) Palmieri
f94c475bfc * Release 0.36 2005-08-23 20:07:30 +00:00
Colin Walters
772cd2a510 *** empty log message *** 2005-08-23 19:48:42 +00:00
Colin Walters
f837e62f50 2005-08-23 Colin Walters <walters@verbum.org>
* test/glib/Makefile.am (test_profile_LDADD): Don't multiply-define
	EXTRA_DIST.
2005-08-23 19:48:30 +00:00
John (J5) Palmieri
54988532f4 * python/dbus_glib_bindings.pyx: reorder imports and c definitions
to fix some wranings. We now use dbus_bindings.DBusConnection instead
of defining DBusConnection ourselves.
2005-08-23 17:43:59 +00:00
John (J5) Palmieri
c7be77449d * python/dbus.pth: New path file to fix up problems when installing
c libraries to lib64 and python files to lib.

	* python/Makefile.am: install dbus.pth in the correct spot
2005-08-18 20:57:28 +00:00
John (J5) Palmieri
8d1e7dfeb9 * ChangeLog: clean up my last entry a bit
* doc/introspect.xsl: New stylesheet for converting introspection data
	into browser renderable xhtml. Contributed by Lennart Poettering.

	* doc/introspect.dtd: Fixups in the introspect format from Lennart
	Poettering.

	* doc/dbus-tutorial.xml:
	- Add Colin Walter to the Authors section for authoring the GLib
	section
	- Add descriptions of the new signature and type functionality
	in the Python complex type mapping section
	- Add a sidenote on the new args matching functionality in
	the Python bindings
	- Fixed up some of the examples to use the gobject.MainLoop
	instead of gtk.main

	* python/_dbus.py:
	(Bus::_create_args_dict): New. Converts a hash of arg matches
	to a more useable format
	(Bus::add_signal_receiver): add a **keywords parameter for catching
	arg match parameters
	(Bus::remove_signal_receiver): add a **keywords parameter for catching
	arg match parameters

	* python/matchrules.py:
	(MatchTree::exec_matches): Check for arg matches
	(SignalMatchRule::add_args_match): New method
	(SignalMatchRule::execute): Added args_list parameter as an optimization
	so we don't have to marshal the args more than once
	(SignalMatchRule::match_args_from_list): New method that checks to see
	if the rule's arg matches match an argument list.  Only arguments
	set in the rule are checked.
	(SignalMatchRule::match_args_from_rule): New method that checks to see
	if the rule's arg matches match another rule's.  All args have to match
	in order for this method to return true.  If either rule has more args
	then it is not a match.
	(SignalMatchRule::is_match): Add args match
	(SignalMatchRule::repr): Add args to the final output if they exist
2005-08-18 04:04:57 +00:00
Ross Burton
e5268be6b3 Unref message and protect against NULL 2005-08-17 17:30:45 +00:00