Commits
- Added unittests for bus: 7c6f1ea8ed5e5f68aaa1d55fd1641a0e7a997190
- Changed naming in test_server.py: a3d31f10be8696d9f1ea0203bf5c53b0387a4e9a
- Added unittests connection.py - address: 8c8663100f09b968c8ce678fe87e2315916abfdd
- Added properties and exception - connection.py: 76ce5337daebeefd62c9194f96abad8f7fc1054a
- GError Exception Handling connection.py: f1506f87654dda984772b5c9ad493a5b8414d56a
Things I did
-
Added exceptions in connection.py
The functions in connection.py interact with the low level GDbus API. It is the API at gi.repository.Gio. Using this API, I am making new connection over dbus and invoking remote methods. Exception handling is done using 'GError'. This exception which occurred is sys.exc_info()[1]. lets say : Then the error message is contained in error.message and the domain in error.domain. - Added properties in connection.py
- Added unittests based on py.test modules in connection.py. I covered a small chunk of it. Address and bus_name are done.
Problems I faced
The Exception of DBus (GError) are located at the file /usr/lib/python2.7/dist-packages/gi/_glib/option.py and /usr/lib/python2.7/dist-packages/gi/_glib/__init__.py. However, including in my PYTHON_PATH was a problem. Somehow doing this worked
Some good links I found are:
https://developer.gnome.org/glib/2.34/glib-Error-Reporting.html: Explains the error reporting procedure in C.
What Next..
Writing unittests for connection.py. At present it covers only 5-10% of connection.py
Comments Section
Feel free to comment on the post but keep it clean and on topic.
blog comments powered by Disqus