-
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/bin/sugar-activity-web 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/bin/sugar-activity-web
old
|
new
|
|
17 | 17 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | 18 | # Boston, MA 02111-1307, USA. |
19 | 19 | |
20 | | exec sugar-activity sugar3.activity.webactivity.WebActivity $@ |
| 20 | if [ "$SUGAR_USE_WEBKIT1" == "yes" ]; then |
| 21 | exec sugar-activity sugar3.activity.webkit1.WebActivity $@ |
| 22 | else |
| 23 | exec sugar-activity sugar3.activity.webactivity.WebActivity $@ |
| 24 | fi |
-
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activityfactory.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activityfactory.py
old
|
new
|
|
124 | 124 | if os.path.exists(absolute_path): |
125 | 125 | command[0] = absolute_path |
126 | 126 | |
127 | | logging.debug('launching: %r', command) |
| 127 | logging.debug('launching: %r' % command) |
128 | 128 | |
129 | 129 | return command |
130 | 130 | |
… |
… |
|
265 | 265 | pass |
266 | 266 | |
267 | 267 | def _notify_launch_failure_error_handler(self, err): |
268 | | logging.error('Notify launch failure failed %s', err) |
| 268 | logging.error('Notify launch failure failed %s' % err) |
269 | 269 | |
270 | 270 | def _notify_launch_error_handler(self, err): |
271 | | logging.debug('Notify launch failed %s', err) |
| 271 | logging.debug('Notify launch failed %s' % err) |
272 | 272 | |
273 | 273 | def _activate_reply_handler(self, activated): |
274 | 274 | if not activated: |
275 | 275 | self._create_activity() |
276 | 276 | |
277 | 277 | def _activate_error_handler(self, err): |
278 | | logging.error('Activity activation request failed %s', err) |
| 278 | logging.error('Activity activation request failed %s' % err) |
279 | 279 | |
280 | 280 | def _create_reply_handler(self): |
281 | | logging.debug('Activity created %s (%s).', |
282 | | self._handle.activity_id, self._service_name) |
| 281 | logging.debug('Activity created %s (%s).' % |
| 282 | (self._handle.activity_id, self._service_name)) |
283 | 283 | |
284 | 284 | def _create_error_handler(self, err): |
285 | | logging.error("Couldn't create activity %s (%s): %s", |
286 | | self._handle.activity_id, self._service_name, err) |
| 285 | logging.error("Couldn't create activity %s (%s): %s" % |
| 286 | (self._handle.activity_id, self._service_name, err)) |
287 | 287 | self._shell.NotifyLaunchFailure( |
288 | 288 | self._handle.activity_id, reply_handler=self._no_reply_handler, |
289 | 289 | error_handler=self._notify_launch_failure_error_handler) |
… |
… |
|
296 | 296 | self._launch_activity() |
297 | 297 | |
298 | 298 | def _find_object_error_handler(self, err): |
299 | | logging.error('Datastore find failed %s', err) |
| 299 | logging.error('Datastore find failed %s' % err) |
300 | 300 | self._launch_activity() |
301 | 301 | |
302 | 302 | |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activityfactory.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activityfactory.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activityfactory.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activityfactory.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activityhandle.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activityhandle.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activityhandle.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activityhandle.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activity.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activity.py
old
|
new
|
|
58 | 58 | import cairo |
59 | 59 | import json |
60 | 60 | |
61 | | from gi.repository import GConf |
62 | 61 | from gi.repository import Gtk |
63 | 62 | from gi.repository import Gdk |
64 | 63 | from gi.repository import GObject |
| 64 | from gi.repository import Gio |
65 | 65 | import dbus |
66 | 66 | import dbus.service |
67 | 67 | from dbus import PROPERTIES_IFACE |
… |
… |
|
74 | 74 | from telepathy.constants import CONNECTION_HANDLE_TYPE_ROOM |
75 | 75 | |
76 | 76 | from sugar3 import util |
| 77 | from sugar3 import power |
77 | 78 | from sugar3.presence import presenceservice |
78 | 79 | from sugar3.activity.activityservice import ActivityService |
79 | 80 | from sugar3.graphics import style |
… |
… |
|
81 | 82 | from sugar3.graphics.alert import Alert |
82 | 83 | from sugar3.graphics.icon import Icon |
83 | 84 | from sugar3.datastore import datastore |
| 85 | from sugar3.bundle.activitybundle import ActivityBundle |
84 | 86 | from gi.repository import SugarExt |
85 | 87 | |
86 | 88 | _ = lambda msg: gettext.dgettext('sugar-toolkit-gtk3', msg) |
… |
… |
|
93 | 95 | J_DBUS_PATH = '/org/laptop/Journal' |
94 | 96 | J_DBUS_INTERFACE = 'org.laptop.Journal' |
95 | 97 | |
96 | | POWERD_INHIBIT_DIR = '/var/run/powerd-inhibit-suspend' |
| 98 | N_BUS_NAME = 'org.freedesktop.Notifications' |
| 99 | N_OBJ_PATH = '/org/freedesktop/Notifications' |
| 100 | N_IFACE_NAME = 'org.freedesktop.Notifications' |
97 | 101 | |
98 | 102 | CONN_INTERFACE_ACTIVITY_PROPERTIES = 'org.laptop.Telepathy.ActivityProperties' |
99 | 103 | |
… |
… |
|
161 | 165 | |
162 | 166 | 1. implement an __init__() method for your Activity class. |
163 | 167 | |
164 | | Use your init method to create your own ActivityToolbar which will |
165 | | contain some standard buttons: |
166 | | toolbox = activity.ActivityToolbox(self) |
| 168 | Use your init method to create your own ToolbarBox. |
| 169 | This is the code to make a basic toolbar with the activity |
| 170 | toolbar and a stop button. |
| 171 | from sugar3.graphics.toolbarbox import ToolbarBox |
| 172 | from sugar3.activity.widgets import ActivityToolbarButton |
| 173 | from sugar3.activity.widgets import StopButton |
| 174 | |
| 175 | ... |
| 176 | |
| 177 | toolbar_box = ToolbarBox() |
| 178 | activity_button = ActivityToolbarButton(self) |
| 179 | toolbar_box.toolbar.insert(activity_button, 0) |
| 180 | activity_button.show() |
| 181 | |
| 182 | ... Your toolbars ... |
| 183 | |
| 184 | separator = Gtk.SeparatorToolItem(draw=False) |
| 185 | separator.set_expand(True) |
| 186 | toolbar_box.toolbar.insert(separator, -1) |
| 187 | separator.show() |
| 188 | |
| 189 | stop_button = StopButton(self) |
| 190 | toolbar_box.toolbar.insert(stop_button, -1) |
| 191 | stop_button.show() |
| 192 | |
| 193 | self.set_toolbar_box(toolbar_box) |
| 194 | toolbar_box.show() |
167 | 195 | |
168 | 196 | Add extra Toolbars to your toolbox. |
169 | 197 | |
… |
… |
|
197 | 225 | Usually, you will also need the standard EditToolbar. This is the |
198 | 226 | one which has the standard copy and paste buttons. You need to |
199 | 227 | derive your own EditToolbar class from sugar3.EditToolbar: |
200 | | class EditToolbar(activity.EditToolbar): |
| 228 | from sugar3.activity.widgets import EditToolbar |
| 229 | |
| 230 | class MyEditToolbar(EditToolbar): |
201 | 231 | ... |
202 | 232 | |
203 | 233 | See EditToolbar for the methods you should implement in your class. |
… |
… |
|
377 | 407 | |
378 | 408 | def _initialize_journal_object(self): |
379 | 409 | title = _('%s Activity') % get_bundle_name() |
380 | | client = GConf.Client.get_default() |
381 | | icon_color = client.get_string('/desktop/sugar/user/color') |
| 410 | settings = Gio.Settings('org.sugarlabs.user') |
| 411 | icon_color = settings.get_string('color') |
382 | 412 | |
383 | 413 | jobject = datastore.create() |
384 | 414 | jobject.metadata['title'] = title |
… |
… |
|
406 | 436 | |
407 | 437 | def _set_up_sharing(self, mesh_instance, share_scope): |
408 | 438 | # handle activity share/join |
409 | | logging.debug('*** Act %s, mesh instance %r, scope %s', |
410 | | self._activity_id, mesh_instance, share_scope) |
| 439 | logging.debug('*** Act %s, mesh instance %r, scope %s' % |
| 440 | (self._activity_id, mesh_instance, share_scope)) |
411 | 441 | if mesh_instance is not None: |
412 | 442 | # There's already an instance on the mesh, join it |
413 | | logging.debug('*** Act %s joining existing mesh instance %r', |
414 | | self._activity_id, mesh_instance) |
| 443 | logging.debug('*** Act %s joining existing mesh instance %r' % |
| 444 | (self._activity_id, mesh_instance)) |
415 | 445 | self.shared_activity = mesh_instance |
416 | 446 | self.shared_activity.connect('notify::private', |
417 | 447 | self.__privacy_changed_cb) |
… |
… |
|
423 | 453 | self.__joined_cb(self.shared_activity, True, None) |
424 | 454 | elif share_scope != SCOPE_PRIVATE: |
425 | 455 | logging.debug('*** Act %s no existing mesh instance, but used to ' |
426 | | 'be shared, will share', self._activity_id) |
| 456 | 'be shared, will share' % self._activity_id) |
427 | 457 | # no existing mesh instance, but activity used to be shared, so |
428 | 458 | # restart the share |
429 | 459 | if share_scope == SCOPE_INVITE_ONLY: |
… |
… |
|
431 | 461 | elif share_scope == SCOPE_NEIGHBORHOOD: |
432 | 462 | self.share(private=False) |
433 | 463 | else: |
434 | | logging.debug('Unknown share scope %r', share_scope) |
| 464 | logging.debug('Unknown share scope %r' % share_scope) |
435 | 465 | |
436 | 466 | def __got_channel_cb(self, wait_loop, connection_path, channel_path, |
437 | 467 | handle_type): |
… |
… |
|
546 | 576 | pass |
547 | 577 | |
548 | 578 | def __jobject_error_cb(self, err): |
549 | | logging.debug('Error creating activity datastore object: %s', err) |
| 579 | logging.debug('Error creating activity datastore object: %s' % err) |
550 | 580 | |
551 | 581 | def get_activity_root(self): |
552 | 582 | """ FIXME: Deprecated. This part of the API has been moved |
… |
… |
|
608 | 638 | """ |
609 | 639 | raise NotImplementedError |
610 | 640 | |
| 641 | def notify_user(self, summary, body): |
| 642 | """ |
| 643 | Display a notification with the given summary and body. |
| 644 | The notification will go under the activities icon in the frame. |
| 645 | """ |
| 646 | bundle = ActivityBundle(get_bundle_path()) |
| 647 | icon = bundle.get_icon() |
| 648 | |
| 649 | bus = dbus.SessionBus() |
| 650 | notify_obj = bus.get_object(N_BUS_NAME, N_OBJ_PATH) |
| 651 | notifications = dbus.Interface(notify_obj, N_IFACE_NAME) |
| 652 | |
| 653 | notifications.Notify(self.get_id(), 0, '', summary, body, [], |
| 654 | {'x-sugar-icon-file-name': icon}, -1) |
| 655 | |
611 | 656 | def __save_cb(self): |
612 | 657 | logging.debug('Activity.__save_cb') |
613 | 658 | self._updating_jobject = False |
… |
… |
|
624 | 669 | if self._closing: |
625 | 670 | self._show_keep_failed_dialog() |
626 | 671 | self._closing = False |
627 | | raise RuntimeError('Error saving activity object to datastore: %s', |
| 672 | raise RuntimeError('Error saving activity object to datastore: %s' % |
628 | 673 | err) |
629 | 674 | |
630 | 675 | def _cleanup_jobject(self): |
631 | 676 | if self._jobject: |
632 | 677 | if self._owns_file and os.path.isfile(self._jobject.file_path): |
633 | | logging.debug('_cleanup_jobject: removing %r', |
| 678 | logging.debug('_cleanup_jobject: removing %r' % |
634 | 679 | self._jobject.file_path) |
635 | 680 | os.remove(self._jobject.file_path) |
636 | 681 | self._owns_file = False |
… |
… |
|
717 | 762 | logging.debug('Cannot save, no journal object.') |
718 | 763 | return |
719 | 764 | |
720 | | logging.debug('Activity.save: %r', self._jobject.object_id) |
| 765 | logging.debug('Activity.save: %r' % self._jobject.object_id) |
721 | 766 | |
722 | 767 | if self._updating_jobject: |
723 | 768 | logging.info('Activity.save: still processing a previous request.') |
… |
… |
|
764 | 809 | Activities should not override this method. Instead, like save() do any |
765 | 810 | copy work that needs to be done in write_file() |
766 | 811 | """ |
767 | | logging.debug('Activity.copy: %r', self._jobject.object_id) |
| 812 | logging.debug('Activity.copy: %r' % self._jobject.object_id) |
768 | 813 | self.save() |
769 | 814 | self._jobject.object_id = None |
770 | 815 | |
771 | 816 | def __privacy_changed_cb(self, shared_activity, param_spec): |
772 | | logging.debug('__privacy_changed_cb %r', shared_activity.props.private) |
| 817 | logging.debug('__privacy_changed_cb %r' % |
| 818 | shared_activity.props.private) |
773 | 819 | if shared_activity.props.private: |
774 | 820 | self._jobject.metadata['share-scope'] = SCOPE_INVITE_ONLY |
775 | 821 | else: |
776 | 822 | self._jobject.metadata['share-scope'] = SCOPE_NEIGHBORHOOD |
777 | 823 | |
778 | | def _inhibit_suspend(self): |
779 | | if not os.path.exists(POWERD_INHIBIT_DIR): |
780 | | return |
781 | | |
782 | | path = os.path.join(POWERD_INHIBIT_DIR, str(os.getpid())) |
783 | | try: |
784 | | fd = open(path, 'w') |
785 | | except IOError: |
786 | | logging.error("Inhibit Suspend: Could not create file %s", path) |
787 | | else: |
788 | | fd.close() |
789 | | |
790 | 824 | def __joined_cb(self, activity, success, err): |
791 | 825 | """Callback when join has finished""" |
792 | | logging.debug('Activity.__joined_cb %r', success) |
| 826 | logging.debug('Activity.__joined_cb %r' % success) |
793 | 827 | self.shared_activity.disconnect(self._join_id) |
794 | 828 | self._join_id = None |
795 | 829 | if not success: |
796 | | logging.debug('Failed to join activity: %s', err) |
| 830 | logging.debug('Failed to join activity: %s' % err) |
797 | 831 | return |
798 | 832 | |
799 | | self._inhibit_suspend() |
| 833 | power_manager = power.get_power_manager() |
| 834 | if power_manager.suspend_breaks_collaboration(): |
| 835 | power_manager.inhibit_suspend() |
800 | 836 | |
801 | 837 | self.reveal() |
802 | 838 | self.emit('joined') |
… |
… |
|
817 | 853 | |
818 | 854 | def __share_cb(self, ps, success, activity, err): |
819 | 855 | if not success: |
820 | | logging.debug('Share of activity %s failed: %s.', |
821 | | self._activity_id, err) |
| 856 | logging.debug('Share of activity %s failed: %s.' % |
| 857 | (self._activity_id, err)) |
822 | 858 | return |
823 | 859 | |
824 | | logging.debug('Share of activity %s successful, PS activity is %r.', |
825 | | self._activity_id, activity) |
| 860 | logging.debug('Share of activity %s successful, PS activity is %r.' % |
| 861 | (self._activity_id, activity)) |
826 | 862 | |
827 | 863 | activity.props.name = self._jobject.metadata['title'] |
828 | 864 | |
829 | | self._inhibit_suspend() |
| 865 | power_manager = power.get_power_manager() |
| 866 | if power_manager.suspend_breaks_collaboration(): |
| 867 | power_manager.inhibit_suspend() |
830 | 868 | |
831 | 869 | self.shared_activity = activity |
832 | 870 | self.shared_activity.connect('notify::private', |
… |
… |
|
880 | 918 | raise RuntimeError('Activity %s already shared.' % |
881 | 919 | self._activity_id) |
882 | 920 | verb = private and 'private' or 'public' |
883 | | logging.debug('Requesting %s share of activity %s.', verb, |
884 | | self._activity_id) |
| 921 | logging.debug('Requesting %s share of activity %s.' % (verb, |
| 922 | self._activity_id)) |
885 | 923 | pservice = presenceservice.get_instance() |
886 | 924 | pservice.connect('activity-shared', self.__share_cb) |
887 | 925 | pservice.share_activity(self, private=private) |
… |
… |
|
943 | 981 | # Make the exported object inaccessible |
944 | 982 | dbus.service.Object.remove_from_connection(self._bus) |
945 | 983 | |
946 | | if os.path.exists(POWERD_INHIBIT_DIR): |
947 | | path = os.path.join(POWERD_INHIBIT_DIR, str(os.getpid())) |
948 | | if os.path.exists(path): |
949 | | os.unlink(path) |
950 | | |
951 | 984 | self._session.unregister(self) |
| 985 | power.get_power_manager().shutdown() |
952 | 986 | |
953 | 987 | def close(self, skip_save=False): |
954 | 988 | """Request that the activity be stopped and saved to the Journal |
… |
… |
|
1032 | 1066 | CHANNEL + '.TargetHandleType': CONNECTION_HANDLE_TYPE_CONTACT, |
1033 | 1067 | } |
1034 | 1068 | filter_dict = dbus.Dictionary(filters, signature='sv') |
1035 | | logging.debug('__get_filters_cb %r', dbus.Array([filter_dict], |
1036 | | signature='a{sv}')) |
| 1069 | logging.debug('__get_filters_cb %r' % dbus.Array([filter_dict], |
| 1070 | signature='a{sv}')) |
1037 | 1071 | return dbus.Array([filter_dict], signature='a{sv}') |
1038 | 1072 | |
1039 | 1073 | @dbus.service.method(dbus_interface=CLIENT_HANDLER, |
1040 | 1074 | in_signature='ooa(oa{sv})aota{sv}', out_signature='') |
1041 | 1075 | def HandleChannels(self, account, connection, channels, requests_satisfied, |
1042 | 1076 | user_action_time, handler_info): |
1043 | | logging.debug('HandleChannels\n\t%r\n\t%r\n\t%r\n\t%r\n\t%r\n\t%r', |
1044 | | account, connection, channels, requests_satisfied, |
1045 | | user_action_time, handler_info) |
| 1077 | logging.debug('HandleChannels\n\t%r\n\t%r\n\t%r\n\t%r\n\t%r\n\t%r' % |
| 1078 | (account, connection, channels, requests_satisfied, |
| 1079 | user_action_time, handler_info)) |
1046 | 1080 | try: |
1047 | 1081 | for object_path, properties in channels: |
1048 | 1082 | channel_type = properties[CHANNEL + '.ChannelType'] |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activity.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activity.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activity.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activity.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activityservice.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activityservice.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activityservice.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/activityservice.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/bundlebuilder.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/bundlebuilder.py
old
|
new
|
|
19 | 19 | STABLE. |
20 | 20 | """ |
21 | 21 | |
| 22 | import argparse |
22 | 23 | import operator |
23 | 24 | import os |
24 | 25 | import sys |
25 | 26 | import zipfile |
26 | 27 | import tarfile |
| 28 | import unittest |
27 | 29 | import shutil |
28 | 30 | import subprocess |
29 | 31 | import re |
30 | 32 | import gettext |
31 | | from optparse import OptionParser |
32 | 33 | import logging |
33 | 34 | from fnmatch import fnmatch |
34 | 35 | |
… |
… |
|
64 | 65 | |
65 | 66 | class Config(object): |
66 | 67 | |
67 | | def __init__(self, source_dir): |
| 68 | def __init__(self, source_dir, dist_dir=None, dist_name=None): |
68 | 69 | self.source_dir = source_dir |
69 | 70 | self.build_dir = os.getcwd() |
70 | | self.dist_dir = os.path.join(self.build_dir, 'dist') |
| 71 | self.dist_dir = dist_dir or os.path.join(self.build_dir, 'dist') |
| 72 | self.dist_name = dist_name |
71 | 73 | self.bundle = None |
72 | 74 | self.version = None |
73 | 75 | self.activity_name = None |
… |
… |
|
91 | 93 | self.bundle_name = reduce(operator.add, self.activity_name.split()) |
92 | 94 | self.bundle_root_dir = self.bundle_name + '.activity' |
93 | 95 | self.tar_root_dir = '%s-%s' % (self.bundle_name, self.version) |
94 | | self.xo_name = '%s-%s.xo' % (self.bundle_name, self.version) |
95 | | self.tar_name = '%s-%s.tar.bz2' % (self.bundle_name, self.version) |
| 96 | if self.dist_name: |
| 97 | self.xo_name = '%s.xo' % self.dist_name |
| 98 | self.tar_name = '%s.tar.bz2' % self.dist_name |
| 99 | else: |
| 100 | self.xo_name = '%s-%s.xo' % (self.bundle_name, self.version) |
| 101 | self.tar_name = '%s-%s.tar.bz2' % (self.bundle_name, self.version) |
96 | 102 | |
97 | 103 | |
98 | 104 | class Builder(object): |
… |
… |
|
258 | 264 | self.config.bundle.install_mime_type(self.config.source_dir) |
259 | 265 | |
260 | 266 | |
261 | | def cmd_dev(config, args): |
262 | | """Setup for development""" |
| 267 | def cmd_check(config, options): |
| 268 | """Run tests for the activity""" |
| 269 | |
| 270 | run_unit_test = True |
| 271 | run_integration_test = True |
263 | 272 | |
264 | | if args: |
265 | | print 'Usage: %prog dev' |
266 | | return |
| 273 | if options.choice == 'unit': |
| 274 | run_integration_test = False |
| 275 | if options.choice == 'integration': |
| 276 | run_unit_test = False |
| 277 | |
| 278 | print "Running Tests" |
| 279 | |
| 280 | test_path = os.path.join(config.source_dir, "tests") |
| 281 | |
| 282 | if os.path.isdir(test_path): |
| 283 | unit_test_path = os.path.join(test_path, "unit") |
| 284 | integration_test_path = os.path.join(test_path, "integration") |
| 285 | sys.path.append(config.source_dir) |
| 286 | |
| 287 | # Run Tests |
| 288 | if os.path.isdir(unit_test_path) and run_unit_test: |
| 289 | all_tests = unittest.defaultTestLoader.discover(unit_test_path) |
| 290 | unittest.TextTestRunner(verbosity=options.verbose).run(all_tests) |
| 291 | elif not run_unit_test: |
| 292 | print "Not running unit tests" |
| 293 | else: |
| 294 | print 'No "unit" directory found.' |
| 295 | |
| 296 | if os.path.isdir(integration_test_path) and run_integration_test: |
| 297 | all_tests = unittest.defaultTestLoader.discover( |
| 298 | integration_test_path) |
| 299 | unittest.TextTestRunner(verbosity=options.verbose).run(all_tests) |
| 300 | elif not run_integration_test: |
| 301 | print "Not running integration tests" |
| 302 | else: |
| 303 | print 'No "integration" directory found.' |
| 304 | |
| 305 | print "Finished testing" |
| 306 | else: |
| 307 | print "Error: No tests/ directory" |
| 308 | |
| 309 | |
| 310 | def cmd_dev(config, options): |
| 311 | """Setup for development""" |
267 | 312 | |
268 | 313 | bundle_path = env.get_user_activities_path() |
269 | 314 | if not os.path.isdir(bundle_path): |
… |
… |
|
278 | 323 | print 'ERROR - A bundle with the same name is already installed.' |
279 | 324 | |
280 | 325 | |
281 | | def cmd_dist_xo(config, args): |
| 326 | def cmd_dist_xo(config, options): |
282 | 327 | """Create a xo bundle package""" |
283 | 328 | |
284 | | if args: |
285 | | print 'Usage: %prog dist_xo' |
286 | | return |
287 | | |
288 | 329 | packager = XOPackager(Builder(config)) |
289 | 330 | packager.package() |
290 | 331 | |
291 | 332 | |
292 | | def cmd_fix_manifest(config, args): |
| 333 | def cmd_fix_manifest(config, options): |
293 | 334 | '''Add missing files to the manifest (OBSOLETE)''' |
294 | 335 | |
295 | 336 | print 'WARNING: The fix_manifest command is obsolete.' |
… |
… |
|
297 | 338 | print ' please remove it.' |
298 | 339 | |
299 | 340 | |
300 | | def cmd_dist_source(config, args): |
| 341 | def cmd_dist_source(config, options): |
301 | 342 | """Create a tar source package""" |
302 | 343 | |
303 | | if args: |
304 | | print 'Usage: %prog dist_source' |
305 | | return |
306 | | |
307 | 344 | packager = SourcePackager(config) |
308 | 345 | packager.package() |
309 | 346 | |
310 | 347 | |
311 | | def cmd_install(config, args): |
| 348 | def cmd_install(config, options): |
312 | 349 | """Install the activity in the system""" |
313 | 350 | |
314 | | parser = OptionParser(usage='usage: %prog install [options]') |
315 | | parser.add_option('--prefix', dest='prefix', default=sys.prefix, |
316 | | help='Prefix to install files to') |
317 | | (suboptions, subargs) = parser.parse_args(args) |
318 | | if subargs: |
319 | | parser.print_help() |
320 | | return |
321 | | |
322 | 351 | installer = Installer(Builder(config)) |
323 | | installer.install(suboptions.prefix) |
| 352 | installer.install(options.prefix) |
324 | 353 | |
325 | 354 | |
326 | | def cmd_genpot(config, args): |
| 355 | def cmd_genpot(config, options): |
327 | 356 | """Generate the gettext pot file""" |
328 | 357 | |
329 | | if args: |
330 | | print 'Usage: %prog genpot' |
331 | | return |
332 | | |
333 | 358 | os.chdir(config.source_dir) |
334 | 359 | |
335 | 360 | po_path = os.path.join(config.source_dir, 'po') |
… |
… |
|
371 | 396 | print 'ERROR - xgettext failed with return code %i.' % retcode |
372 | 397 | |
373 | 398 | |
374 | | def cmd_build(config, args): |
| 399 | def cmd_build(config, options): |
375 | 400 | """Build generated files""" |
376 | 401 | |
377 | | if args: |
378 | | print 'Usage: %prog build' |
379 | | return |
380 | | |
381 | 402 | builder = Builder(config) |
382 | 403 | builder.build() |
383 | 404 | |
384 | 405 | |
385 | | def print_commands(): |
386 | | print 'Available commands:\n' |
387 | | |
388 | | for name, func in globals().items(): |
389 | | if name.startswith('cmd_'): |
390 | | print '%-20s %s' % (name.replace('cmd_', ''), func.__doc__) |
391 | | |
392 | | print '\n(Type "./setup.py <command> --help" for help about a ' \ |
393 | | 'particular command\'s options.' |
394 | | |
395 | | |
396 | 406 | def start(): |
397 | | parser = OptionParser(usage='[action] [options]') |
398 | | parser.disable_interspersed_args() |
399 | | (options_, args) = parser.parse_args() |
| 407 | parser = argparse.ArgumentParser(prog='./setup.py') |
| 408 | subparsers = parser.add_subparsers( |
| 409 | dest="command", help="Options for %(prog)s") |
| 410 | |
| 411 | install_parser = subparsers.add_parser( |
| 412 | "install", help="Install the activity in the system") |
| 413 | install_parser.add_argument( |
| 414 | "--prefix", dest="prefix", default=sys.prefix, |
| 415 | help="Path for installing") |
| 416 | |
| 417 | check_parser = subparsers.add_parser( |
| 418 | "check", help="Run tests for the activity") |
| 419 | check_parser.add_argument("choice", nargs='?', |
| 420 | choices=['unit', 'integration'], |
| 421 | help="run unit/integration test") |
| 422 | check_parser.add_argument("--verbosity", "-v", dest="verbose", |
| 423 | type=int, choices=range(0, 3), |
| 424 | default=1, nargs='?', |
| 425 | help="verbosity for the unit tests") |
| 426 | |
| 427 | subparsers.add_parser("dist_xo", help="Create a xo bundle package") |
| 428 | subparsers.add_parser("dist_source", help="Create a tar source package") |
| 429 | subparsers.add_parser("build", help="Build generated files") |
| 430 | subparsers.add_parser( |
| 431 | "fix_manifest", help="Add missing files to the manifest (OBSOLETE)") |
| 432 | subparsers.add_parser("genpot", help="Generate the gettext pot file") |
| 433 | subparsers.add_parser("dev", help="Setup for development") |
| 434 | |
| 435 | options = parser.parse_args() |
400 | 436 | |
401 | 437 | source_dir = os.path.abspath(os.path.dirname(sys.argv[0])) |
402 | 438 | config = Config(source_dir) |
403 | 439 | |
404 | 440 | try: |
405 | | globals()['cmd_' + args[0]](config, args[1:]) |
| 441 | globals()['cmd_' + options.command](config, options) |
406 | 442 | except (KeyError, IndexError): |
407 | | print_commands() |
| 443 | parser.print_help() |
408 | 444 | |
409 | 445 | |
410 | 446 | if __name__ == '__main__': |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/bundlebuilder.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/bundlebuilder.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/bundlebuilder.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/bundlebuilder.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/i18n.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/i18n.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/i18n.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/i18n.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/__init__.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/__init__.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/__init__.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/__init__.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/webactivity.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/webactivity.py
old
|
new
|
|
19 | 19 | import os |
20 | 20 | import logging |
21 | 21 | |
22 | | from gi.repository import GObject |
23 | | GObject.threads_init() |
24 | | |
25 | 22 | from gi.repository import Gdk |
26 | 23 | from gi.repository import Gio |
27 | | from gi.repository import WebKit |
| 24 | from gi.repository import WebKit2 |
28 | 25 | from gi.repository import Gtk |
29 | 26 | from gi.repository import GdkX11 |
30 | 27 | assert GdkX11 |
31 | 28 | |
32 | | import socket |
33 | | from threading import Thread |
34 | | |
35 | | from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer |
36 | | import SocketServer |
37 | | import select |
38 | | import errno |
39 | | import mimetypes |
40 | | |
| 29 | from sugar3.graphics.objectchooser import ObjectChooser |
41 | 30 | from gi.repository import SugarExt |
42 | 31 | from sugar3.activity import activity |
43 | 32 | |
44 | 33 | |
45 | | class LocalRequestHandler(BaseHTTPRequestHandler): |
| 34 | class FilePicker(ObjectChooser): |
| 35 | def __init__(self, parent): |
| 36 | ObjectChooser.__init__(self, parent) |
| 37 | |
| 38 | def run(self): |
| 39 | jobject = None |
| 40 | _file = None |
| 41 | try: |
| 42 | result = ObjectChooser.run(self) |
| 43 | if result == Gtk.ResponseType.ACCEPT: |
| 44 | jobject = self.get_selected_object() |
| 45 | logging.debug('FilePicker.run: %r', jobject) |
| 46 | |
| 47 | if jobject and jobject.file_path: |
| 48 | _file = jobject.file_path |
| 49 | logging.debug('FilePicker.run: file=%r', _file) |
| 50 | finally: |
| 51 | if jobject is not None: |
| 52 | jobject.destroy() |
46 | 53 | |
47 | | #Handler for the GET requests |
48 | | def do_GET(self): |
49 | | new_path = self.server.path + '/' + self.path |
50 | | f = open(new_path) |
51 | | content = f.read() |
52 | | f.close() |
53 | | self.send_response(200) |
54 | | mime, _encding = mimetypes.guess_type(self.path) |
55 | | self.send_header("Content-type", mime) |
56 | | self.end_headers() |
57 | | self.wfile.write(content) |
58 | | return False |
59 | | |
60 | | |
61 | | class LocalHTTPServer(HTTPServer): |
62 | | |
63 | | def __init__(self, server_address, request_handler, path): |
64 | | self.path = path |
65 | | HTTPServer.__init__(self, server_address, request_handler) |
66 | | |
67 | | def serve_forever(self, poll_interval=0.5): |
68 | | """Overridden version of BaseServer.serve_forever that does not fail |
69 | | to work when EINTR is received. |
70 | | """ |
71 | | self._BaseServer__serving = True |
72 | | self._BaseServer__is_shut_down.clear() |
73 | | while self._BaseServer__serving: |
74 | | |
75 | | # XXX: Consider using another file descriptor or |
76 | | # connecting to the socket to wake this up instead of |
77 | | # polling. Polling reduces our responsiveness to a |
78 | | # shutdown request and wastes cpu at all other times. |
79 | | try: |
80 | | r, w, e = select.select([self], [], [], poll_interval) |
81 | | except select.error, e: |
82 | | if e[0] == errno.EINTR: |
83 | | logging.debug("got eintr") |
84 | | continue |
85 | | raise |
86 | | if r: |
87 | | self._handle_request_noblock() |
88 | | self._BaseServer__is_shut_down.set() |
89 | | |
90 | | def server_bind(self): |
91 | | """Override server_bind in HTTPServer to not use |
92 | | getfqdn to get the server name because is very slow.""" |
93 | | SocketServer.TCPServer.server_bind(self) |
94 | | host, port = self.socket.getsockname()[:2] |
95 | | self.server_name = 'localhost' |
96 | | self.server_port = port |
| 54 | return _file |
97 | 55 | |
98 | 56 | |
99 | 57 | class WebActivity(Gtk.Window): |
… |
… |
|
109 | 67 | self.set_decorated(False) |
110 | 68 | self.maximize() |
111 | 69 | |
112 | | #self.connect("key-press-event", self._key_press_event_cb) |
| 70 | self.connect("key-press-event", self._key_press_event_cb) |
113 | 71 | self.connect('realize', self._realize_cb) |
114 | 72 | self.connect('destroy', self._destroy_cb) |
115 | 73 | |
116 | | # Get a free socket |
117 | | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) |
118 | | sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) |
119 | | sock.bind(('', 0)) |
120 | | sock.listen(socket.SOMAXCONN) |
121 | | _ipaddr, self.port = sock.getsockname() |
122 | | sock.shutdown(socket.SHUT_RDWR) |
123 | | logging.error('Using port %d', self.port) |
124 | | |
125 | | httpd = LocalHTTPServer(('', self.port), |
126 | | lambda *args: LocalRequestHandler(*args), |
127 | | activity.get_bundle_path()) |
128 | | self._server = Thread(target=httpd.serve_forever) |
129 | | self._server.setDaemon(True) |
130 | | self._server.start() |
131 | | |
132 | | self._web_view = WebKit.WebView() |
133 | | self._web_view.connect("notify::load-status", self._loading_changed_cb) |
134 | | self._web_view.connect("resource-request-starting", |
135 | | self._resource_request_starting_cb) |
| 74 | context = WebKit2.WebContext.get_default() |
| 75 | context.register_uri_scheme("activity", self._app_scheme_cb, None) |
| 76 | |
| 77 | self._web_view = WebKit2.WebView() |
| 78 | self._web_view.connect("load-changed", self._loading_changed_cb) |
| 79 | self._web_view.connect('run-file-chooser', self.__run_file_chooser) |
136 | 80 | |
137 | 81 | self.add(self._web_view) |
138 | 82 | self._web_view.show() |
139 | 83 | |
140 | | #settings = self._web_view.get_settings() |
141 | | #settings.set_property("enable-developer-extras", True) |
| 84 | settings = self._web_view.get_settings() |
| 85 | settings.set_property("enable-developer-extras", True) |
142 | 86 | |
143 | 87 | self._web_view.load_uri("activity://%s/index.html" % self._bundle_id) |
144 | 88 | |
… |
… |
|
156 | 100 | self.destroy() |
157 | 101 | Gtk.main_quit() |
158 | 102 | |
159 | | def _resource_request_starting_cb(self, webview, web_frame, web_resource, |
160 | | request, response): |
161 | | uri = web_resource.get_uri() |
162 | | if uri.startswith('activity://'): |
163 | | prefix = "activity://%s" % self._bundle_id |
164 | | new_prefix = "http://0.0.0.0:%d" % self.port |
165 | | new_uri = new_prefix + uri[len(prefix):] |
166 | | |
167 | | request.set_uri(new_uri) |
168 | | |
169 | | def _loading_changed_cb(self, web_view, load_status): |
170 | | status = web_view.get_load_status() |
171 | | |
172 | | if status == WebKit.LoadStatus.FINISHED: |
173 | | |
| 103 | def _loading_changed_cb(self, web_view, load_event): |
| 104 | if load_event == WebKit2.LoadEvent.FINISHED: |
174 | 105 | key = os.environ["SUGAR_APISOCKET_KEY"] |
175 | 106 | port = os.environ["SUGAR_APISOCKET_PORT"] |
176 | 107 | |
… |
… |
|
194 | 125 | window.sugar.onEnvironmentSet(); |
195 | 126 | """ % env_json |
196 | 127 | |
197 | | self._web_view.execute_script(script) |
| 128 | self._web_view.run_javascript(script, None, None, None) |
| 129 | |
| 130 | def __run_file_chooser(self, browser, request): |
| 131 | picker = FilePicker(self) |
| 132 | chosen = picker.run() |
| 133 | picker.destroy() |
| 134 | |
| 135 | if chosen: |
| 136 | request.select_files([chosen]) |
| 137 | else: |
| 138 | request.cancel() |
| 139 | return True |
198 | 140 | |
199 | 141 | def _key_press_event_cb(self, window, event): |
200 | 142 | key_name = Gdk.keyval_name(event.keyval) |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/webactivity.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/webactivity.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/webactivity.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/webactivity.pyo son distintos
Sólo en 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity: webkit1.py
Sólo en 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity: webkit1.pyc
Sólo en 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity: webkit1.pyo
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/widgets.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/widgets.py
old
|
new
|
|
20 | 20 | from gi.repository import Gdk |
21 | 21 | from gi.repository import Gtk |
22 | 22 | import gettext |
23 | | from gi.repository import GConf |
24 | 23 | |
25 | 24 | from sugar3.graphics.toolbutton import ToolButton |
26 | 25 | from sugar3.graphics.toolbarbox import ToolbarButton |
… |
… |
|
31 | 30 | from sugar3.bundle.activitybundle import ActivityBundle |
32 | 31 | from sugar3.graphics import style |
33 | 32 | from sugar3.graphics.palettemenu import PaletteMenuBox |
| 33 | from sugar3 import profile |
34 | 34 | |
35 | 35 | |
36 | 36 | _ = lambda msg: gettext.dgettext('sugar-toolkit-gtk3', msg) |
… |
… |
|
40 | 40 | if metadata is not None and metadata.get('icon-color'): |
41 | 41 | color = XoColor(metadata['icon-color']) |
42 | 42 | else: |
43 | | client = GConf.Client.get_default() |
44 | | color = XoColor(client.get_string('/desktop/sugar/user/color')) |
| 43 | color = profile.get_color() |
45 | 44 | |
46 | 45 | from sugar3.activity.activity import get_bundle_path |
47 | 46 | bundle = ActivityBundle(get_bundle_path()) |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/widgets.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/widgets.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/widgets.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/activity/widgets.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/activitybundle.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/activitybundle.py
old
|
new
|
|
108 | 108 | self._tags = None |
109 | 109 | self._activity_version = '0' |
110 | 110 | self._summary = None |
111 | | self._maximum_instances = None |
| 111 | self._single_instance = False |
112 | 112 | |
113 | 113 | info_file = self.get_file('activity/activity.info') |
114 | 114 | if info_file is None: |
… |
… |
|
129 | 129 | if cp.has_option(section, 'bundle_id'): |
130 | 130 | self._bundle_id = cp.get(section, 'bundle_id') |
131 | 131 | else: |
132 | | raise MalformedBundleException( |
133 | | 'Activity bundle %s does not specify a bundle id' % |
134 | | self._path) |
| 132 | if cp.has_option(section, 'service_name'): |
| 133 | self._bundle_id = cp.get(section, 'service_name') |
| 134 | logging.error('ATTENTION: service_name property in the ' |
| 135 | 'activity.info file is deprecated, should be ' |
| 136 | ' changed to bundle_id') |
| 137 | else: |
| 138 | raise MalformedBundleException( |
| 139 | 'Activity bundle %s does not specify a bundle id' % |
| 140 | self._path) |
| 141 | |
| 142 | if ' ' in self._bundle_id: |
| 143 | raise MalformedBundleException('Space in bundle_id') |
135 | 144 | |
136 | 145 | if cp.has_option(section, 'name'): |
137 | 146 | self._name = cp.get(section, 'name') |
… |
… |
|
174 | 183 | if cp.has_option(section, 'summary'): |
175 | 184 | self._summary = cp.get(section, 'summary') |
176 | 185 | |
177 | | if cp.has_option(section, 'maximum_instances'): |
178 | | maximum_instances = cp.get(section, 'maximum_instances') |
179 | | try: |
180 | | self._maximum_instances = int(maximum_instances) |
181 | | except ValueError: |
182 | | logging.error( |
183 | | 'Activity bundle %s has invalid maximum_instances %s' % |
184 | | (self._path, maximum_instances)) |
185 | | self._maximum_instances = None |
| 186 | if cp.has_option(section, 'single_instance'): |
| 187 | if cp.get(section, 'single_instance') == 'yes': |
| 188 | self._single_instance = True |
186 | 189 | |
187 | 190 | def _get_linfo_file(self): |
188 | 191 | # Using method from gettext.py, first find languages from environ |
… |
… |
|
284 | 287 | """Get the summary that describe the activity""" |
285 | 288 | return self._summary |
286 | 289 | |
287 | | def get_maximum_instances(self): |
288 | | """Get the summary that describe the activity""" |
289 | | return self._maximum_instances |
| 290 | def get_single_instance(self): |
| 291 | """Get whether there should be a single instance for the activity""" |
| 292 | return self._single_instance |
290 | 293 | |
291 | 294 | def get_show_launcher(self): |
292 | 295 | """Get whether there should be a visible launcher for the activity""" |
… |
… |
|
345 | 348 | return |
346 | 349 | if not os.path.islink(dst) and os.path.exists(dst): |
347 | 350 | raise RuntimeError('Do not remove %s if it was not ' |
348 | | 'installed by sugar', dst) |
349 | | logging.debug('Link resource %s to %s', src, dst) |
| 351 | 'installed by sugar' % dst) |
| 352 | logging.debug('Link resource %s to %s' % (src, dst)) |
350 | 353 | if os.path.lexists(dst): |
351 | 354 | logging.debug('Relink %s', dst) |
352 | 355 | os.unlink(dst) |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/activitybundle.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/activitybundle.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/activitybundle.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/activitybundle.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/bundle.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/bundle.py
old
|
new
|
|
117 | 117 | try: |
118 | 118 | f = open(path, 'rb') |
119 | 119 | except IOError: |
| 120 | logging.debug("cannot open path %s" % path) |
120 | 121 | return None |
121 | 122 | else: |
122 | 123 | path = os.path.join(self._zip_root_dir, filename) |
… |
… |
|
124 | 125 | data = self._zip_file.read(path) |
125 | 126 | f = StringIO.StringIO(data) |
126 | 127 | except KeyError: |
127 | | logging.debug('%s not found.', filename) |
| 128 | logging.debug('%s not found in zip %s.' % (filename, path)) |
| 129 | return None |
128 | 130 | |
129 | 131 | return f |
130 | 132 | |
… |
… |
|
161 | 163 | installed.""" |
162 | 164 | return self._installation_time |
163 | 165 | |
| 166 | def get_show_launcher(self): |
| 167 | return True |
| 168 | |
164 | 169 | def _unzip(self, install_dir): |
165 | 170 | if self._zip_file is None: |
166 | 171 | raise AlreadyInstalledException |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/bundle.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/bundle.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/bundle.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/bundle.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/bundleversion.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/bundleversion.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/bundleversion.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/bundleversion.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/contentbundle.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/contentbundle.py
old
|
new
|
|
97 | 97 | self._icon = cp.get(section, 'icon') |
98 | 98 | |
99 | 99 | # Compatibility with old content bundles |
100 | | if not self._global_name is None \ |
| 100 | if self._global_name is not None \ |
101 | 101 | and cp.has_option(section, 'bundle_class'): |
102 | 102 | self._global_name = cp.get(section, 'bundle_class') |
103 | 103 | |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/contentbundle.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/contentbundle.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/contentbundle.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/contentbundle.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/helpers.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/helpers.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/helpers.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/helpers.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/__init__.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/__init__.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/__init__.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/bundle/__init__.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/config.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/config.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/config.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/config.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/datastore/datastore.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/datastore/datastore.py
old
|
new
|
|
26 | 26 | import os |
27 | 27 | import tempfile |
28 | 28 | from gi.repository import GObject |
29 | | from gi.repository import GConf |
30 | 29 | from gi.repository import Gio |
31 | 30 | import dbus |
32 | 31 | |
… |
… |
|
168 | 167 | self._metadata.update(properties) |
169 | 168 | |
170 | 169 | def get_metadata(self): |
171 | | if self._metadata is None and not self.object_id is None: |
| 170 | if self._metadata is None and self.object_id is not None: |
172 | 171 | properties = _get_data_store().get_properties(self.object_id) |
173 | 172 | metadata = DSMetadata(properties) |
174 | 173 | self._metadata = metadata |
… |
… |
|
181 | 180 | metadata = property(get_metadata, set_metadata) |
182 | 181 | |
183 | 182 | def get_file_path(self, fetch=True): |
184 | | if fetch and self._file_path is None and not self.object_id is None: |
| 183 | if fetch and self._file_path is None and self.object_id is not None: |
185 | 184 | self.set_file_path(_get_data_store().get_filename(self.object_id)) |
186 | 185 | self._owns_file = True |
187 | 186 | return self._file_path |
… |
… |
|
225 | 224 | |
226 | 225 | def __init__(self, file_path): |
227 | 226 | stat = os.stat(file_path) |
228 | | client = GConf.Client.get_default() |
| 227 | settings = Gio.Settings('org.sugarlabs.user') |
229 | 228 | metadata = { |
230 | 229 | 'uid': file_path, |
231 | 230 | 'title': os.path.basename(file_path), |
… |
… |
|
233 | 232 | 'mime_type': Gio.content_type_guess(file_path, None)[0], |
234 | 233 | 'activity': '', |
235 | 234 | 'activity_id': '', |
236 | | 'icon-color': client.get_string('/desktop/sugar/user/color'), |
| 235 | 'icon-color': settings.get_string('color'), |
237 | 236 | 'description': file_path, |
238 | 237 | } |
239 | 238 | |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/datastore/datastore.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/datastore/datastore.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/datastore/datastore.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/datastore/datastore.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/datastore/__init__.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/datastore/__init__.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/datastore/__init__.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/datastore/__init__.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/dispatch/dispatcher.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/dispatch/dispatcher.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/dispatch/dispatcher.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/dispatch/dispatcher.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/dispatch/__init__.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/dispatch/__init__.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/dispatch/__init__.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/dispatch/__init__.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/dispatch/saferef.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/dispatch/saferef.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/dispatch/saferef.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/dispatch/saferef.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/env.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/env.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/env.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/env.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/alert.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/alert.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/alert.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/alert.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/animator.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/animator.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/animator.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/animator.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/colorbutton.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/colorbutton.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/colorbutton.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/colorbutton.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/combobox.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/combobox.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/combobox.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/combobox.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/iconentry.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/iconentry.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/iconentry.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/iconentry.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/icon.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/icon.py
old
|
new
|
|
32 | 32 | from gi.repository import Rsvg |
33 | 33 | import cairo |
34 | 34 | |
| 35 | from sugar3.graphics import style |
35 | 36 | from sugar3.graphics.xocolor import XoColor |
36 | 37 | from sugar3.util import LRU |
37 | 38 | |
… |
… |
|
99 | 100 | self.height = None |
100 | 101 | self.cache = False |
101 | 102 | self.scale = 1.0 |
| 103 | self.pixbuf = None |
102 | 104 | |
103 | 105 | def _get_cache_key(self, sensitive): |
104 | 106 | if self.background_color is None: |
… |
… |
|
106 | 108 | else: |
107 | 109 | color = (self.background_color.red, self.background_color.green, |
108 | 110 | self.background_color.blue) |
109 | | return (self.icon_name, self.file_name, self.fill_color, |
| 111 | |
| 112 | return (self.icon_name, self.file_name, self.pixbuf, self.fill_color, |
110 | 113 | self.stroke_color, self.badge_name, self.width, self.height, |
111 | 114 | color, sensitive) |
112 | 115 | |
… |
… |
|
238 | 241 | icon_source.set_direction_wildcarded(False) |
239 | 242 | icon_source.set_size_wildcarded(False) |
240 | 243 | |
241 | | style = widget.get_style() |
242 | | pixbuf = style.render_icon(icon_source, widget.get_direction(), |
243 | | Gtk.StateType.INSENSITIVE, -1, widget, |
244 | | 'sugar-icon') |
| 244 | widget_style = widget.get_style() |
| 245 | pixbuf = widget_style.render_icon( |
| 246 | icon_source, widget.get_direction(), |
| 247 | Gtk.StateType.INSENSITIVE, -1, widget, |
| 248 | 'sugar-icon') |
245 | 249 | |
246 | 250 | return pixbuf |
247 | 251 | |
… |
… |
|
250 | 254 | if cache_key in self._surface_cache: |
251 | 255 | return self._surface_cache[cache_key] |
252 | 256 | |
253 | | # We run two attempts at finding the icon. First, we try the icon |
254 | | # requested by the user. If that fails, we fall back on |
255 | | # document-generic. If that doesn't work out, bail. |
256 | | icon_width = None |
257 | | for (file_name, icon_name) in ((self.file_name, self.icon_name), |
258 | | (None, 'document-generic')): |
259 | | icon_info = self._get_icon_info(file_name, icon_name) |
260 | | if icon_info.file_name is None: |
261 | | return None |
262 | | |
263 | | is_svg = icon_info.file_name.endswith('.svg') |
264 | | |
265 | | if is_svg: |
266 | | try: |
267 | | handle = self._load_svg(icon_info.file_name) |
268 | | icon_width = handle.props.width |
269 | | icon_height = handle.props.height |
270 | | break |
271 | | except IOError: |
272 | | pass |
273 | | else: |
274 | | try: |
275 | | path = icon_info.file_name |
276 | | pixbuf = GdkPixbuf.Pixbuf.new_from_file(path) |
277 | | icon_width = pixbuf.get_width() |
278 | | icon_height = pixbuf.get_height() |
279 | | break |
280 | | except GObject.GError: |
281 | | pass |
| 257 | if self.pixbuf: |
| 258 | # We alredy have the pixbuf for this icon. |
| 259 | pixbuf = self.pixbuf |
| 260 | icon_width = pixbuf.get_width() |
| 261 | icon_height = pixbuf.get_height() |
| 262 | icon_info = self._get_icon_info(self.file_name, self.icon_name) |
| 263 | is_svg = False |
| 264 | else: |
| 265 | # We run two attempts at finding the icon. First, we try the icon |
| 266 | # requested by the user. If that fails, we fall back on |
| 267 | # document-generic. If that doesn't work out, bail. |
| 268 | icon_width = None |
| 269 | for (file_name, icon_name) in ((self.file_name, self.icon_name), |
| 270 | (None, 'document-generic')): |
| 271 | icon_info = self._get_icon_info(file_name, icon_name) |
| 272 | if icon_info.file_name is None: |
| 273 | return None |
| 274 | |
| 275 | is_svg = icon_info.file_name.endswith('.svg') |
| 276 | |
| 277 | if is_svg: |
| 278 | try: |
| 279 | handle = self._load_svg(icon_info.file_name) |
| 280 | icon_width = handle.props.width |
| 281 | icon_height = handle.props.height |
| 282 | break |
| 283 | except IOError: |
| 284 | pass |
| 285 | else: |
| 286 | try: |
| 287 | path = icon_info.file_name |
| 288 | pixbuf = GdkPixbuf.Pixbuf.new_from_file(path) |
| 289 | icon_width = pixbuf.get_width() |
| 290 | icon_height = pixbuf.get_height() |
| 291 | break |
| 292 | except GObject.GError: |
| 293 | pass |
282 | 294 | |
283 | 295 | if icon_width is None: |
284 | 296 | # Neither attempt found an icon for us to use |
… |
… |
|
335 | 347 | |
336 | 348 | __gtype_name__ = 'SugarIcon' |
337 | 349 | |
| 350 | # FIXME: deprecate icon_size |
| 351 | _MENU_SIZES = (Gtk.IconSize.MENU, Gtk.IconSize.DND, |
| 352 | Gtk.IconSize.SMALL_TOOLBAR, Gtk.IconSize.BUTTON) |
| 353 | |
338 | 354 | def __init__(self, **kwargs): |
339 | 355 | self._buffer = _IconBuffer() |
340 | 356 | # HACK: need to keep a reference to the path so it doesn't get garbage |
… |
… |
|
344 | 360 | self._alpha = 1.0 |
345 | 361 | self._scale = 1.0 |
346 | 362 | |
| 363 | # FIXME: deprecate icon_size |
| 364 | if 'icon_size' in kwargs: |
| 365 | logging.warning("icon_size is deprecated. Use pixel_size instead.") |
| 366 | |
347 | 367 | GObject.GObject.__init__(self, **kwargs) |
348 | 368 | |
349 | 369 | def get_file(self): |
… |
… |
|
355 | 375 | |
356 | 376 | file = GObject.property(type=object, setter=set_file, getter=get_file) |
357 | 377 | |
| 378 | def get_pixbuf(self): |
| 379 | return self._buffer.pixbuf |
| 380 | |
| 381 | def set_pixbuf(self, pixbuf): |
| 382 | self._buffer.pixbuf = pixbuf |
| 383 | |
| 384 | pixbuf = GObject.property(type=object, setter=set_pixbuf, |
| 385 | getter=get_pixbuf) |
| 386 | |
358 | 387 | def _sync_image_properties(self): |
359 | 388 | if self._buffer.icon_name != self.props.icon_name: |
360 | 389 | self._buffer.icon_name = self.props.icon_name |
… |
… |
|
362 | 391 | if self._buffer.file_name != self.props.file: |
363 | 392 | self._buffer.file_name = self.props.file |
364 | 393 | |
| 394 | # FIXME: deprecate icon_size |
| 395 | pixel_size = None |
365 | 396 | if self.props.pixel_size == -1: |
366 | | valid_, width, height = Gtk.icon_size_lookup(self.props.icon_size) |
| 397 | if self.props.icon_size in self._MENU_SIZES: |
| 398 | pixel_size = style.SMALL_ICON_SIZE |
| 399 | else: |
| 400 | pixel_size = style.STANDARD_ICON_SIZE |
367 | 401 | else: |
368 | | width = height = self.props.pixel_size |
| 402 | pixel_size = self.props.pixel_size |
| 403 | |
| 404 | width = height = pixel_size |
| 405 | |
369 | 406 | if self._buffer.width != width or self._buffer.height != height: |
370 | 407 | self._buffer.width = width |
371 | 408 | self._buffer.height = height |
… |
… |
|
416 | 453 | |
417 | 454 | allocation = self.get_allocation() |
418 | 455 | x = math.floor(xpad + |
419 | | (allocation.width - requisition.width) * xalign) |
| 456 | (allocation.width - requisition.width) * xalign) |
420 | 457 | y = math.floor(ypad + |
421 | | (allocation.height - requisition.height) * yalign) |
| 458 | (allocation.height - requisition.height) * yalign) |
422 | 459 | |
423 | 460 | if self._scale != 1.0: |
424 | 461 | cr.scale(self._scale, self._scale) |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/icon.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/icon.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/icon.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/icon.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/__init__.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/__init__.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/__init__.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/__init__.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/menuitem.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/menuitem.py
old
|
new
|
|
26 | 26 | from gi.repository import Gtk |
27 | 27 | |
28 | 28 | from sugar3.graphics.icon import Icon |
| 29 | from sugar3.graphics import style |
29 | 30 | |
30 | 31 | |
31 | 32 | class MenuItem(Gtk.ImageMenuItem): |
32 | 33 | |
33 | | def __init__(self, text_label=None, icon_name=None, text_maxlen=60, |
34 | | xo_color=None, file_name=None): |
| 34 | def __init__(self, text_label=None, icon_name=None, |
| 35 | text_maxlen=style.MENU_WIDTH_CHARS, xo_color=None, |
| 36 | file_name=None): |
35 | 37 | GObject.GObject.__init__(self) |
36 | 38 | self._accelerator = None |
37 | 39 | |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/menuitem.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/menuitem.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/menuitem.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/menuitem.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/notebook.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/notebook.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/notebook.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/notebook.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/objectchooser.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/objectchooser.py
old
|
new
|
|
228 | 228 | def __chooser_response_cb(self, chooser_id, object_id): |
229 | 229 | if chooser_id != self._chooser_id: |
230 | 230 | return |
231 | | logging.debug('ObjectChooser.__chooser_response_cb: %r', object_id) |
| 231 | logging.debug('ObjectChooser.__chooser_response_cb: %r' % object_id) |
232 | 232 | self._response_code = Gtk.ResponseType.ACCEPT |
233 | 233 | self._object_id = object_id |
234 | 234 | self._cleanup() |
… |
… |
|
236 | 236 | def __chooser_cancelled_cb(self, chooser_id): |
237 | 237 | if chooser_id != self._chooser_id: |
238 | 238 | return |
239 | | logging.debug('ObjectChooser.__chooser_cancelled_cb: %r', chooser_id) |
| 239 | logging.debug('ObjectChooser.__chooser_cancelled_cb: %r' % chooser_id) |
240 | 240 | self._response_code = Gtk.ResponseType.CANCEL |
241 | 241 | self._cleanup() |
242 | 242 | |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/objectchooser.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/objectchooser.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/objectchooser.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/objectchooser.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettegroup.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettegroup.py
old
|
new
|
|
75 | 75 | self._sig_ids[palette].append(sid) |
76 | 76 | |
77 | 77 | def remove(self, palette): |
78 | | if not palette in self._palettes: |
| 78 | if palette not in self._palettes: |
79 | 79 | # This happens when converting a window based palette to a menu |
80 | 80 | # based one. |
81 | 81 | return |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettegroup.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettegroup.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettegroup.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettegroup.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettemenu.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettemenu.py
old
|
new
|
|
78 | 78 | } |
79 | 79 | |
80 | 80 | def __init__(self, text_label=None, icon_name=None, text_maxlen=60, |
81 | | xo_color=None, file_name=None): |
| 81 | xo_color=None, file_name=None, accelerator=None): |
| 82 | |
| 83 | """ |
| 84 | text_label -- str |
| 85 | a text to display in the menu. |
| 86 | |
| 87 | icon_name -- str |
| 88 | the name of a sugar icon to be displayed. Takse precedence |
| 89 | over file_name. |
| 90 | |
| 91 | text_maxlen -- int |
| 92 | the desired maximum width of the label, in characters. |
| 93 | By default is 60. |
| 94 | |
| 95 | xo_color -- sugar.graphics.XoColor |
| 96 | the color to be applied to the icon. |
| 97 | |
| 98 | file_name -- str |
| 99 | the path to a svg file used as icon. |
| 100 | |
| 101 | accelerator -- str |
| 102 | a text used to display the keyboard shortcut associated |
| 103 | to the menu. |
| 104 | |
| 105 | """ |
82 | 106 | |
83 | 107 | Gtk.EventBox.__init__(self) |
84 | 108 | self.set_above_child(True) |
… |
… |
|
120 | 144 | self._hbox.pack_start(align, expand=True, fill=True, |
121 | 145 | padding=style.DEFAULT_PADDING) |
122 | 146 | |
| 147 | self._accelerator_label = Gtk.AccelLabel('') |
| 148 | if accelerator is not None: |
| 149 | self._accelerator_label.set_text(accelerator) |
| 150 | self._hbox.pack_start(self._accelerator_label, expand=False, |
| 151 | fill=False, padding=style.DEFAULT_PADDING) |
| 152 | |
123 | 153 | self.id_bt_release_cb = self.connect('button-release-event', |
124 | 154 | self.__button_release_cb) |
125 | 155 | self.id_enter_notify_cb = self.connect('enter-notify-event', |
… |
… |
|
150 | 180 | padding=style.DEFAULT_PADDING) |
151 | 181 | self._hbox.reorder_child(icon, 0) |
152 | 182 | |
| 183 | def set_accelerator(self, text): |
| 184 | self._accelerator_label.set_text(text) |
| 185 | |
153 | 186 | def set_sensitive(self, sensitive): |
154 | 187 | is_sensitive = bool(not self.get_state_flags() & |
155 | 188 | Gtk.StateFlags.INSENSITIVE) |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettemenu.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettemenu.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettemenu.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettemenu.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palette.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palette.py
old
|
new
|
|
22 | 22 | """ |
23 | 23 | STABLE. |
24 | 24 | """ |
25 | | |
26 | 25 | from gi.repository import Gtk |
| 26 | from gi.repository import Gdk |
27 | 27 | from gi.repository import GObject |
28 | 28 | from gi.repository import Pango |
29 | 29 | |
… |
… |
|
101 | 101 | __gtype_name__ = 'SugarPalette' |
102 | 102 | |
103 | 103 | def __init__(self, label=None, accel_path=None, |
104 | | text_maxlen=60, **kwargs): |
| 104 | text_maxlen=style.MENU_WIDTH_CHARS, **kwargs): |
105 | 105 | # DEPRECATED: label is passed with the primary-text property, |
106 | 106 | # accel_path is set via the invoker property |
107 | 107 | |
… |
… |
|
111 | 111 | self._icon_visible = True |
112 | 112 | self._palette_state = self.PRIMARY |
113 | 113 | |
| 114 | self._primary_event_box = Gtk.EventBox() |
| 115 | self._primary_event_box.show() |
114 | 116 | self._primary_box = Gtk.HBox() |
| 117 | self._primary_event_box.add(self._primary_box) |
115 | 118 | self._primary_box.show() |
116 | 119 | |
117 | 120 | self._icon_box = Gtk.HBox() |
… |
… |
|
135 | 138 | self._label.set_max_width_chars(text_maxlen) |
136 | 139 | self._label.set_ellipsize(Pango.EllipsizeMode.MIDDLE) |
137 | 140 | labels_box.pack_start(self._label, True, True, 0) |
| 141 | self._primary_event_box.connect('button-release-event', |
| 142 | self.__button_release_event_cb) |
| 143 | self._primary_event_box.set_events(Gdk.EventMask.BUTTON_RELEASE_MASK) |
138 | 144 | |
139 | 145 | self._secondary_label = Gtk.Label() |
140 | 146 | self._secondary_label.set_alignment(0, 0.5) |
… |
… |
|
255 | 261 | getter=get_primary_text, |
256 | 262 | setter=set_primary_text) |
257 | 263 | |
| 264 | def __button_release_event_cb(self, widget, event): |
| 265 | if self.props.invoker is not None: |
| 266 | self.props.invoker.primary_text_clicked() |
| 267 | |
258 | 268 | def set_secondary_text(self, label): |
259 | 269 | if label is not None: |
260 | 270 | label = label.split('\n', 1)[0] |
… |
… |
|
334 | 344 | self._setup_widget() |
335 | 345 | |
336 | 346 | self._palette_box = Gtk.VBox() |
337 | | self._palette_box.pack_start(self._primary_box, False, True, 0) |
| 347 | self._palette_box.pack_start(self._primary_event_box, False, True, |
| 348 | 0) |
338 | 349 | self._palette_box.pack_start(self._secondary_box, True, True, 0) |
339 | 350 | |
340 | 351 | self._widget.add(self._palette_box) |
341 | 352 | self._palette_box.show() |
342 | 353 | height = style.GRID_CELL_SIZE - 2 * self._widget.get_border_width() |
343 | | self._primary_box.set_size_request(-1, height) |
| 354 | self._primary_event_box.set_size_request(-1, height) |
344 | 355 | |
345 | 356 | if self._content.get_children(): |
346 | 357 | self._content.remove(self._content.get_children()[0]) |
… |
… |
|
405 | 416 | if self._widget is None \ |
406 | 417 | or not isinstance(self._widget, _PaletteMenuWidget): |
407 | 418 | if self._widget is not None: |
408 | | self._palette_box.remove(self._primary_box) |
| 419 | self._palette_box.remove(self._primary_event_box) |
409 | 420 | self._palette_box.remove(self._secondary_box) |
410 | 421 | self._teardown_widget() |
411 | 422 | self._widget.destroy() |
412 | 423 | |
413 | 424 | self._widget = _PaletteMenuWidget() |
414 | 425 | |
415 | | self._label_menuitem = _HeaderItem(self._primary_box) |
| 426 | self._label_menuitem = _HeaderItem(self._primary_event_box) |
416 | 427 | self._label_menuitem.show() |
417 | 428 | self._widget.append(self._label_menuitem) |
418 | 429 | |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palette.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palette.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palette.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palette.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py
old
|
new
|
|
1052 | 1052 | if not self.props.cache_palette: |
1053 | 1053 | self.set_palette(None) |
1054 | 1054 | |
| 1055 | def primary_text_clicked(self): |
| 1056 | """Implemented by invokers that can be clicked""" |
| 1057 | pass |
| 1058 | |
1055 | 1059 | |
1056 | 1060 | class WidgetInvoker(Invoker): |
1057 | 1061 | |
… |
… |
|
1345 | 1349 | else: |
1346 | 1350 | return self.LEFT + self.RIGHT |
1347 | 1351 | |
| 1352 | def primary_text_clicked(self): |
| 1353 | self._widget.emit('clicked') |
| 1354 | |
1348 | 1355 | |
1349 | 1356 | class CellRendererInvoker(Invoker): |
1350 | 1357 | |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettewindow.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettewindow.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettewindow.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/palettewindow.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/panel.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/panel.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/panel.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/panel.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/progressicon.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/progressicon.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/progressicon.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/progressicon.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/radiopalette.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/radiopalette.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/radiopalette.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/radiopalette.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/radiotoolbutton.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/radiotoolbutton.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/radiotoolbutton.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/radiotoolbutton.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/style.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/style.py
old
|
new
|
|
27 | 27 | |
28 | 28 | from gi.repository import Gdk |
29 | 29 | from gi.repository import Pango |
30 | | from gi.repository import GConf |
| 30 | from gi.repository import Gio |
31 | 31 | |
32 | 32 | |
33 | 33 | FOCUS_LINE_WIDTH = 2 |
… |
… |
|
110 | 110 | LINE_WIDTH = zoom(2) |
111 | 111 | |
112 | 112 | STANDARD_ICON_SIZE = zoom(55) |
113 | | SMALL_ICON_SIZE = zoom(55 * 0.5) |
| 113 | SMALL_ICON_SIZE = zoom(33) |
114 | 114 | MEDIUM_ICON_SIZE = zoom(55 * 1.5) |
115 | 115 | LARGE_ICON_SIZE = zoom(55 * 2.0) |
116 | 116 | XLARGE_ICON_SIZE = zoom(55 * 2.75) |
117 | 117 | |
118 | | client = GConf.Client.get_default() |
119 | | FONT_SIZE = client.get_float('/desktop/sugar/font/default_size') |
120 | | FONT_FACE = client.get_string('/desktop/sugar/font/default_face') |
| 118 | settings = Gio.Settings('org.sugarlabs.font') |
| 119 | FONT_SIZE = settings.get_double('default-size') |
| 120 | FONT_FACE = settings.get_string('default-face') |
121 | 121 | |
122 | 122 | FONT_NORMAL = Font('%s %f' % (FONT_FACE, FONT_SIZE)) |
123 | 123 | FONT_BOLD = Font('%s bold %f' % (FONT_FACE, FONT_SIZE)) |
… |
… |
|
145 | 145 | PALETTE_CURSOR_DISTANCE = zoom(10) |
146 | 146 | |
147 | 147 | TOOLBAR_ARROW_SIZE = zoom(24) |
| 148 | |
| 149 | MENU_WIDTH_CHARS = 60 |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/style.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/style.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/style.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/style.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toggletoolbutton.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toggletoolbutton.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toggletoolbutton.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toggletoolbutton.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolbarbox.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolbarbox.py
old
|
new
|
|
171 | 171 | return self.toolbar.get_nth_item(self._expanded_button_index) |
172 | 172 | |
173 | 173 | def set_expanded_button(self, button): |
174 | | if not button in self.toolbar: |
| 174 | if button not in self.toolbar: |
175 | 175 | self._expanded_button_index = -1 |
176 | 176 | return |
177 | 177 | self._expanded_button_index = self.toolbar.get_item_index(button) |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolbarbox.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolbarbox.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolbarbox.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolbarbox.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolbox.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolbox.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolbox.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolbox.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolbutton.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolbutton.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolbutton.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolbutton.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolcombobox.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolcombobox.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolcombobox.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/toolcombobox.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/tray.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/tray.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/tray.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/tray.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/window.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/window.py
old
|
new
|
|
92 | 92 | self.set_decorated(False) |
93 | 93 | self.maximize() |
94 | 94 | self.connect('realize', self.__window_realize_cb) |
95 | | self.connect('key-press-event', self.__key_press_cb) |
| 95 | self.connect_after('key-press-event', self.__key_press_cb) |
96 | 96 | |
97 | 97 | # OSK support: canvas auto panning based on input focus |
98 | 98 | if GObject.signal_lookup('request-clear-area', Window) != 0 and \ |
… |
… |
|
145 | 145 | timestamp = GdkX11.x11_get_server_time(window) |
146 | 146 | window.focus(timestamp) |
147 | 147 | |
| 148 | def is_fullscreen(self): |
| 149 | return self._is_fullscreen |
| 150 | |
148 | 151 | def fullscreen(self): |
149 | 152 | palettegroup.popdown_all() |
150 | 153 | if self._toolbar_box is not None: |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/window.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/window.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/window.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/window.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/xocolor.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/xocolor.py
old
|
new
|
|
22 | 22 | import random |
23 | 23 | import logging |
24 | 24 | |
25 | | from gi.repository import GConf |
| 25 | from gi.repository import Gio |
26 | 26 | |
27 | 27 | colors = [['#B20008', '#FF2B34'], |
28 | 28 | ['#FF2B34', '#B20008'], |
… |
… |
|
229 | 229 | parsed_color = None |
230 | 230 | |
231 | 231 | if color_string is None: |
232 | | client = GConf.Client.get_default() |
233 | | color_string = client.get_string('/desktop/sugar/user/color') |
| 232 | settings = Gio.Settings('org.sugarlabs.user') |
| 233 | color_string = settings.get_string('color') |
234 | 234 | |
235 | 235 | if color_string is not None: |
236 | 236 | parsed_color = _parse_string(color_string) |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/xocolor.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/xocolor.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/xocolor.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/graphics/xocolor.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/__init__.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/__init__.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/__init__.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/__init__.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/logger.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/logger.py
old
|
new
|
|
61 | 61 | try: |
62 | 62 | logging.getLogger('').setLevel(int(level)) |
63 | 63 | except ValueError: |
64 | | logging.warning('Invalid log level: %r', level) |
| 64 | logging.warning('Invalid log level: %r' % level) |
65 | 65 | |
66 | 66 | |
67 | 67 | # pylint: disable-msg=E1101,F0401 |
… |
… |
|
235 | 235 | try: |
236 | 236 | res = f(*args, **kwargs) |
237 | 237 | except: |
238 | | trace_logger.exception("Exception occured in %s", f.__name__) |
| 238 | trace_logger.exception("Exception occured in %s" % f.__name__) |
239 | 239 | raise |
240 | 240 | |
241 | 241 | trace_logger.log(TRACE, "%s(%s) returned %s", f.__name__, |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/logger.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/logger.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/logger.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/logger.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/mime.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/mime.py
old
|
new
|
|
29 | 29 | from gi.repository import GdkPixbuf |
30 | 30 | from gi.repository import Gio |
31 | 31 | |
32 | | from gi.repository import SugarExt |
33 | | |
34 | 32 | _ = lambda msg: gettext.dgettext('sugar-toolkit-gtk3', msg) |
35 | 33 | |
36 | 34 | GENERIC_TYPE_TEXT = 'Text' |
… |
… |
|
38 | 36 | GENERIC_TYPE_AUDIO = 'Audio' |
39 | 37 | GENERIC_TYPE_VIDEO = 'Video' |
40 | 38 | GENERIC_TYPE_LINK = 'Link' |
| 39 | GENERIC_TYPE_BUNDLE = 'Bundle' |
41 | 40 | |
42 | 41 | |
43 | 42 | def _get_supported_image_mime_types(): |
… |
… |
|
49 | 48 | |
50 | 49 | _extensions = {} |
51 | 50 | _globs_timestamps = [] |
| 51 | _subclasses = {} |
| 52 | _subclasses_timestamps = [] |
| 53 | |
52 | 54 | _generic_types = [{ |
53 | 55 | 'id': GENERIC_TYPE_TEXT, |
54 | 56 | 'name': _('Text'), |
… |
… |
|
84 | 86 | 'name': _('Link'), |
85 | 87 | 'icon': 'text-uri-list', |
86 | 88 | 'types': ['text/x-moz-url', 'text/uri-list'], |
| 89 | }, { |
| 90 | 'id': GENERIC_TYPE_BUNDLE, |
| 91 | 'name': _('Bundle'), |
| 92 | 'icon': 'user-documents', |
| 93 | 'types': ['application/vnd.olpc-sugar'], |
87 | 94 | }] |
88 | 95 | |
89 | 96 | |
… |
… |
|
118 | 125 | |
119 | 126 | file_name = os.path.realpath(file_name) |
120 | 127 | |
121 | | mime_type = SugarExt.mime_get_mime_type_for_file(file_name, None) |
122 | | if mime_type == 'application/octet-stream': |
123 | | if _file_looks_like_text(file_name): |
124 | | return 'text/plain' |
125 | | else: |
126 | | return 'application/octet-stream' |
| 128 | f = Gio.File.new_for_path(file_name) |
| 129 | try: |
| 130 | info = f.query_info(Gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, 0, None) |
| 131 | mime_type = info.get_content_type() |
| 132 | except GLib.GError: |
| 133 | mime_type = Gio.content_type_guess(file_name, None)[0] |
127 | 134 | |
128 | 135 | return mime_type |
129 | 136 | |
130 | 137 | |
131 | 138 | def get_from_file_name(file_name): |
132 | | return SugarExt.mime_get_mime_type_from_file_name(file_name) |
| 139 | """ |
| 140 | DEPRECATED: 0.102 (removed in 4 releases) |
| 141 | Use Gio.content_type_guess(file_name, None)[0] instead. |
| 142 | """ |
| 143 | return Gio.content_type_guess(file_name, None)[0] |
133 | 144 | |
134 | 145 | |
135 | 146 | def get_mime_icon(mime_type): |
… |
… |
|
149 | 160 | |
150 | 161 | |
151 | 162 | def get_mime_parents(mime_type): |
152 | | return SugarExt.mime_list_mime_parents(mime_type) |
| 163 | global _subclasses |
| 164 | global _subclasses_timestamps |
153 | 165 | |
| 166 | dirs = _get_mime_data_directories() |
154 | 167 | |
155 | | def get_primary_extension(mime_type): |
156 | | global _extensions |
157 | | global _globs_timestamps |
| 168 | timestamps = [] |
| 169 | subclasses_path_list = [] |
| 170 | for f in dirs: |
| 171 | subclasses_path = os.path.join(f, 'mime', 'subclasses') |
| 172 | try: |
| 173 | mtime = os.stat(subclasses_path).st_mtime |
| 174 | timestamps.append([subclasses_path, mtime]) |
| 175 | subclasses_path_list.append(subclasses_path) |
| 176 | except OSError: |
| 177 | pass |
| 178 | |
| 179 | if timestamps != _subclasses_timestamps: |
| 180 | _subclasses = {} |
| 181 | for subclasses_path in subclasses_path_list: |
| 182 | with open(subclasses_path) as parents_file: |
| 183 | for line in parents_file: |
| 184 | subclass, parent = line.split() |
| 185 | if subclass not in _subclasses.keys(): |
| 186 | _subclasses[subclass] = [parent] |
| 187 | else: |
| 188 | _subclasses[subclass].append(parent) |
| 189 | |
| 190 | _subclasses_timestamps = timestamps |
| 191 | |
| 192 | if mime_type in _subclasses.keys(): |
| 193 | return _subclasses[mime_type] |
| 194 | else: |
| 195 | return [] |
158 | 196 | |
| 197 | |
| 198 | def _get_mime_data_directories(): |
159 | 199 | dirs = [] |
160 | 200 | |
161 | 201 | if 'XDG_DATA_HOME' in os.environ: |
… |
… |
|
167 | 207 | dirs.extend(os.environ['XDG_DATA_DIRS'].split(':')) |
168 | 208 | else: |
169 | 209 | dirs.extend(['/usr/local/share/', '/usr/share/']) |
| 210 | return dirs |
| 211 | |
| 212 | |
| 213 | def get_primary_extension(mime_type): |
| 214 | global _extensions |
| 215 | global _globs_timestamps |
| 216 | |
| 217 | dirs = _get_mime_data_directories() |
170 | 218 | |
171 | 219 | timestamps = [] |
172 | 220 | globs_path_list = [] |
… |
… |
|
252 | 300 | return GLib.uri_list_extract_uris(uri_list) |
253 | 301 | |
254 | 302 | |
255 | | def _file_looks_like_text(file_name): |
256 | | f = open(file_name, 'r') |
257 | | try: |
258 | | sample = f.read(256) |
259 | | finally: |
260 | | f.close() |
261 | | |
262 | | if '\000' in sample: |
263 | | return False |
264 | | |
265 | | for encoding in ('ascii', 'latin_1', 'utf_8', 'utf_16'): |
266 | | try: |
267 | | unicode(sample, encoding) |
268 | | return True |
269 | | except Exception: |
270 | | pass |
271 | | |
272 | | return False |
273 | | |
274 | | |
275 | 303 | def _get_generic_type_for_mime(mime_type): |
276 | 304 | for generic_type in _generic_types: |
277 | 305 | if mime_type in generic_type['types']: |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/mime.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/mime.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/mime.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/mime.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/network.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/network.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/network.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/network.pyo son distintos
Sólo en 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3: power.py
Sólo en 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3: power.pyc
Sólo en 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3: power.pyo
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/activity.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/activity.py
old
|
new
|
|
114 | 114 | self._joined_buddies = {} |
115 | 115 | |
116 | 116 | self._get_properties_call = None |
117 | | if not self.room_handle is None: |
| 117 | if self.room_handle is not None: |
118 | 118 | self._start_tracking_properties() |
119 | 119 | |
120 | 120 | def _start_tracking_properties(self): |
… |
… |
|
138 | 138 | dbus_interface=CONN_INTERFACE_ACTIVITY_PROPERTIES) |
139 | 139 | |
140 | 140 | def __activity_properties_changed_cb(self, room_handle, properties): |
141 | | _logger.debug('%r: Activity properties changed to %r', self, |
142 | | properties) |
| 141 | _logger.debug('%r: Activity properties changed to %r' % (self, |
| 142 | properties)) |
143 | 143 | self._update_properties(properties) |
144 | 144 | |
145 | 145 | def __got_properties_cb(self, properties): |
146 | | _logger.debug('__got_properties_cb %r', properties) |
| 146 | _logger.debug('__got_properties_cb %r' % properties) |
147 | 147 | self._get_properties_call = None |
148 | 148 | self._update_properties(properties) |
149 | 149 | |
150 | 150 | def __error_handler_cb(self, error): |
151 | | _logger.debug('__error_handler_cb %r', error) |
| 151 | _logger.debug('__error_handler_cb %r' % error) |
152 | 152 | |
153 | 153 | def _update_properties(self, new_props): |
154 | 154 | val = new_props.get('name', self._name) |
… |
… |
|
188 | 188 | |
189 | 189 | if self._get_properties_call is not None: |
190 | 190 | _logger.debug('%r: Blocking on GetProperties() because someone ' |
191 | | 'wants property %s', self, pspec.name) |
| 191 | 'wants property %s' % (self, pspec.name)) |
192 | 192 | self._get_properties_call.block() |
193 | 193 | |
194 | 194 | if pspec.name == 'id': |
… |
… |
|
218 | 218 | elif pspec.name == 'private': |
219 | 219 | self._private = val |
220 | 220 | else: |
221 | | raise ValueError('Unknown property %r', pspec.name) |
| 221 | raise ValueError('Unknown property %r' % pspec.name) |
222 | 222 | |
223 | 223 | self._publish_properties() |
224 | 224 | |
225 | 225 | def set_private(self, val, reply_handler, error_handler): |
226 | | _logger.debug('set_private %r', val) |
| 226 | _logger.debug('set_private %r' % val) |
227 | 227 | self._activity.SetProperties({'private': bool(val)}, |
228 | 228 | reply_handler=reply_handler, |
229 | 229 | error_handler=error_handler) |
… |
… |
|
271 | 271 | raise NotImplementedError() |
272 | 272 | |
273 | 273 | def __joined_cb(self, join_command, error): |
274 | | _logger.debug('%r: Join finished %r', self, error) |
| 274 | _logger.debug('%r: Join finished %r' % (self, error)) |
275 | 275 | if error is not None: |
276 | 276 | self.emit('joined', error is None, str(error)) |
277 | 277 | self.telepathy_text_chan = join_command.text_channel |
… |
… |
|
295 | 295 | channel.connect_to_signal('Closed', self.__text_channel_closed_cb) |
296 | 296 | |
297 | 297 | def __get_all_members_cb(self, members, local_pending, remote_pending): |
298 | | _logger.debug('__get_all_members_cb %r %r', members, |
299 | | self._text_channel_group_flags) |
| 298 | _logger.debug('__get_all_members_cb %r %r' % (members, |
| 299 | self._text_channel_group_flags)) |
300 | 300 | if self._channel_self_handle in members: |
301 | 301 | members.remove(self._channel_self_handle) |
302 | 302 | |
… |
… |
|
324 | 324 | get_handle_owners_cb(input_handles) |
325 | 325 | |
326 | 326 | def _add_initial_buddies(self, contact_ids): |
327 | | _logger.debug('__add_initial_buddies %r', contact_ids) |
| 327 | _logger.debug('__add_initial_buddies %r' % contact_ids) |
328 | 328 | for contact_id in contact_ids: |
329 | 329 | self._buddies[contact_id] = self._get_buddy(contact_id) |
330 | 330 | self._joined_buddies[contact_id] = self._get_buddy(contact_id) |
… |
… |
|
335 | 335 | def __text_channel_members_changed_cb(self, message, added, removed, |
336 | 336 | local_pending, remote_pending, |
337 | 337 | actor, reason): |
338 | | _logger.debug('__text_channel_members_changed_cb %r', |
| 338 | _logger.debug('__text_channel_members_changed_cb %r' % |
339 | 339 | [added, message, added, removed, local_pending, |
340 | 340 | remote_pending, actor, reason]) |
341 | 341 | if self._channel_self_handle in added: |
… |
… |
|
382 | 382 | self.emit('joined', True, None) |
383 | 383 | return |
384 | 384 | |
385 | | _logger.debug('%r: joining', self) |
| 385 | _logger.debug('%r: joining' % self) |
386 | 386 | |
387 | 387 | self._join_command = _JoinCommand(self.telepathy_conn, |
388 | 388 | self.room_handle) |
… |
… |
|
390 | 390 | self._join_command.run() |
391 | 391 | |
392 | 392 | def share(self, share_activity_cb, share_activity_error_cb): |
393 | | if not self.room_handle is None: |
| 393 | if self.room_handle is not None: |
394 | 394 | raise ValueError('Already have a room handle') |
395 | 395 | |
396 | 396 | self._share_command = _ShareCommand(self.telepathy_conn, self._id) |
… |
… |
|
402 | 402 | |
403 | 403 | def __shared_cb(self, share_activity_cb, share_activity_error_cb, |
404 | 404 | share_command, error): |
405 | | _logger.debug('%r: Share finished %r', self, error) |
| 405 | _logger.debug('%r: Share finished %r' % (self, error)) |
406 | 406 | if error is None: |
407 | 407 | self._joined = True |
408 | 408 | self.room_handle = share_command.room_handle |
… |
… |
|
438 | 438 | dbus_interface=CONN_INTERFACE_ACTIVITY_PROPERTIES) |
439 | 439 | |
440 | 440 | def __share_error_cb(self, share_activity_error_cb, error): |
441 | | logging.debug('%r: Share failed because: %s', self, error) |
| 441 | logging.debug('%r: Share failed because: %s' % (self, error)) |
442 | 442 | share_activity_error_cb(self, error) |
443 | 443 | |
444 | 444 | # GetChannels() wrapper |
… |
… |
|
459 | 459 | channels = [self.telepathy_text_chan.object_path, |
460 | 460 | self.telepathy_tubes_chan.object_path] |
461 | 461 | |
462 | | _logger.debug('%r: bus name is %s, connection is %s, channels are %r', |
463 | | self, bus_name, connection_path, channels) |
| 462 | _logger.debug('%r: bus name is %s, connection is %s, channels are %r' % |
| 463 | (self, bus_name, connection_path, channels)) |
464 | 464 | return bus_name, connection_path, channels |
465 | 465 | |
466 | 466 | # Leaving |
… |
… |
|
470 | 470 | |
471 | 471 | def leave(self): |
472 | 472 | """Leave this shared activity""" |
473 | | _logger.debug('%r: leaving', self) |
| 473 | _logger.debug('%r: leaving' % self) |
474 | 474 | self.telepathy_text_chan.Close() |
475 | 475 | |
476 | 476 | |
… |
… |
|
511 | 511 | dbus_interface=CONNECTION) |
512 | 512 | |
513 | 513 | def __got_handles_cb(self, handles): |
514 | | logging.debug('__got_handles_cb %r', handles) |
| 514 | logging.debug('__got_handles_cb %r' % handles) |
515 | 515 | self.room_handle = handles[0] |
516 | 516 | |
517 | 517 | self._join_command = _JoinCommand(self._connection, self.room_handle) |
… |
… |
|
519 | 519 | self._join_command.run() |
520 | 520 | |
521 | 521 | def __joined_cb(self, join_command, error): |
522 | | _logger.debug('%r: Join finished %r', self, error) |
| 522 | _logger.debug('%r: Join finished %r' % (self, error)) |
523 | 523 | if error is not None: |
524 | 524 | self._finished = True |
525 | 525 | self.emit('finished', error) |
… |
… |
|
597 | 597 | self.emit('finished', error) |
598 | 598 | |
599 | 599 | def __tubes_channel_ready_cb(self, channel): |
600 | | _logger.debug('%r: Tubes channel %r is ready', self, channel) |
| 600 | _logger.debug('%r: Tubes channel %r is ready' % (self, channel)) |
601 | 601 | self.tubes_channel = channel |
602 | 602 | self._tubes_ready() |
603 | 603 | |
604 | 604 | def __text_channel_ready_cb(self, channel): |
605 | | _logger.debug('%r: Text channel %r is ready', self, channel) |
| 605 | _logger.debug('%r: Text channel %r is ready' % (self, channel)) |
606 | 606 | self.text_channel = channel |
607 | 607 | self._tubes_ready() |
608 | 608 | |
… |
… |
|
611 | 611 | self.tubes_channel is None: |
612 | 612 | return |
613 | 613 | |
614 | | _logger.debug('%r: finished setting up tubes', self) |
| 614 | _logger.debug('%r: finished setting up tubes' % self) |
615 | 615 | |
616 | 616 | self._add_self_to_channel() |
617 | 617 | |
618 | 618 | def __text_channel_group_flags_changed_cb(self, added, removed): |
619 | | _logger.debug('__text_channel_group_flags_changed_cb %r %r', added, |
620 | | removed) |
| 619 | _logger.debug('__text_channel_group_flags_changed_cb %r %r' % (added, |
| 620 | removed)) |
621 | 621 | self.text_channel_group_flags |= added |
622 | 622 | self.text_channel_group_flags &= ~removed |
623 | 623 | |
… |
… |
|
629 | 629 | |
630 | 630 | def got_all_members(members, local_pending, remote_pending): |
631 | 631 | _logger.debug('got_all_members members %r local_pending %r ' |
632 | | 'remote_pending %r', members, local_pending, |
633 | | remote_pending) |
| 632 | 'remote_pending %r' % (members, local_pending, |
| 633 | remote_pending)) |
634 | 634 | |
635 | 635 | if self.text_channel_group_flags & \ |
636 | 636 | CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES: |
… |
… |
|
639 | 639 | self_handle = self._global_self_handle |
640 | 640 | |
641 | 641 | if self_handle in local_pending: |
642 | | _logger.debug('%r: We are in local pending - entering', self) |
| 642 | _logger.debug('%r: We are in local pending - entering' % self) |
643 | 643 | group.AddMembers([self_handle], '', |
644 | 644 | reply_handler=lambda: None, |
645 | 645 | error_handler=lambda e: self._join_failed_cb( |
… |
… |
|
675 | 675 | actor, reason): |
676 | 676 | _logger.debug('__text_channel_members_changed_cb added %r removed %r ' |
677 | 677 | 'local_pending %r remote_pending %r channel_self_handle ' |
678 | | '%r', added, removed, local_pending, remote_pending, |
679 | | self.channel_self_handle) |
| 678 | '%r' % (added, removed, local_pending, remote_pending, |
| 679 | self.channel_self_handle)) |
680 | 680 | |
681 | 681 | if self.text_channel_group_flags & \ |
682 | 682 | CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES: |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/activity.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/activity.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/activity.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/activity.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/buddy.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/buddy.py
old
|
new
|
|
24 | 24 | import logging |
25 | 25 | |
26 | 26 | from gi.repository import GObject |
| 27 | from gi.repository import Gio |
27 | 28 | import dbus |
28 | | from gi.repository import GConf |
29 | 29 | from telepathy.interfaces import CONNECTION, \ |
30 | 30 | CONNECTION_INTERFACE_ALIASING, \ |
31 | 31 | CONNECTION_INTERFACE_CONTACTS |
… |
… |
|
243 | 243 | def __init__(self): |
244 | 244 | BaseBuddy.__init__(self) |
245 | 245 | |
246 | | client = GConf.Client.get_default() |
247 | | self.props.nick = client.get_string('/desktop/sugar/user/nick') |
248 | | self.props.color = client.get_string('/desktop/sugar/user/color') |
| 246 | settings = Gio.Settings('org.sugarlabs.user') |
| 247 | self.props.nick = settings.get_string('nick') |
| 248 | self.props.color = settings.get_string('color') |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/buddy.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/buddy.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/buddy.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/buddy.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/connectionmanager.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/connectionmanager.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/connectionmanager.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/connectionmanager.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/__init__.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/__init__.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/__init__.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/__init__.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/presenceservice.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/presenceservice.py
old
|
new
|
|
81 | 81 | for account_path, connection in connections_per_account.items(): |
82 | 82 | if not connection.connected: |
83 | 83 | continue |
84 | | logging.debug('Calling GetActivity on %s', account_path) |
| 84 | logging.debug('Calling GetActivity on %s' % account_path) |
85 | 85 | try: |
86 | 86 | room_handle = connection.connection.GetActivity( |
87 | 87 | activity_id, |
… |
… |
|
90 | 90 | name = 'org.freedesktop.Telepathy.Error.NotAvailable' |
91 | 91 | if e.get_dbus_name() == name: |
92 | 92 | logging.debug("There's no shared activity with the id " |
93 | | "%s", activity_id) |
| 93 | "%s" % activity_id) |
94 | 94 | else: |
95 | 95 | raise |
96 | 96 | else: |
… |
… |
|
162 | 162 | dbus_interface=CONNECTION) |
163 | 163 | return self.get_buddy(account_path, contact_ids[0]) |
164 | 164 | |
165 | | raise ValueError('Unknown buddy in connection %s with handle %d', |
166 | | tp_conn_path, handle) |
| 165 | raise ValueError('Unknown buddy in connection %s with handle %d' % |
| 166 | (tp_conn_path, handle)) |
167 | 167 | |
168 | 168 | def get_owner(self): |
169 | 169 | """Retrieves the laptop Buddy object.""" |
… |
… |
|
198 | 198 | properties['private'] = private |
199 | 199 | |
200 | 200 | if self._activity_cache is not None: |
201 | | raise ValueError('Activity %s is already tracked', |
| 201 | raise ValueError('Activity %s is already tracked' % |
202 | 202 | activity.get_id()) |
203 | 203 | |
204 | 204 | connection_manager = get_connection_manager() |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/presenceservice.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/presenceservice.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/presenceservice.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/presenceservice.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/sugartubeconn.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/sugartubeconn.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/sugartubeconn.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/sugartubeconn.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/tubeconn.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/tubeconn.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/tubeconn.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/presence/tubeconn.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/profile.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/profile.py
old
|
new
|
|
16 | 16 | # Boston, MA 02111-1307, USA. |
17 | 17 | |
18 | 18 | """User settings/configuration loading. |
19 | | |
20 | | DEPRECATED. We are using GConf now to store preferences. |
21 | 19 | """ |
22 | 20 | |
23 | | from gi.repository import GConf |
| 21 | from gi.repository import Gio |
24 | 22 | import os |
25 | 23 | import logging |
26 | 24 | from ConfigParser import ConfigParser |
… |
… |
|
36 | 34 | class Profile(object): |
37 | 35 | """Local user's current options/profile information |
38 | 36 | |
39 | | User settings were previously stored in an INI-style |
40 | | configuration file. We moved to gconf now. The deprected |
41 | | API is kept around to not break activities still using it. |
42 | | |
43 | 37 | The profile is also responsible for loading the user's |
44 | 38 | public and private ssh keys from disk. |
45 | 39 | |
… |
… |
|
68 | 62 | privkey_hash = property(fget=_get_privkey_hash) |
69 | 63 | |
70 | 64 | def is_valid(self): |
71 | | client = GConf.Client.get_default() |
72 | | nick = client.get_string('/desktop/sugar/user/nick') |
73 | | color = client.get_string('/desktop/sugar/user/color') |
| 65 | settings = Gio.Settings('org.sugarlabs.user') |
| 66 | nick = settings.get_string('nick') |
| 67 | color = settings.get_string('color') |
74 | 68 | |
75 | 69 | return nick is not '' and \ |
76 | 70 | color is not '' and \ |
… |
… |
|
140 | 134 | path = os.path.join(env.get_profile_path(), 'config') |
141 | 135 | cp.read([path]) |
142 | 136 | |
143 | | client = GConf.Client.get_default() |
144 | | |
| 137 | settings = Gio.Settings('org.sugarlabs.user') |
145 | 138 | if cp.has_option('Buddy', 'NickName'): |
146 | 139 | name = cp.get('Buddy', 'NickName') |
147 | 140 | # decode nickname from ascii-safe chars to unicode |
148 | 141 | nick = name.decode('utf-8') |
149 | | client.set_string('/desktop/sugar/user/nick', nick) |
| 142 | settings.set_string('nick', nick) |
150 | 143 | if cp.has_option('Buddy', 'Color'): |
151 | 144 | color = cp.get('Buddy', 'Color') |
152 | | client.set_string('/desktop/sugar/user/color', color) |
| 145 | settings.set_string('color', color) |
| 146 | |
153 | 147 | if cp.has_option('Jabber', 'Server'): |
154 | 148 | server = cp.get('Jabber', 'Server') |
155 | | client.set_string('/desktop/sugar/collaboration/jabber_server', |
156 | | server) |
| 149 | settings = Gio.Settings('org.sugarlabs.collaboration') |
| 150 | settings.set_string('jabber-server', server) |
| 151 | |
157 | 152 | if cp.has_option('Date', 'Timezone'): |
158 | 153 | timezone = cp.get('Date', 'Timezone') |
159 | | client.set_string('/desktop/sugar/date/timezone', timezone) |
| 154 | settings = Gio.Settings('org.sugarlabs.date') |
| 155 | settings.set_string('timezone', timezone) |
| 156 | |
| 157 | settings = Gio.Settings('org.sugarlabs.frame') |
160 | 158 | if cp.has_option('Frame', 'HotCorners'): |
161 | 159 | delay = float(cp.get('Frame', 'HotCorners')) |
162 | | client.set_int('/desktop/sugar/frame/corner_delay', int(delay)) |
| 160 | settings.set_int('corner-delay', int(delay)) |
163 | 161 | if cp.has_option('Frame', 'WarmEdges'): |
164 | 162 | delay = float(cp.get('Frame', 'WarmEdges')) |
165 | | client.set_int('/desktop/sugar/frame/edge_delay', int(delay)) |
| 163 | settings.set_int('edge-delay', int(delay)) |
| 164 | |
166 | 165 | if cp.has_option('Server', 'Backup1'): |
167 | 166 | backup1 = cp.get('Server', 'Backup1') |
168 | | client.set_string('/desktop/sugar/backup_url', backup1) |
| 167 | settings = Gio.Settings('org.sugarlabs') |
| 168 | settings.set_string('backup-url', backup1) |
| 169 | |
169 | 170 | if cp.has_option('Sound', 'Volume'): |
170 | 171 | volume = float(cp.get('Sound', 'Volume')) |
171 | | client.set_int('/desktop/sugar/sound/volume', int(volume)) |
| 172 | settings = Gio.Settings('org.sugarlabs.sound') |
| 173 | settings.set_int('volume', int(volume)) |
| 174 | |
| 175 | settings = Gio.Settings('org.sugarlabs.power') |
172 | 176 | if cp.has_option('Power', 'AutomaticPM'): |
173 | 177 | state = cp.get('Power', 'AutomaticPM') |
174 | 178 | if state.lower() == 'true': |
175 | | client.set_bool('/desktop/sugar/power/automatic', True) |
| 179 | settings.set_boolean('automatic', True) |
176 | 180 | if cp.has_option('Power', 'ExtremePM'): |
177 | 181 | state = cp.get('Power', 'ExtremePM') |
178 | 182 | if state.lower() == 'true': |
179 | | client.set_bool('/desktop/sugar/power/extreme', True) |
| 183 | settings.set_boolean('extreme', True) |
| 184 | |
180 | 185 | if cp.has_option('Shell', 'FavoritesLayout'): |
181 | 186 | layout = cp.get('Shell', 'FavoritesLayout') |
182 | | client.set_string('/desktop/sugar/desktop/favorites_layout', |
183 | | layout) |
| 187 | settings = Gio.Settings('org.sugarlabs.desktop') |
| 188 | settings.set_string('favorites-layout', layout) |
184 | 189 | del cp |
185 | 190 | try: |
186 | 191 | os.unlink(path) |
… |
… |
|
199 | 204 | |
200 | 205 | |
201 | 206 | def get_nick_name(): |
202 | | client = GConf.Client.get_default() |
203 | | return client.get_string('/desktop/sugar/user/nick') |
| 207 | settings = Gio.Settings('org.sugarlabs.user') |
| 208 | return settings.get_string('nick') |
204 | 209 | |
205 | 210 | |
206 | 211 | def get_color(): |
207 | | client = GConf.Client.get_default() |
208 | | color = client.get_string('/desktop/sugar/user/color') |
| 212 | settings = Gio.Settings('org.sugarlabs.user') |
| 213 | color = settings.get_string('color') |
209 | 214 | return XoColor(color) |
210 | 215 | |
211 | 216 | |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/profile.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/profile.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/profile.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/profile.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/discover.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/discover.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/discover.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/discover.pyo son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/__init__.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/__init__.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/__init__.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/__init__.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/uitree.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/uitree.py
old
|
new
|
|
47 | 47 | if e.code == Atspi.Error.IPC: |
48 | 48 | continue |
49 | 49 | |
50 | | logging.error("GError code %d", e.code) |
| 50 | logging.error("GError code %d" % e.code) |
51 | 51 | raise |
52 | 52 | |
53 | 53 | expect_none = kwargs.get("expect_none", False) |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/uitree.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/uitree.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/uitree.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/uitree.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/unittest.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/unittest.py
old
|
new
|
|
28 | 28 | |
29 | 29 | from sugar3.test import uitree |
30 | 30 | |
| 31 | import dbus |
| 32 | from dbus.mainloop.glib import DBusGMainLoop |
| 33 | DBusGMainLoop(set_as_default=True) |
| 34 | bus = dbus.SessionBus() |
| 35 | |
31 | 36 | |
32 | 37 | class UITestCase(unittest.TestCase): |
| 38 | |
| 39 | def __init__(self, *args, **kwargs): |
| 40 | super(UITestCase, self).__init__(*args, **kwargs) |
| 41 | self.bundle_id = None |
| 42 | |
33 | 43 | def setUp(self): |
34 | 44 | logger = logging.getLogger() |
35 | 45 | self._orig_level = logger.getEffectiveLevel() |
… |
… |
|
46 | 56 | |
47 | 57 | try: |
48 | 58 | yield |
| 59 | except: |
| 60 | logging.debug(uitree.get_root().dump()) |
| 61 | raise |
| 62 | finally: |
| 63 | process.terminate() |
| 64 | |
| 65 | @contextmanager |
| 66 | def run_activity(self): |
| 67 | if self.bundle_id is not None: |
| 68 | process = subprocess.Popen(["sugar-launch", self.bundle_id]) |
| 69 | else: |
| 70 | print "No bundle_id specified." |
| 71 | return |
| 72 | |
| 73 | try: |
| 74 | yield |
49 | 75 | except: |
50 | 76 | logging.debug(uitree.get_root().dump()) |
51 | 77 | raise |
-
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/unittest.pyc y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/unittest.pyc son distintos
Los ficheros binarios 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/unittest.pyo y 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/test/unittest.pyo son distintos
diff -ru 0.100/sugar-toolkit-gtk3-0.99.4.git20131009-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/util.py 0.102/sugar-toolkit-gtk3-0.101-1.olpcau.x86_64/usr/lib/python2.7/site-packages/sugar3/util.py
old
|
new
|
|
307 | 307 | if path is None: |
308 | 308 | fd, path = tempfile.mkstemp() |
309 | 309 | os.close(fd) |
310 | | logging.debug('TempFilePath created %r', path) |
| 310 | logging.debug('TempFilePath created %r' % path) |
311 | 311 | |
312 | 312 | if path in _tracked_paths: |
313 | 313 | _tracked_paths[path] += 1 |
… |
… |
|
322 | 322 | |
323 | 323 | if os.path.exists(self): |
324 | 324 | os.unlink(self) |
325 | | logging.debug('TempFilePath deleted %r', self) |
| 325 | logging.debug('TempFilePath deleted %r' % self) |
326 | 326 | else: |
327 | | logging.warning('TempFilePath already deleted %r', self) |
| 327 | logging.warning('TempFilePath already deleted %r' % self) |
328 | 328 | else: |
329 | 329 | _tracked_paths[self] -= 1 |
330 | 330 | |