Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/model.py
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2007-09-01 10:10:03 (GMT)
committer Simon Schampijer <simon@schampijer.de>2007-09-01 10:10:03 (GMT)
commitcd10c5006fa37eda8cdbb6000b5edfa70d70a37f (patch)
tree1657c20bca6def0d43c27f0867123eaabc6e7d28 /model.py
parent6ae5e4111a76f9cb8f59ae6dfc9123365df39467 (diff)
more refactoring for using json only
Diffstat (limited to 'model.py')
-rw-r--r--model.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/model.py b/model.py
index fdb8ff9..4fdb708 100644
--- a/model.py
+++ b/model.py
@@ -37,14 +37,18 @@ class Model(gobject.GObject):
gobject.GObject.__init__(self)
self.data = {}
- self.links = []
- self.data['shared_links'] = self.links
+ self._links = []
+ self.data['shared_links'] = self._links
def add_link(self, url, title, thumb, owner, color):
self.links.append( {'hash':sha.new(url).hexdigest(), 'url':url, 'title':title, 'thumb':thumb,
'owner':owner, 'color':color, 'deleted':0} )
self.emit('add_link', len(self.links)-1)
-
+
+ def mark_link_deleted(self, index):
+ self._links[index]['deleted'] = 1
+ self._links[index]['thumb'] = ''
+
def serialize(self):
self.get_session()
return json.write(self.data)
@@ -55,7 +59,7 @@ class Model(gobject.GObject):
def get_links_ids(self):
ids = []
- for link in self.links:
+ for link in self._links:
ids.append(link['hash'])
ids.append('')
return ids