~davidc3/ubuntu-rest-scopes/testing-newyorktimes

« back to all changes in this revision

Viewing changes to src/scopes/newyorktimes.py

  • Committer: David Callé
  • Date: 2014-02-26 12:04:09 UTC
  • Revision ID: davidc@framli.eu-20140226120409-coed9exeg33jfyvj
Explain image logic

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
    small_art = None
111
111
    gallery = []
112
112
 
 
113
    # Image logic :
 
114
    # If we have a >200px image, use it for the result mascot and preview art
 
115
    # also, if we have multiple >200px images, create a preview gallery.
 
116
    # If not, use a >75px image as a mascot in result and preview header.
 
117
    # If no >75px image, use a logo as a mascot in result and preview header.
 
118
 
113
119
    # Images for: search/latest news/pictures of the day
114
120
    try:
115
121
        images = sorted(d['multimedia'],
137
143
 
138
144
    # Fallbacks
139
145
    if not small_art:
 
146
        # Needs an official logo
140
147
        small_art = "http://i1.nyt.com/projects/assets/live_dashboard/images/nyt.png"
141
148
    if not art:
142
149
        art = small_art