Codebase list sugar-read-activity / upstream/117
New upstream version 117 Jonas Smedegaard 7 years ago
4 changed file(s) with 19 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
22 bundle_id = org.laptop.sugar.ReadActivity
33 icon = activity-read
44 exec = sugar-activity readactivity.ReadActivity
5 activity_version = 115
5 activity_version = 117
66 mime_types = application/pdf;image/vnd.djvu;image/x.djvu;image/tiff;application/epub+zip;text/plain;application/zip;application/x-cbz
77 license = GPLv2+
88 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!
99 categories = language documents media system
1010 repository = https://github.com/godiard/read-activity.git
11 max_participants = 10
read_v1.db less more
Binary diff not shown
4444
4545 # Situation 1: DB is non-existent at all
4646 if not os.path.exists(dbpath) and not os.path.exists(olddbpath):
47 try:
48 os.makedirs(dbdir)
49 except:
50 pass
51 shutil.copy(srcpath, dbpath)
47 # in this case, sqlite3 takes care of things
48 conn = sqlite3.connect(dbpath)
49 conn.execute("""
50 CREATE TABLE "bookmarks"(
51 md5 text,
52 page integer,
53 content text,
54 timestamp real,
55 user text,
56 color text,
57 local integer
58 );""")
59 conn.commit()
60 conn.close()
61
5262 return dbpath
5363
5464 # Situation 2: DB is outdated
425425 pass
426426
427427 def copy(self):
428 self.textview.get_buffer().copy_clipboard(Gtk.Clipboard())
428 clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
429 self.textview.get_buffer().copy_clipboard(clipboard)
429430
430431 def _view_buttonrelease_event_cb(self, view, event):
431432 self._has_selection = \