projects
/
pycalendar.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d15835b
)
feed: Only fetch if we haven't already (or if we're forcing a fetch)
author
W. Trevor King
<wking@tremily.us>
Sun, 30 Jun 2013 14:35:33 +0000
(10:35 -0400)
committer
W. Trevor King
<wking@tremily.us>
Sun, 30 Jun 2013 16:26:18 +0000
(12:26 -0400)
pycalendar/feed.py
patch
|
blob
|
history
diff --git
a/pycalendar/feed.py
b/pycalendar/feed.py
index 52240c21057aa9577fce99dae9366c8a5f3d3eab..2e9043857a9067d0cb81c0c2106344fb0bfada09 100644
(file)
--- a/
pycalendar/feed.py
+++ b/
pycalendar/feed.py
@@
-73,7
+73,12
@@
class Feed (object):
def __repr__(self):
return '<{} url:{}>'.format(type(self).__name__, self.url)
- def fetch(self):
+ def fetch(self, force=False):
+ if self.content is None or force:
+ self._fetch()
+ self.process()
+
+ def _fetch(self):
request = _urllib_request.Request(
url=self.url,
headers={