Permalink
Browse files

Version 1.7, Support database transactions. Fixes #13 Set default val…

…ues for 'id_action_name' and 'id_action_url'.
  • Loading branch information...
1 parent 80774b0 commit 8252c3fcc7063255f1d2a2e4a76942b5bfa9a3ca @bgrzyscc bgrzyscc committed Aug 28, 2013
Showing with 9 additions and 0 deletions.
  1. +2 −0 action.py
  2. +1 −0 google2piwik.py
  3. +6 −0 sql.py
View
@@ -23,6 +23,8 @@ def __init__(self, path, title, internal_id):
self.exported = False
self.pageviews = 0
self.timeleft = 0
+ self.id_action_name = 0
+ self.id_action_url = 0
def __repr__(self):
return str(self.titles)
View
@@ -665,4 +665,5 @@ def EntryToDict(self, entry, take_dimension = True, take_metric = False):
export_period(start_date, end_date)
sql.clear_archives()
+ sql.close()
print "Please go to your Piwik installation folder and run misc/cron/archive.sh script."
View
6 sql.py
@@ -228,3 +228,9 @@ def clear_archives():
if to_drop:
raw_sql = 'DROP TABLE ' + (', ').join(to_drop)
cursor.execute(raw_sql)
+
+
+def close():
+ global db
+ db.commit()
+ db.close()

0 comments on commit 8252c3f

Please sign in to comment.