Opened 11 years ago

Closed 11 years ago

Last modified 8 years ago

#1701 closed defect (duplicate)

Activity version: Add minor field

Reported by: erikos Owned by: tomeu
Priority: Urgent Milestone:
Component: Sugar Version: Git as of bugdate
Severity: Unspecified Keywords:
Cc: godiard Distribution/OS: Unspecified
Bug Status: New

Description

Like discussed in the email thread we want to add a minor part to the activity version. The idea is to reuse the existing activity_version field as the major part (integer). A new field will be introduced that will be the minor part (fraction) of the new floating point activity version.

Users before 0.88 will only see the major part and learners using a Sugar version >= 0.88 will see the minor part, too.

The patch does the following:

  • a new field is added to the activity.info file (activity_minor_version)
  • internally the activity version will become represented as a float, constructing the value of the minor and major part if the minor part is available. Otherwise the activity version is converted to a float
  • when reading the favorites values from the config file the version is converted to a float, to make sure the values can be compared

Testing:

  • add the minor part to an activity.info file of an activity
  • you should be able to change the favorite status in the activities list of new and old style activities
  • you should be able to install activities (check newer and older versions of the same activity, too)

Attachments (2)

activity_version_shell.patch (1.1 KB) - added by erikos 11 years ago.
patch for sugar
activity_version_toolkit.patch (1.5 KB) - added by erikos 11 years ago.
patch for sugar-toolkit

Download all attachments as: .zip

Change History (10)

Changed 11 years ago by erikos

patch for sugar

Changed 11 years ago by erikos

patch for sugar-toolkit

comment:1 Changed 11 years ago by tomeu

  • Keywords r+ added; r? removed
+        return '%s %s' % (bundle_id, float(version))

AFAICS, version will be already a float.

+        self._activity_minor_version = 0

Can be just a local variable, as it's not used outside the scope it is created.

+                                           Decimal(self._activity_minor_version)/10)

Missing spaces around the operator.

r+ with the obvious changes

comment:2 Changed 11 years ago by dsd

The float logic doesn't look correct.
It will make versions 63.1 and 63.10 be regarded as equal, and will make version 63.2 be regarded as newer than 63.15

comment:3 Changed 11 years ago by alsroot

I had an issue that after applying the patch not all the activities

were shown in the ring and activity list.

current patch doesn't import existed favorite_activities file correctly, since it contains integer numbers thus ring view is empty but I didn't find any lost activities in activities list

comment:4 Changed 11 years ago by erikos

  • Milestone changed from 0.88 to 0.90

Thanks for the feedback. I did not have a chance to look at the patch to make improvements, so I will move it out to the next release.

comment:5 Changed 11 years ago by erikos

  • Keywords r! added; r+ removed

The patch does not work as is, we need a new patch, that is why I removed the r+ tag.

comment:6 Changed 11 years ago by sascha_silbe

  • Cc godiard added

godiard has a new set of patches attached to #2425. The latter ticket is now closed as dupe, please continue discussion in this ticket.

comment:7 Changed 11 years ago by erikos

  • Keywords r! removed
  • Resolution set to duplicate
  • Status changed from new to closed

Please use #2425 now. The patches in here are obsoleted and I will not keep on working on them since the new approach is the right one.

comment:8 Changed 8 years ago by dnarvaez

  • Milestone 0.90 deleted

Milestone 0.90 deleted

Note: See TracTickets for help on using tickets.