Skip to content

Commit

Permalink
Style fixes: splitting a few long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
askedrelic committed Nov 27, 2010
1 parent 755b65a commit 67262f1
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions libgreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def __str__(self):
def __init__(self, googleReader, item, parent):
"""
item : An item loaded from json
parent : the object (Feed of Category) containing thi Item
parent : the object (Feed of Category) containing the Item
"""
self.googleReader = googleReader
self.parent = parent
Expand Down Expand Up @@ -314,12 +314,13 @@ def __init__(self, googleReader, item, parent):
self.read = True
elif category.endswith('/state/com.google/starred'):
self.starred = True
elif category in ('user/-/state/com.google/broadcast', 'user/%s/state/com.google/broadcast' % self.googleReader.userId):
elif category in ('user/-/state/com.google/broadcast',
'user/%s/state/com.google/broadcast' % self.googleReader.userId):
self.shared = True

self.canUnread = item.get('isReadStateLocked', 'false') != 'true'

# keep feed, can be used when item si fetched from a special feed then it's the original one
# keep feed, can be used when item is fetched from a special feed, then it's the original one
try:
f = item['origin']
self.origin = {
Expand Down Expand Up @@ -516,12 +517,18 @@ def buildSubscriptionList(self):
feed.addCategory(category)
feed.unread = unreadById.get(sub['id'], 0)
except:
feed = Feed(self, sub['title'], sub['id'], sub.get('htmlUrl', None), unreadById.get(sub['id'], 0), categories)
feed = Feed(self,
sub['title'],
sub['id'],
sub.get('htmlUrl', None),
unreadById.get(sub['id'], 0),
categories)
if not categories:
self.orphanFeeds.append(feed)
self._addFeed(feed)

specialUnreads = [id for id in unreadById if id.find('user/%s/state/com.google/' % self.userId) != -1]
specialUnreads = [id for id in unreadById
if id.find('user/%s/state/com.google/' % self.userId) != -1]
for type in self.specialFeeds:
feed = self.specialFeeds[type]
feed.unread = 0
Expand Down Expand Up @@ -574,10 +581,12 @@ def getCategoryContent(self, category, excludeRead=False, continuation=None):
return self._getFeedContent(category.fetchUrl, excludeRead, continuation)

def removeItemTag(self, item, tag):
return self.httpPost(GoogleReader.EDIT_TAG_URL, {'i': item.id, 'r': tag, 'ac': 'edit-tags', })
return self.httpPost(GoogleReader.EDIT_TAG_URL,
{'i': item.id, 'r': tag, 'ac': 'edit-tags', })

def addItemTag(self, item, tag):
return self.httpPost(GoogleReader.EDIT_TAG_URL, {'i': item.id, 'a': tag, 'ac': 'edit-tags', })
return self.httpPost(GoogleReader.EDIT_TAG_URL,
{'i': item.id, 'a': tag, 'ac': 'edit-tags', })

def markFeedAsRead(self, feed):
return self.httpPost(GoogleReader.MARK_ALL_READ_URL, {'s': feed.id, })
Expand Down

0 comments on commit 67262f1

Please sign in to comment.