flake8 fixes (several remain to be fixed)
James Cameron
4 years ago
201 | 201 | from gi.repository import SugarExt |
202 | 202 | |
203 | 203 | |
204 | def _(msg): return gettext.dgettext('sugar-toolkit-gtk3', msg) | |
204 | def _(msg): | |
205 | return gettext.dgettext('sugar-toolkit-gtk3', msg) | |
205 | 206 | |
206 | 207 | |
207 | 208 | SCOPE_PRIVATE = 'private' |
287 | 288 | Initialise an Activity. |
288 | 289 | |
289 | 290 | Args: |
290 | handle (:class:`~sugar3.activity.activityhandle.ActivityHandle`): instance providing the activity id and access to the presence service which *may* provide sharing for this application | |
291 | create_jobject (boolean): DEPRECATED: define if it should create a journal object if we are not resuming. The parameter is ignored, and always will be created a object in the Journal. | |
291 | handle (:class:`~sugar3.activity.activityhandle.ActivityHandle`): | |
292 | instance providing the activity id and access to the presence | |
293 | service which *may* provide sharing for this application | |
294 | ||
295 | create_jobject (boolean): | |
296 | DEPRECATED: define if it should create a journal object if | |
297 | we are not resuming. The parameter is ignored, and always | |
298 | will be created a object in the Journal. | |
292 | 299 | |
293 | 300 | **Signals:** |
294 | * **shared** - the activity has been shared on a network in order that other users may join, | |
295 | * **joined** - the activity has joined with other instances of the activity to create a shared network activity. | |
301 | * **shared** - the activity has been shared on a network in | |
302 | order that other users may join, | |
303 | ||
304 | * **joined** - the activity has joined with other instances of | |
305 | the activity to create a shared network activity. | |
296 | 306 | |
297 | 307 | Side effects: |
298 | 308 | |
299 | * sets the gdk screen DPI setting (resolution) to the Sugar screen resolution. | |
309 | * sets the gdk screen DPI setting (resolution) to the Sugar | |
310 | screen resolution. | |
300 | 311 | |
301 | 312 | * connects our "destroy" message to our _destroy_cb method. |
302 | 313 | |
1096 | 1107 | ''' |
1097 | 1108 | self._invites_queue.append((account_path, contact_id)) |
1098 | 1109 | |
1099 | if (self.shared_activity is None | |
1100 | or not self.shared_activity.props.joined): | |
1110 | if (self.shared_activity is None or | |
1111 | not self.shared_activity.props.joined): | |
1101 | 1112 | self.share(True) |
1102 | 1113 | else: |
1103 | 1114 | self._send_invites() |
1472 | 1483 | in_signature='ss', out_signature='v') |
1473 | 1484 | def Get(self, interface_name, property_name): |
1474 | 1485 | if interface_name in self._prop_getters \ |
1475 | and property_name in self._prop_getters[interface_name]: | |
1486 | and property_name in self._prop_getters[interface_name]: | |
1476 | 1487 | return self._prop_getters[interface_name][property_name]() |
1477 | 1488 | else: |
1478 | 1489 | logging.debug('InvalidArgument') |
1481 | 1492 | in_signature='ssv', out_signature='') |
1482 | 1493 | def Set(self, interface_name, property_name, value): |
1483 | 1494 | if interface_name in self._prop_setters \ |
1484 | and property_name in self._prop_setters[interface_name]: | |
1495 | and property_name in self._prop_setters[interface_name]: | |
1485 | 1496 | self._prop_setters[interface_name][property_name](value) |
1486 | 1497 | else: |
1487 | 1498 | logging.debug('PermissionDenied') |
1496 | 1507 | return r |
1497 | 1508 | else: |
1498 | 1509 | logging.debug('InvalidArgument') |
1510 | ||
1499 | 1511 | |
1500 | 1512 | _session = None |
1501 | 1513 |