diff options
author | Aneesh Dogra <lionaneesh@gmail.com> | 2012-12-17 16:29:34 (GMT) |
---|---|---|
committer | Aneesh Dogra <lionaneesh@gmail.com> | 2012-12-17 16:33:12 (GMT) |
commit | 4bb29584620c6c65a2a12d32f6d69d788f32b0ac (patch) | |
tree | 6afb0724812111943d53c9f079f1aa100a5f5565 | |
parent | 18cadf8bf5443b1aa4ff6f835fed460a4d532efc (diff) |
Fix the bug with drag & drop.
-rw-r--r-- | infoslicer/processing/Journal_Getter.py | 2 | ||||
-rw-r--r-- | infoslicer/widgets/Journal_Gallery_View.py | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/infoslicer/processing/Journal_Getter.py b/infoslicer/processing/Journal_Getter.py index 763b3cb..a4cb4f3 100644 --- a/infoslicer/processing/Journal_Getter.py +++ b/infoslicer/processing/Journal_Getter.py @@ -24,6 +24,6 @@ def get_starred_images(): title = dsobj.metadata['title'] else: title = '' - images.append((dsobj.file_path, title)) + images.append((str(dsobj.file_path), str(title))) return images diff --git a/infoslicer/widgets/Journal_Gallery_View.py b/infoslicer/widgets/Journal_Gallery_View.py index 7191d80..078cba6 100644 --- a/infoslicer/widgets/Journal_Gallery_View.py +++ b/infoslicer/widgets/Journal_Gallery_View.py @@ -16,6 +16,7 @@ from gi.repository import GObject from gi.repository import GdkPixbuf import os import cPickle +import pickle import logging from Editable_Textbox import Editable_Textbox @@ -152,13 +153,10 @@ class Journal_Gallery_View( Gtk.HBox ): logger.debug('############# Journal_Journal_Gallery_View.drag_data_get_event') atom = Gdk.atom_intern("section", only_if_exists=False) imagedata = Picture_Data(self.source_article_id, - self.image_list[self.current_index][0], None) + self.image_list[self.current_index][0]) captiondata = Sentence_Data(0, self.source_article_id, 0, 0, 0, self.image_list[self.current_index][1]) paragraph1data = Paragraph_Data(0, self.source_article_id, 0, 0, [imagedata]) paragraph2data = Paragraph_Data(0, self.source_article_id, 0, 0, [captiondata]) sectionsdata = [Section_Data(0, self.source_article_id, 0, [paragraph1data, paragraph2data])] - print sectionsdata - string = cPickle.dumps(sectionsdata) #XXX: Here it generates a weird error. - # Even though sectionsdata is not a string, cPickle prints out "cannot pickle - # string objects" + string = cPickle.dumps(sectionsdata) selection_data.set(atom, 8, string) |