[PATCH] Journal xobundle removal wont remove installed one

Martin Abente mabente at paraguayeduca.org
Wed Jul 28 17:53:30 EDT 2010


Journal Xo bundles removal also removes the installed activity. There
are many scenarios where this behavior is it not desired. Therefore it
needs to be changed.
---
 src/jarabe/journal/palettes.py |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/src/jarabe/journal/palettes.py b/src/jarabe/journal/palettes.py
index 0e7702d..7c3e5ff 100644
Index: src/jarabe/journal/palettes.py
===================================================================
--- a/src/jarabe/journal/palettes.py
+++ b/src/jarabe/journal/palettes.py
@@ -128,11 +128,6 @@
         self._temp_file_path = None

     def __erase_activate_cb(self, menu_item):
-        registry = bundleregistry.get_registry()
-
-        bundle = misc.get_bundle(self._metadata)
-        if bundle is not None and registry.is_installed(bundle):
-            registry.uninstall(bundle)
         model.delete(self._metadata['uid'])

     def __detail_activate_cb(self, menu_item):

This is probably the simplest fix.

The bundle installation event records were kept in the Journal  as a record
of learner events, but as we've experienced, they provide little, lasting
value and were wired with destructive behavior.

(When we implement Journal grouping or multi Journals, they could presumably
have counterpart entries in the 'System' Journal filter, even after they
were scrubbed from 'My' Journal.)

   --Fred

post script:
We need to be careful with confusing terminology with Activities, bundles,
and events.
The code names, here, provide some guidance: (Journal) item metadata and
(Activity) bundle.

--0016367b6f0008dcec048c7c5468
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div class=3D"gmail_quote">On Wed, Jul 28, 2010 at 12:14 PM, Frederick Gros=
e <span dir=3D"ltr">&lt;<a href=3D"mailto:fgrose at gmail.com">fgrose at gmail.co=
m</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class=3D"gmail_quote"><div class=3D"im">On Wed, Jul 28, 2010 at 10:02 =
AM, Daniel Castelo <span dir=3D"ltr">&lt;<a href=3D"mailto:dcastelo at plan.ce=
ibal.edu.uy" target=3D"_blank">dcastelo at plan.ceibal.edu.uy</a>&gt;</span> w=
rote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
<div class=3D"gmail_quote"><div>On Tue, Jul 27, 2010 at 11:51 PM, Frederick=
 Grose <span dir=3D"ltr">&lt;<a href=3D"mailto:fgrose at gmail.com" target=3D"=
_blank">fgrose at gmail.com</a>&gt;</span> wrote:</div></div></blockquote></di=
v></div>

</blockquote><div>=A0</div></div><div class=3D"gmail_quote">{...}=A0</div><=
div class=3D"gmail_quote"><br></div><div class=3D"gmail_quote"><blockquote =
class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid=
;padding-left:1ex;">

<div class=3D"gmail_quote"><div class=3D"im"><blockquote class=3D"gmail_quo=
te" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"=
><div class=3D"gmail_quote"><div><blockquote class=3D"gmail_quote" style=3D=
"border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-=
left:1ex">

<div class=3D"gmail_quote"><div>See=A0<a href=3D"https://bugs.sugarlabs.org=
/ticket/1512" target=3D"_blank">https://bugs.sugarlabs.org/ticket/1512</a><=
/div>

</div></blockquote></div><div><br>Great. Thanks!<br>
The trac ticket suggest a new behavour:<br>
<br>
&quot;The download event record, as a system event, might have a &#39;hide =
event&#39;
option or not be erasable. The code bundle behind the event should,
perhaps, only be erased from the Home list view
(installed-Activity-code-bundle management), while system or Activity
events and their associated object instances are managed from the
Journal of Activity event instances.&quot;<br>
<br>
Which is the next step that I should follow to solve this issue? I
suppose that is to discuss in this email list which could be the best
solution.</div></div></blockquote><div><br></div></div><div>As noted, the p=
roblem of inadvertent deletion of updated or newly added Activity bundles m=
ay occur in the Journal or in the Home list view (through the erase action =
in an extended palette). =A0The most comprehensive solution might involve g=
rouping of Journal items [1], but that won&#39;t be quick.</div>


<div><br></div><div>A quicker solution may be to recognize the Journal entr=
y type or kind in the Journal (if that is sufficient) and hide or remove th=
e &#39;erase&#39; entry action from the palette in the Journal. =A0This wou=
ld force intentional erasure to occur in the Home list view, where the inte=
nt may be clearer.</div>


<div><br></div><div>Alternatively, erasure from the Journal could be disabl=
ed for these entries unless they were in a filtered, Journal view=A0(by the=
ir kind, a kind which currently is not available in the filter list).</div>


