Use activity root to generate the collector file - SL #4407
Signed-off-by: Frederick Grose <fgrose@gmail.com>
Reviewed-by: Gonzalo Odiard <gonzalo@laptop.org>
Gonzalo Odiard
10 years ago
636 | 636 | def _on_send_button_clicked_cb(self, button): |
637 | 637 | identifier = str(int(time.time())) |
638 | 638 | filename = '%s.zip' % identifier |
639 | filepath = os.path.join(activity.get_activity_root(), filename) | |
639 | 640 | success = True |
640 | 641 | try: |
641 | filename = self._collector.write_logs(archive=filename, logbytes=0) | |
642 | self._collector.write_logs(archive=filepath, logbytes=0) | |
642 | 643 | except: |
643 | 644 | success = False |
644 | 645 | |
663 | 664 | } |
664 | 665 | for k, v in metadata.items(): |
665 | 666 | jobject.metadata[k] = v |
666 | jobject.file_path = os.path.join(activity.get_bundle_path(), filename) | |
667 | jobject.file_path = filepath | |
667 | 668 | datastore.write(jobject) |
668 | 669 | self._last_log = jobject.object_id |
669 | 670 | jobject.destroy() |
670 | 671 | activity.show_object_in_journal(self._last_log) |
671 | os.remove(filename) | |
672 | os.remove(filepath) |