diff options
| author | Mattias Andrée <maandree@operamail.com> | 2013-07-27 12:22:03 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@operamail.com> | 2013-07-27 12:22:03 +0200 |
| commit | dd9a28977d67d046340c8bcb229d293b5765bea4 (patch) | |
| tree | 06da05b90c422c9d96f968a2ac7529d23b7b7729 /src/featherweight.py | |
| parent | nicer exit in tty (diff) | |
| download | pytagomacs-dd9a28977d67d046340c8bcb229d293b5765bea4.tar.gz pytagomacs-dd9a28977d67d046340c8bcb229d293b5765bea4.tar.bz2 pytagomacs-dd9a28977d67d046340c8bcb229d293b5765bea4.tar.xz | |
update metadata
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/featherweight.py')
| -rwxr-xr-x | src/featherweight.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/featherweight.py b/src/featherweight.py index 83a37e0..82a6e83 100755 --- a/src/featherweight.py +++ b/src/featherweight.py @@ -63,7 +63,23 @@ with touch('%s/feeds' % root) as feeds_flock: for feed in feed['inner']: update_feed(feed, if_group) elif (if_group is None) or (feed['group'] == if_group): - pass # TODO update feed + uuid = feed['uuid'] + with touch('%s/%s' % (root, uuid)) as feed_flock: + flock(feed_flock, True) + feed_info = None + with open('%s/%s' % (root, uuid), 'rb') as file: + feed_info = file.read().decode('utf-8', 'error') + feed_info = eval(feed_info) + have = feed_info['have'] + unread = feed_info['unread'] + + ## TODO update feed + + feed['new'] = len(unread) + with open('%s/%s' % (root, uuid), 'wb') as file: + file.write(str(feed_info).decode('utf-8')) + file.flush() + unflock(feed_flock) for feed in feeds: update_feed(feed, group) |
