/+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 examples/qrcodes.py

  • Committer: gak
  • Date: 2008-05-03 07:30:58 UTC
  • Revision ID: git-v1:9342edb8666dde7e843e3eb438f1f6a717aa32fc
- Really added initial unit tests
- Converted setup.py to unix file format
- warnings made when data is being clipped and when data scaling is incorrect
- max_value is now a variable
- pie and google-o-meter chart data is now on the x-axis
- More grammar work

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
 
3
 
import os
4
 
import sys
5
 
import math
6
 
 
7
 
ROOT = os.path.dirname(os.path.abspath(__file__))
8
 
sys.path.insert(0, os.path.join(ROOT, '..'))
9
 
 
10
 
from pygooglechart import QRChart
11
 
 
12
 
import settings
13
 
import helper
14
 
 
15
 
def hello():
16
 
 
17
 
    # Create a 250x250 QR chart
18
 
    chart = QRChart(250, 250)
19
 
 
20
 
    # Add the text
21
 
    chart.add_data('Hello, World!')
22
 
 
23
 
    # "Level H" error correction with a 0 pixel margin
24
 
    chart.set_ec('H', 0)
25
 
 
26
 
    # Download
27
 
    chart.download('qr-hello.png')
28
 
 
29
 
def main():
30
 
    hello()
31
 
 
32
 
if __name__ == '__main__':
33
 
    main()
34