Re: [Sugar-devel] [PATCH sugar] don't delete bundles on storage media (SL #2456)

2010-11-30 Thread Sascha Silbe
Excerpts from Simon Schampijer's message of Mon Nov 29 13:53:17 +0100 2010:

> Acked-by: Simon Schampijer 

Pushed as a2e1f09 (master) /  ddedea8 (sucrose-0.90), thanks!

> I think is a candidate for a backport (use case: handing an activity 
> bundle to another learner via an external device).

Most definitely, given it was originally reported [1] by an actual 0.90
user. :)

Sascha

[1] http://lists.sugarlabs.org/archive/sugar-devel/2010-October/027981.html
--
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] don't delete bundles on storage media (SL #2456)

2010-11-29 Thread Simon Schampijer

On 10/17/2010 12:51 PM, Sascha Silbe wrote:

model.get_file() already wraps data store checkouts in TempFilePath. Because
misc.get_bundle() unconditionally wrapped the path returned by
model.get_file() in TempFilePath as well, bundles located on storage media
(which are referenced by their actual location, not copied or linked) were
deleted after misc.get_bundle() finished.

Signed-off-by: Sascha Silbe


Acked-by: Simon Schampijer 

This one looks good to me. I made sure I had the same results as well.

I think is a candidate for a backport (use case: handing an activity 
bundle to another learner via an external device).


Regards,
   Simon
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH sugar] don't delete bundles on storage media (SL #2456)

2010-10-17 Thread Sascha Silbe
model.get_file() already wraps data store checkouts in TempFilePath. Because
misc.get_bundle() unconditionally wrapped the path returned by
model.get_file() in TempFilePath as well, bundles located on storage media
(which are referenced by their actual location, not copied or linked) were
deleted after misc.get_bundle() finished.

Signed-off-by: Sascha Silbe 
---
 src/jarabe/journal/misc.py |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py
index 4fcfc60..1817df3 100644
--- a/src/jarabe/journal/misc.py
+++ b/src/jarabe/journal/misc.py
@@ -108,21 +108,21 @@ def get_date(metadata):
 def get_bundle(metadata):
 try:
 if is_activity_bundle(metadata):
-file_path = util.TempFilePath(model.get_file(metadata['uid']))
+file_path = model.get_file(metadata['uid'])
 if not os.path.exists(file_path):
 logging.warning('Invalid path: %r', file_path)
 return None
 return ActivityBundle(file_path)
 
 elif is_content_bundle(metadata):
-file_path = util.TempFilePath(model.get_file(metadata['uid']))
+file_path = model.get_file(metadata['uid'])
 if not os.path.exists(file_path):
 logging.warning('Invalid path: %r', file_path)
 return None
 return ContentBundle(file_path)
 
 elif is_journal_bundle(metadata):
-file_path = util.TempFilePath(model.get_file(metadata['uid']))
+file_path = model.get_file(metadata['uid'])
 if not os.path.exists(file_path):
 logging.warning('Invalid path: %r', file_path)
 return None
-- 
1.7.1

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel