diff --git a/activity/activity.info b/activity/activity.info index 1eab3f9..81b2313 100644 --- a/activity/activity.info +++ b/activity/activity.info @@ -3,9 +3,10 @@ bundle_id = org.laptop.sugar.ReadActivity icon = activity-read exec = sugar-activity readactivity.ReadActivity -activity_version = 115 +activity_version = 117 mime_types = application/pdf;image/vnd.djvu;image/x.djvu;image/tiff;application/epub+zip;text/plain;application/zip;application/x-cbz license = GPLv2+ summary = Use this activity when you are ready to read! Remember to flip your computer around to feel like you are really holding a book! categories = language documents media system repository = https://github.com/godiard/read-activity.git +max_participants = 10 diff --git a/read_v1.db b/read_v1.db deleted file mode 100644 index fac21dd..0000000 Binary files a/read_v1.db and /dev/null differ diff --git a/readdb.py b/readdb.py index 28d09f6..473be9f 100644 --- a/readdb.py +++ b/readdb.py @@ -45,11 +45,21 @@ # Situation 1: DB is non-existent at all if not os.path.exists(dbpath) and not os.path.exists(olddbpath): - try: - os.makedirs(dbdir) - except: - pass - shutil.copy(srcpath, dbpath) + # in this case, sqlite3 takes care of things + conn = sqlite3.connect(dbpath) + conn.execute(""" + CREATE TABLE "bookmarks"( + md5 text, + page integer, + content text, + timestamp real, + user text, + color text, + local integer + );""") + conn.commit() + conn.close() + return dbpath # Situation 2: DB is outdated diff --git a/textadapter.py b/textadapter.py index b203b1d..1d8dcb8 100644 --- a/textadapter.py +++ b/textadapter.py @@ -426,7 +426,8 @@ pass def copy(self): - self.textview.get_buffer().copy_clipboard(Gtk.Clipboard()) + clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD) + self.textview.get_buffer().copy_clipboard(clipboard) def _view_buttonrelease_event_cb(self, view, event): self._has_selection = \