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 TelepathyGLib, collabwrapper, Gio.Settings #14

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
import os
import shutil
import time
from ConfigParser import ConfigParser
from configparser import ConfigParser
import json
from gettext import gettext as _

import gi
gi.require_version('Gtk', '3.0')
gi.require_version('GConf', '2.0')
gi.require_version('Vte', '2.91')
gi.require_version('Wnck', '3.0')

Expand All @@ -42,10 +41,10 @@
from sugar3 import profile
from sugar3.datastore import datastore

import telepathy
from gi.repository import TelepathyGLib
import dbus
from dbus.service import signal
from dbus.gobject_service import ExportedGObject
from dbus.gi_service import ExportedGObject
from sugar3.presence import presenceservice
from sugar3.graphics.objectchooser import ObjectChooser

Expand Down Expand Up @@ -734,11 +733,11 @@ def _shared_cb(self, activity):
self.tubes_chan = self.shared_activity.telepathy_tubes_chan
self.text_chan = self.shared_activity.telepathy_text_chan

self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].connect_to_signal(
self.tubes_chan[TelepathyGLib.IFACE_CHANNEL_TYPE_TUBES].connect_to_signal(
'NewTube', self._new_tube_cb)

_logger.debug('This is my activity: making a tube...')
self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].OfferDBusTube(
self.tubes_chan[TelepathyGLib.IFACE_CHANNEL_TYPE_TUBES].OfferDBusTube(
SERVICE, {})

self.sharing = True
Expand All @@ -762,11 +761,11 @@ def _joined_cb(self, activity):
self.tubes_chan = self.shared_activity.telepathy_tubes_chan
self.text_chan = self.shared_activity.telepathy_text_chan

self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].connect_to_signal(
self.tubes_chan[TelepathyGLib.IFACE_CHANNEL_TYPE_TUBES].connect_to_signal(
'NewTube', self._new_tube_cb)

_logger.debug('I am joining an activity: waiting for a tube...')
self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].ListTubes(
self.tubes_chan[TelepathyGLib.IFACE_CHANNEL_TYPE_TUBES].ListTubes(
reply_handler=self._list_tubes_reply_cb,
error_handler=self._list_tubes_error_cb)

Expand All @@ -787,10 +786,10 @@ def _new_tube_cb(self, id, initiator, type, service, params, state):
'params=%r state=%d', id, initiator, type, service,
params, state)

if (type == telepathy.TUBE_TYPE_DBUS and service == SERVICE):
if state == telepathy.TUBE_STATE_LOCAL_PENDING:
if (type == TelepathyGLib.IFACE_CHANNEL_TYPE_DBUS_TUBE and service == SERVICE):
if state == TelepathyGLib.TubeState.LOCAL_PENDING:
self.tubes_chan[
telepathy.CHANNEL_TYPE_TUBES].AcceptDBusTube(id)
TelepathyGLib.IFACE_CHANNEL_TYPE_TUBES].AcceptDBusTube(id)

self.collab = CollabWrapper(self)
self.collab.message.connect(self.event_received_cb)
Expand Down
4 changes: 2 additions & 2 deletions activity/activity.info
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[Activity]
name = Reflect
exec = sugar-activity activity.ReflectActivity
exec = sugar-activity3 activity.ReflectActivity
bundle_id = org.sugarlabs.Reflect
icon = reflect
activity_version = 1.0
show_launcher = yes
license = GPLv3
single_instance = yes
summary = a tool for reflecting on your work
repository = https://github.com/walterbender/reflect
repository = https://github.com/sugarlabs/reflect.git
2 changes: 1 addition & 1 deletion reflectwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def _choose_activity(self):
bundle_icons = utils.get_bundle_icons()
x = 0
y = 1
for bundle_id in bundle_icons.keys():
for bundle_id in list(bundle_icons.keys()):
Copy link
Member

@srevinsaju srevinsaju Apr 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to remove list()

icon_path = bundle_icons[bundle_id]
if icon_path is None:
continue
Expand Down
Loading