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
733 | 733 | # enable collaboration |
734 | 734 | self.activity_button.page.share.props.sensitive = True |
735 | 735 | |
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) | |
737 | 743 | |
738 | 744 | # FIXME: This should obviously be fixed properly |
739 | 745 | GObject.timeout_add_seconds( |