/+junk/pygooglechart-py3k

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/pygooglechart-py3k

« back to all changes in this revision

Viewing changes to pygooglechart.py

  • Committer: Gerald Kaszuba
  • Date: 2010-12-24 05:18:55 UTC
  • Revision ID: git-v1:1a633e0584a557e812fae20deceaef514a515f62
gitignore compiled py files and setup.py build dir

Show diffs side-by-side

added added

removed removed

Lines of Context:
284
284
    of the chart. legend requires a list that corresponds to datasets.
285
285
    """
286
286
 
287
 
    BASE_URL = 'http://chart.apis.google.com/chart'
 
287
    BASE_URL = 'http://chart.apis.google.com/chart?'
288
288
    BACKGROUND = 'bg'
289
289
    CHART = 'c'
290
290
    ALPHA = 'a'
337
337
 
338
338
    # URL generation
339
339
    # -------------------------------------------------------------------------
340
 
        
 
340
 
341
341
    def get_url(self, data_class=None):
342
 
        return self.BASE_URL + '?' + self.get_url_extension(data_class)
343
 
    
344
 
    def get_url_extension(self, data_class=None):
345
342
        url_bits = self.get_url_bits(data_class=data_class)
346
 
        return '&'.join(url_bits)
 
343
        return self.BASE_URL + '&'.join(url_bits)
347
344
 
348
345
    def get_url_bits(self, data_class=None):
349
346
        url_bits = []
389
386
    # Downloading
390
387
    # -------------------------------------------------------------------------
391
388
 
392
 
    def download(self, file_name, use_post=True):
393
 
        if use_post:
394
 
            opener = urllib2.urlopen(self.BASE_URL, self.get_url_extension())
395
 
        else:
396
 
            opener = urllib2.urlopen(self.get_url())
 
389
    def download(self, file_name):
 
390
        opener = urllib2.urlopen(self.get_url())
397
391
 
398
392
        if opener.headers['content-type'] != 'image/png':
399
393
            raise BadContentTypeException('Server responded with a ' \