Skip to content
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 Python3 and Telepathy #15

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

Saumya-Mishra9129
Copy link
Member

@Saumya-Mishra9129 Saumya-Mishra9129 commented Aug 10, 2020

Following errors have been seen while testing.

  • Fix below mentioned error -
 Traceback (most recent call last):
  File "/usr/share/sugar/activities/reflect/reflectwindow.py", line 713, in _choose_activity
    bundle_icons = utils.get_bundle_icons()
  File "/usr/share/sugar/activities/reflect/utils.py", line 156, in get_bundle_icons
    _find_bundles()
  File "/usr/share/sugar/activities/reflect/utils.py", line 141, in _find_bundles
    cp.readfp(fd)
  File "/usr/lib/python3.7/configparser.py", line 762, in readfp
    self.read_file(fp, source=filename)
  File "/usr/lib/python3.7/configparser.py", line 717, in read_file
    self._read(f, source)
  File "/usr/lib/python3.7/configparser.py", line 1030, in _read
    if line.strip().startswith(prefix):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
  • 1597056988.528961 ERROR root: setting reflection data to []
  • Port to Collabwrapper

In this PR I will try to fix these errors.
I have cherry-picked some of the commits from #13 #14

ayushnawal and others added 12 commits March 10, 2020 18:01
get_int for volume instead of get_string
removed path because it was used by GConf client
- Change logging.error to logging.debug
Change from file to open
ConfigParser's readfp takes a file opened in text mode as argument.
Fixes Error:

 Traceback (most recent call last):
  File "/usr/share/sugar/activities/reflect/reflectwindow.py", line 713, in _choose_activity
    bundle_icons = utils.get_bundle_icons()
  File "/usr/share/sugar/activities/reflect/utils.py", line 156, in get_bundle_icons
    _find_bundles()
  File "/usr/share/sugar/activities/reflect/utils.py", line 141, in _find_bundles
    cp.readfp(fd)
  File "/usr/lib/python3.7/configparser.py", line 762, in readfp
    self.read_file(fp, source=filename)
  File "/usr/lib/python3.7/configparser.py", line 717, in read_file
    self._read(f, source)
  File "/usr/lib/python3.7/configparser.py", line 1030, in _read
    if line.strip().startswith(prefix):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
@Saumya-Mishra9129
Copy link
Member Author

Collaboration doesn't work.
Error in the log -

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 604, in msg_reply_handler
    reply_handler(*message.get_args_list(**get_args_opts))
  File "/usr/share/sugar/activities/reflect/activity.py", line 774, in _list_tubes_reply_cb
    self._new_tube_cb(*tube_info)
  File "/usr/share/sugar/activities/reflect/activity.py", line 789, in _new_tube_cb
    TelepathyGLib.IFACE_CHANNEL_TYPE_TUBES].AcceptDBusTube(id)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.Telepathy.Error.InvalidArgument: Tube is not in the local pending state

I couldn't see what causing the error. Telepathy Port looks correct. @quozl can you review 5c28adb once?

@Saumya-Mishra9129 Saumya-Mishra9129 marked this pull request as ready for review August 11, 2020 20:16
@quozl
Copy link
Contributor

quozl commented Aug 12, 2020

Which log contains the traceback? Sharer or joiner? Never mind.

Comparing activity.py between Reflect activity and CollabWrapper test activity;

Reflect activity CollabWrapper test
dbus is imported dbus is not imported
presenceservice is imported presenceservice is not imported
ExportedGObject is imported ExportedGObject is not imported
data is sent immediately after setup is called, regardless of the state of the tube no data is sent immediately
the presence service instance is accessed to set up joined and shared callbacks at that architecture level instead of relying on CollabWrapper joined and shared callbacks are used at the CollabWrapper architecture level
a ChatTube class inherited from ExportedGObject exists that bypasses CollabWrapper, although it is not called CollabWrapper is used exclusively

I stopped at that point; there's enough going wrong to make further investigation wasteful and liable to lead you to making point of code changes instead of design changes. The code in porting to CollabWrapper should only use CollabWrapper for collaboration. As it stands at the moment it is a frankenstein mixup.

@Saumya-Mishra9129
Copy link
Member Author

Which log contains the traceback? Sharer or joiner? Never mind.

Joiner it was.

Comparing activity.py between Reflect activity and CollabWrapper test activity;

I have tried to fix port to collabwrapper in 187c30b. It still doesn't work, also no error in logs.

@quozl
Copy link
Contributor

quozl commented Aug 12, 2020

You have connected to the activity joined and the CollabWrapper joined signals at the same time, with the same function.

You have connected to the activity shared signal, and in response you have posted a message through CollabWrapper, potentially before CollabWrapper has received the shared signal.

Please re-read the documentation of the CollabWrapper API. You'll find it at the start of the file, and in the CollabWrapper class.

@Saumya-Mishra9129 Saumya-Mishra9129 force-pushed the major branch 2 times, most recently from f50d77e to 411c57d Compare August 13, 2020 19:49
@Saumya-Mishra9129
Copy link
Member Author

Collaboration is still broken .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants