New upstream version 117
Jonas Smedegaard
7 years ago
2 | 2 |
bundle_id = org.laptop.sugar.ReadActivity
|
3 | 3 |
icon = activity-read
|
4 | 4 |
exec = sugar-activity readactivity.ReadActivity
|
5 | |
activity_version = 115
|
|
5 |
activity_version = 117
|
6 | 6 |
mime_types = application/pdf;image/vnd.djvu;image/x.djvu;image/tiff;application/epub+zip;text/plain;application/zip;application/x-cbz
|
7 | 7 |
license = GPLv2+
|
8 | 8 |
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!
|
9 | 9 |
categories = language documents media system
|
10 | 10 |
repository = https://github.com/godiard/read-activity.git
|
|
11 |
max_participants = 10
|
44 | 44 |
|
45 | 45 |
# Situation 1: DB is non-existent at all
|
46 | 46 |
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 |
|
52 | 62 |
return dbpath
|
53 | 63 |
|
54 | 64 |
# Situation 2: DB is outdated
|
425 | 425 |
pass
|
426 | 426 |
|
427 | 427 |
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)
|
429 | 430 |
|
430 | 431 |
def _view_buttonrelease_event_cb(self, view, event):
|
431 | 432 |
self._has_selection = \
|