[Sugar-devel] [Dextrose] [sugar PATCH] sl#3605: Do not rely on 'mountpoint' property being present in the metadata per entry. Instead use the global API.

Ajay Garg ajay at activitycentral.com
Fri May 18 10:38:05 EDT 2012


Hi Anish.

Here are the steps to be followed to reproduce the issue ::

a)
Ensure that the "Journal" and "Documents" (and "Shares" folder, if the
Share-With-Many/1-to-N feature patch has been applied) are empty.

b)
Copy a file (I tried with a mp3) to a USB drive, from a non-XO machine.

c)
Insert the USB drive in the XO.

d)
Copy the file (of step b) ) to "Documents" folder.

e)
View Details of the copied entry (in "Documents").

f)
There should be the exception in the logs. Moreover, the "Description"
field should be empty in the "Details View" (this field ought to be
"/media/<name of USB drive>").


As already mentioned in the patch-description. the Batch-Operations patch (
http://patchwork.sugarlabs.org/patch/1205/) must be applied, prior to
applying this patch; else this patch won't apply cleanly.


Thanks and Regards,
Ajay


On Thu, May 17, 2012 at 10:32 PM, Anish Mangal <anish at activitycentral.com>wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Wednesday 16 May 2012 07:20:08 PM IST, Ajay Garg wrote:
> > Please note, that the global API ("get_mount_point()" and
> "set_mount_point()") were
> > introduced as a part of batch-operations feature, for which the patch is
> located at ::
> > http://patchwork.sugarlabs.org/patch/1205/
> >
> > Also, since the bug has been diagnosed on sugar-mainline master (on
> which the batch-operations
> > patch has not been pushed, yet ;-) ), so this (ticket sl#3605) does not
> seem to be a
> > regression; it seems to be genuinely present right from the start.
> >
> >  src/jarabe/journal/model.py |    8 +++++++-
> >  1 files changed, 7 insertions(+), 1 deletions(-)
> >
> > diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
> > index 527f78d..1f042db 100644
> > --- a/src/jarabe/journal/model.py
> > +++ b/src/jarabe/journal/model.py
> > @@ -1003,7 +1003,13 @@ def is_editable(metadata):
> >      if metadata.get('mountpoint', '/') == '/':
> >          return True
> >      else:
> > -        return os.access(metadata['mountpoint'], os.W_OK)
> > +        # sl#3605: Instead of relying on mountpoint property being
> > +        #          present in the metadata, use journalactivity api.
> > +        #          This would work seamlessly, as "Details View' is
> > +        #          called, upon an entry in the context of a singular
> > +        #          mount-point.
> > +        from jarabe.journal.journalactivity import get_mount_point
> > +        return os.access(get_mount_point(), os.W_OK)
> >
> >
> >  def get_documents_path():
>
> Could you give directions as to what triggers the exception (and
> whether another patch needs to be applied first) before this one is
> applied.
>
> I tried a very basic test on current jhbuild. Opening the details view
> of a journal entry in documents folder doesnt trigger the exception.
> Maybe I'm missing something. :)
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJPtS8SAAoJEBoxUdDHDZVp2bIIAISNLWGYTTN4Ld/6aNVF/Gfm
> DpbWNarMIywujKf3iXtAx83rfpt2rnBsu20htuf9LU6ALndDckqHneFDymGNv1+P
> HyDcb84HNQ5iAgAvnW8ty1sAQYrLsH13TLrRuTiGTVKH6QEZRvp4PAIIc06FdJjV
> 66ouqh0q0QfbIuP9orKSX2WAtlwt94NwuxmrrvqpfeMWykwpib4GTdh7eaMtLjlC
> 6x5pe1IYlcf8mzvxULNOoHasm4UhJtOTS8ozazmVHJa5THu30rRb/1/Y1bMX7/n3
> aDPCZ/LRW0N5vUVavBb49Xf2ttwe7CQkpYJl95sbQDTPdvgm5UfPtRgEshcu29A=
> =Ncsj
> -----END PGP SIGNATURE-----
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120518/0cbc0cb8/attachment.html>


More information about the Sugar-devel mailing list