~ubuntuone-hackers/ubuntu-rest-scopes/trunk

« back to all changes in this revision

Viewing changes to src/scopes/yahoofinance.py

  • Committer: Facundo Batista
  • Date: 2016-06-07 14:01:21 UTC
  • mfrom: (508.2.9 ubuntu-rest-scopes)
  • mto: This revision was merged to the branch mainline in revision 527.
  • Revision ID: facundo@taniquetil.com.ar-20160607140121-id1tzsnaa1lwtrb8
MergedĀ lp:~jamesh/ubuntu-rest-scopes/multi-column

Show diffs side-by-side

added added

removed removed

Lines of Context:
276
276
        """Do the preview."""
277
277
        result = kwargs['result']
278
278
        locale = kwargs['locale']
 
279
 
 
280
        # column layouts
 
281
        single = [[]]
 
282
        double = [[], []]
 
283
        single[0].append('header')
 
284
        double[0].append('header')
 
285
        single[0].append('buttons')
 
286
        double[0].append('buttons')
 
287
        if result['cat_id'] == 'headlines':
 
288
            single[0].append('text')
 
289
            double[1].append('text')
 
290
        else:
 
291
            single[0].append('text')
 
292
            double[0].append('text')
 
293
            single.insert(0, 'art')
 
294
            double[1].append('art')
 
295
        yield dict(columns=[single, double])
 
296
 
279
297
        if result['cat_id'] != 'headlines':
280
298
            graph = "http://chart.finance.yahoo.com/z?" \
281
299
                    "s=" + result['symbol'] + "&z=s&t=7d"