-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port to Python 3 #14
Port to Python 3 #14
Conversation
@@ -104,6 +104,7 @@ def is_empty(self): | |||
return False | |||
return True | |||
|
|||
|
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
I reviewed the code. Was able to built the package locally. What is the next step to take @quozl @pro-panda please guide. |
Test it. Remove the Python 2 installation of sugar-datastore, install from the Python 3 source, then start Sugar. D-Bus should start the service. Exercise the Journal. This is what "test running the datastore" means in the tracking issue. |
I used sugar-toolkit-gtk3 @ head , sugar @ head to test the datastore, the datastore.logs file is not formed, and journal do not starts. Might be possible I am not setting up the testing environment correctly. Thanks! |
Datastore is a D-Bus service. Just run it under a debugger?
|
Thanks. I am working on using What exactly do we have to compare and watch through the debugger to ensure the correct working of sugar-datastore? |
I'm not sure about better; it depends on what is needed, and the stack
is very deep.
I use gdb if there is an obvious terminating signal, such as a
segmentation fault, because that gives back control and you can make a
dump, backtrace or examine variables. I use strace if I'm evaluating
which operating system calls (syscalls) are make. I use dbus-monitor
to trace D-Bus API calls. Others have used pdb for Python, ltrace for
library calls, and kernel call tracing for syscalls.
As baseline comparison, use the Python 2 build of the datastore. It
should be nearly functionally identical.
For example, dbus-monitor output resulting from successful startup of
/usr/bin/datastore-service (Python 2) looks like this;
$ dbus-monitor --session
method call time=1562360626.708318 sender=:1.3092 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1562360626.708345 sender=org.freedesktop.DBus -> destination=:1.3092 serial=1 reply_serial=1
string ":1.3092"
signal time=1562360626.708359 sender=org.freedesktop.DBus -> destination=(null destination) serial=4049 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.3092"
string ""
string ":1.3092"
signal time=1562360626.708381 sender=org.freedesktop.DBus -> destination=:1.3092 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string ":1.3092"
method call time=1562360626.708635 sender=:1.3092 -> destination=org.freedesktop.DBus serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RequestName
string "org.laptop.sugar.DataStore"
uint32 0
signal time=1562360626.708664 sender=org.freedesktop.DBus -> destination=(null destination) serial=4050 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string "org.laptop.sugar.DataStore"
string ""
string ":1.3092"
signal time=1562360626.708686 sender=org.freedesktop.DBus -> destination=:1.3092 serial=3 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string "org.laptop.sugar.DataStore"
method return time=1562360626.708698 sender=org.freedesktop.DBus -> destination=:1.3092 serial=4 reply_serial=2
uint32 1
method call time=1562360626.725465 sender=:1.3092 -> destination=org.freedesktop.DBus serial=3 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
string "type='signal',interface='org.freedesktop.DBus.Local',member='Disconnected'"
method return time=1562360626.725521 sender=org.freedesktop.DBus -> destination=:1.3092 serial=5 reply_serial=3
Above shows successful acquisition of the name
org.laptop.sugar.DataStore and the datastore program is running, ready
to respond to requests. When the program is stopped with ctrl+c, the
name is released;
signal time=1562360741.364195 sender=:1.3092 -> destination=(null destination) serial=4 path=/org/laptop/sugar/DataStore; interface=org.laptop.sugar.DataStore; member=Stopped
signal time=1562360741.376864 sender=org.freedesktop.DBus -> destination=:1.3092 serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string "org.laptop.sugar.DataStore"
signal time=1562360741.376949 sender=org.freedesktop.DBus -> destination=(null destination) serial=4051 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string "org.laptop.sugar.DataStore"
string ":1.3092"
string ""
signal time=1562360741.377054 sender=org.freedesktop.DBus -> destination=:1.3092 serial=6 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string ":1.3092"
signal time=1562360741.377096 sender=org.freedesktop.DBus -> destination=(null destination) serial=4052 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.3092"
string ":1.3092"
string ""
Datastore can be tested in isolation without Sugar. See
/usr/bin/copy-to-journal and /usr/bin/copy-from-journal
|
Aniket Mathur wrote:
Thanks, observed the output of the dbus monitor for python3 branch
looks similar to python2.
Interesting, thanks. It would be odd that datastore.log is not created and
the Journal does not start, yet the same D-Bus messages are seen. You
will have to diagnose further; for example;
- identify the source code that creates datastore.log file, and verify
it functions correctly after porting,
- examine the results of the datastore D-Bus API calls made by the
Journal.
|
Tested 774d05f using Write started from home view. Datastore reports a transaction failure;
My guess is the port needs more work. |
https://dbus.freedesktop.org/doc/dbus-python/PY3PORT.html is a guide for porting D-Bus applications to Python 3. |
Thanks. I am able to reproduce it, my configuration~
Working to fix it. |
Thanks! |
Replaced by #15 |
Rebased from #8.
Review invited from @tonadev and @chimosky.
Merge is planned once all critical components are ready.