Mercurial Hosting > traffic-intelligence
diff python/storage.py @ 211:ada6e8fbe4c6
2 Changes :
1) Modified storage.py to read prototype and matching trajectory indexes from db
2) Modified moving.py to give draw function **kwargs option (to matplotlib.plot)
author | Francois Belisle <belisle.francois@gmail.com> |
---|---|
date | Wed, 06 Jun 2012 13:24:04 -0400 |
parents | 746d02cea65f |
children | ce44605f888a |
line wrap: on
line diff
--- a/python/storage.py Tue Jun 05 14:10:25 2012 -0400 +++ b/python/storage.py Wed Jun 06 13:24:04 2012 -0400 @@ -55,7 +55,7 @@ matched_indexes = [] import sqlite3 - connection = sqlite3.connect(filename) # add test if it open + connection = sqlite3.connect(filename) cursor = connection.cursor() try: @@ -65,6 +65,8 @@ for row in cursor: matched_indexes.append((row[0],row[1])) + + connection.close() return matched_indexes def testloadPrototypeMatchIndexesFromSqlite(): @@ -77,9 +79,6 @@ print "Matches test Ok" return matches - - - def loadTrajectoriesFromSqlite(filename, trajectoryType, objectNumbers = -1): '''Loads nObjects or the indices in objectNumbers from the database