Codebase list sugar-read-activity / 141d046
Copy file in read_file method I need copy the file to the instance directory, the path provided by the datastore dissapear later in the life of the activity. Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org> Gonzalo Odiard 10 years ago
1 changed file(s) with 7 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
733733 # enable collaboration
734734 self.activity_button.page.share.props.sensitive = True
735735
736 self._load_document('file://' + file_path)
736 # we need copy the file to a new place, the file_path disappear
737 extension = os.path.splitext(file_path)[1]
738 tempfile = os.path.join(self.get_activity_root(), 'instance',
739 'tmp%i%s' % (time.time(), extension))
740 os.link(file_path, tempfile)
741
742 self._load_document('file://' + tempfile)
737743
738744 # FIXME: This should obviously be fixed properly
739745 GObject.timeout_add_seconds(