1
#!/usr/bin/env python3.1
3
This file contains the plotting funcioton that plots the data into a bar graph.
11
##This array is passed to getDB
12
self.nameArray = ["gudar", "spoken", "religos", "sekulart" ,"vegan" ,"mars" ,"globaluppvarmning" ,"manen" ,"motion" ,"sund" ,"deprimerad_host" ,"sno" ,"oppet" ,"dodsstraff" ,"kvinnors_rattigheter" ,"abort", "kvinnors_kropp", "deprimerad_var" ,"gast_sverige" ,"fodd_sverige" ,"foraldrar_sverige" ,"komentarer"]
14
GetData = getDB(self.nameArray)
17
CountArray = GetData.doGet()
22
""" returns an array of counts of from the database"""
23
def __init__(self, iarray):
24
self.conn = sqlite3.connect("./awnsers.sqlite")
25
self.db = self.conn.cursor()
27
self.nameArray = iarray
28
self.countArray = list()
30
self.countStart = "select count(*) from awnsers where("
31
self.countEnd = " == 1);"
34
for name in self.nameArray:
35
getItem = self.db.execute(self.countStart + str(name) + self.countEnd )
38
self.countArray.append(item)
40
return self.countArray