[Sugar-devel] [read PATCH] sdxo#4448: Revert back to the earlier behaviour, of re-computing filehash every time when needed.

Ajay Garg ajay at activitycentral.com
Thu Feb 28 11:05:32 EST 2013


Hi Gonzalo.

1)
XO-A shares a document.

2)
XO-B joins the activity.

3)
Now, at XO-B, there is a call to "write_file" for the "just-loaded"
document; however, the "self.filehash" being None, fails to save.
There are also other issues with "self.filehash" as part of
sharing-wokflows.


On Thu, Feb 28, 2013 at 9:32 PM, Gonzalo Odiard <gonzalo at laptop.org> wrote:

> Hmm, may be I misreaded.
> What is trying to solve this patch?
>
> Gonzalo
>
>
> On Thu, Feb 28, 2013 at 1:01 PM, Gonzalo Odiard <gonzalo at laptop.org>wrote:
>
>> How is this related with collaboration?
>>
>> Gonzalo
>>
>>
>> On Thu, Feb 28, 2013 at 12:23 PM, Ajay Garg <ajay at activitycentral.com>wrote:
>>
>>> This reverts commit 21af7cc988320c8a53c946253d52fe1bb6ff9a7e.
>>>
>>> Thankfully, we do not lose anything, as the commit
>>> 21af7cc988320c8a53c946253d52fe1bb6ff9a7e was just an "optimisation"-commit;
>>> we don't lose anything on the frontend/backend/anywhere :)
>>>
>>>  readactivity.py        | 10 ++--------
>>>  1 files changed, 2 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/readactivity.py b/readactivity.py
>>> index beed2b4..e0f0cf8 100644
>>> --- a/readactivity.py
>>> +++ b/readactivity.py
>>> @@ -710,7 +710,6 @@ class ReadActivity(activity.Activity):
>>>          self.metadata['Read_search'] = \
>>>                  self._edit_toolbar._search_entry.props.text
>>>          self.metadata['activity'] = self.get_bundle_id()
>>> -        self.metadata['filehash'] = self.filehash
>>>
>>>          os.link(self._tempfile, file_path)
>>>
>>> @@ -856,13 +855,8 @@ class ReadActivity(activity.Activity):
>>>          self._view_toolbar.set_view(self._view)
>>>          self._edit_toolbar.set_view(self._view)
>>>
>>> -
>>> -        self.filehash = self.metadata.get('filehash', None)
>>> -        if self.filehash is None:
>>> -            self.filehash = get_md5(filepath)
>>> -            logging.error('Calculate hash %s', self.filehash)
>>> -
>>> -        self._bookmarkmanager = BookmarkManager(self.filehash)
>>> +        filehash = get_md5(filepath)
>>> +        self._bookmarkmanager = BookmarkManager(filehash)
>>>          self._bookmarkmanager.connect('added_bookmark',
>>>                  self._added_bookmark_cb)
>>>          self._bookmarkmanager.connect('removed_bookmark',
>>> --
>>> 1.7.11.7
>>>
>>> _______________________________________________
>>> Sugar-devel mailing list
>>> Sugar-devel at lists.sugarlabs.org
>>> http://lists.sugarlabs.org/listinfo/sugar-devel
>>>
>>
>>
>


-- 
Regards,

Ajay Garg
Dextrose Developer
Activity Central: http://activitycentral.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130228/2d9f008f/attachment.html>


More information about the Sugar-devel mailing list