Your patch fixes sugar-datastore and this fixes sugar-toolkit. I don't know why exists 2 different datastore.py but sugar-toolkit's datastore.py is used by activities to interface with the Journal.<br><br>Your patch is actually included in Dextrose.<br>

<br>cheers,<br>Esteban.<br><br><br><div class="gmail_quote">2010/10/13 Andrés Ambrois <span dir="ltr"><<a href="mailto:andresambrois@gmail.com">andresambrois@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im">On Wednesday, October 13, 2010 09:37:01 am Esteban Bordon wrote:<br>
> I attach a patch to fix Journal sort by creation date. It sets ctime=now<br>
> when a Journal entry is created.<br>
><br>
> Index: sugar-toolkit-0.88.1/src/sugar/datastore/datastore.py<br>
> ===================================================================<br>
> --- sugar-toolkit-0.88.1.orig/src/sugar/datastore/datastore.py<br>
> +++ sugar-toolkit-0.88.1/src/sugar/datastore/datastore.py<br>
> @@ -305,6 +305,8 @@ def create():<br>
>      metadata = DSMetadata()<br>
>      metadata['mtime'] = datetime.now().isoformat()<br>
>      metadata['timestamp'] = int(time.time())<br>
> +    if not metadata.get('ctime'):<br>
> +        metadata['ctime'] = time.strftime("%Y-%m-%dT%H:%M:%S",<br>
> time.localtime())<br>
>      return DSObject(object_id=None, metadata=metadata, file_path=None)<br>
<br>
</div>It's strange that this line is not present in Dextrose. What build is this?<br>
This change is present patch listed in [0].<br>
<br>
In any case, the sorting patches were much improved in mainline (we're using a<br>
"creation_time" property now), maybe it would be better to cherry pick those<br>
commits instead of forking the development of this feature? I don't know what<br>
the backport/bugfix policy for Dextrose is in these cases.<br>
<br>
This patch is correct of course, but I wonder what other stuff may be missing<br>
from my series...<br>
<br>
[0] <a href="http://wiki.sugarlabs.org/go/Dextrose/TODO/Patches" target="_blank">http://wiki.sugarlabs.org/go/Dextrose/TODO/Patches</a><br>
(sizelist-0004-Add-ctime-property-to-the-index-and-datastore.patch)<br>
<div class="im"><br>
><br>
> cheers,<br>
> Esteban.<br>
><br>
> 2010/10/13 Bernie Innocenti <<a href="mailto:bernie@codewiz.org">bernie@codewiz.org</a>><br>
><br>
> > On Tue, 2010-10-12 at 13:40 -0200, Esteban Bordon wrote:<br>
> > > Hi all.<br>
> > ><br>
> > > I was making a patch for Journal sort by creation date for Dextrose<br>
> > > and I found 2 datastore.py in the OS.<br>
> > ><br>
> > > /usr/lib/python2.6/site-packages/sugar/datastore.py and<br>
> > > /usr/lib/python2.6/site-packages/carquinyol/datastore.py<br>
> > ><br>
> > > One of those belong to sugar-toolkit and the other one belong to<br>
> > > sugar-datastore. The second includes a patch for this issue but it<br>
> > > doesn't shows correctly in Journal.<br>
> > ><br>
> > > must I to change sugar-toolkit?<br>
> ><br>
> > The datastore.py in sugar-toolkit is used by activities to interface<br>
> > with the Journal (wrapping its dbus protocol). The datastore.py in<br>
> > carquinyol is the actual datastore.<br>
> ><br>
> > Adding Sascha and Andres on cc, in case they want to add something.<br>
> ><br>
> > --<br>
> >   // Bernie Innocenti - <a href="http://codewiz.org/" target="_blank">http://codewiz.org/</a><br>
> >  \X/  Sugar Labs       - <a href="http://sugarlabs.org/" target="_blank">http://sugarlabs.org/</a><br>
> ><br>
> ><br>
><br>
<br>
</div>--<br>
<font color="#888888">  -Andrés<br>
</font></blockquote></div><br>