<div><br></div><div>=A0=A0 =A0 =A0--Fred</div><div><br></div><div>[1] This =
discussion thread,=A0<a href=3D"http://lists.sugarlabs.org/archive/sugar-de=
vel/2010-July/025615.html" target=3D"_blank">http://lists.sugarlabs.org/arc=
hive/sugar-devel/2010-July/025615.html</a>, and this wiki page,=A0<a href=
=3D"http://wiki.sugarlabs.org/go/Talk:Features/Content_support" target=3D"_=
blank">http://wiki.sugarlabs.org/go/Talk:Features/Content_support</a>, desc=
ribes a Journal group design for supporting Activity and content grouping.<=
/div>

</div></blockquote><div><br></div><div>From=A0<a href=3D"http://bugs.sugarl=
abs.org/ticket/1512#comment:4">http://bugs.sugarlabs.org/ticket/1512#commen=
t:4</a>=A0:</div><div><br></div><div>Replying to FGrose:</div></div><div cl=
ass=3D"gmail_quote">

<div>&quot;This behavior in the Journal is inconsistent with other &#39;ins=
talled&#39; Activities, which are erased (un-installed) with a warning dial=
og from the Home list view.&quot;<br>=A0</div></div><blockquote class=3D"we=
bkit-indent-blockquote" style=3D"margin: 0 0 0 40px; border: none; padding:=
 0px;">

</blockquote>I agree with this. In the practice it gets very confusing for =
everyone, mostly because there is no warning at all.<br><br><div class=3D"g=
mail_quote">I really do not share the idea of bounding the installed activi=
ty with the bundle that it was used for &quot;installing&quot;. In the prac=
tice (again) the current behavior just produces an unnecessary storage spac=
e waste (mostly because there could be many bundles in the journal for the =
same activity).</div>

<blockquote class=3D"webkit-indent-blockquote gmail_quote" style=3D"margin-=
top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border=
-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style:=
 solid; padding-left: 1ex; ">

</blockquote><div class=3D"gmail_quote"><div><br></div></div><div class=3D"=
gmail_quote">The solution I found for this issue is jut not to delete de in=
stalled version. Please see the attachment.=A0<div>(here:)</div><div>From d=
cafb30f3e96eaf0beaa41277d49f1bf8f0c3587 Mon Sep 17 00:00:00 2001</div>

<div>From: Martin Abente &lt;<a href=3D"mailto:mabente at paraguayeduca.org">m=
abente at paraguayeduca.org</a>&gt;</div><div>Date: Wed, 28 Jul 2010 17:53:30 =
-0400</div><div>Subject: [PATCH] Journal xobundle removal wont remove insta=
lled one</div>

<div>Organization: Paraguay Educa</div><div><br></div><div>Journal Xo bundl=
es removal also removes the installed activity. There</div><div>are many sc=
enarios where this behavior is it not desired. Therefore it</div><div>
needs to be changed.</div>
<div>---</div><div>=A0src/jarabe/journal/palettes.py | =A0 =A05 -----</div>=
<div>=A01 files changed, 0 insertions(+), 5 deletions(-)</div><div><br></di=
v><div>diff --git a/src/jarabe/journal/palettes.py b/src/jarabe/journal/pal=
ettes.py</div>

<div>index 0e7702d..7c3e5ff 100644</div><div>Index: src/jarabe/journal/pale=
ttes.py</div><div>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</div>=
<div>--- a/src/jarabe/journal/palettes.py</div><div>+++ b/src/jarabe/journa=
l/palettes.py</div>

<div>@@ -128,11 +128,6 @@</div><div>=A0=A0 =A0 =A0 =A0 self._temp_file_path=
 =3D None</div><div>=A0</div><div>=A0=A0 =A0 def __erase_activate_cb(self, =
menu_item):</div><div>- =A0 =A0 =A0 =A0registry =3D bundleregistry.get_regi=
stry()</div><div>-</div><div>

- =A0 =A0 =A0 =A0bundle =3D misc.get_bundle(self._metadata)</div><div>- =A0=
 =A0 =A0 =A0if bundle is not None and registry.is_installed(bundle):</div><=
div>- =A0 =A0 =A0 =A0 =A0 =A0registry.uninstall(bundle)</div><div>=A0=A0 =
=A0 =A0 =A0 model.delete(self._metadata[&#39;uid&#39;])</div>

<div>=A0</div><div>=A0=A0 =A0 def __detail_activate_cb(self, menu_item):</d=
iv><div><br></div><div>This is probably the=A0simplest=A0fix.</div><div><br=
></div><div>The bundle installation event records were kept in the Journal =
=A0as a record of learner events, but as we&#39;ve experienced, they provid=
e little, lasting value and were wired with destructive behavior.</div>

<div><br></div><div>(When we implement Journal grouping or multi Journals, =
they could presumably have counterpart entries in the &#39;System&#39; Jour=
nal filter, even after they were scrubbed from &#39;My&#39; Journal.)</div>

<div><br></div><div>=A0=A0 --Fred</div><div><br></div><div>post script:</di=
v><div>We need to be careful with confusing terminology with Activities, bu=
ndles, and events.</div><div>The code names, here, provide some guidance: (=
Journal) item metadata and (Activity) bundle.=A0</div>

</div><br>

--0016367b6f0008dcec048c7c5468--


More information about the Sugar-devel mailing list