Mercurial > hg > nsaunier > traffic-intelligence
comparison python/storage.py @ 773:bf4a1790cfac dev
minor bug and improvements
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Mon, 01 Feb 2016 16:10:26 -0500 |
| parents | f8e0a8ea8402 |
| children | ef6dd60be2e1 |
comparison
equal
deleted
inserted
replaced
| 772:e92a96f2bdd3 | 773:bf4a1790cfac |
|---|---|
| 509 cursor = connection.cursor() | 509 cursor = connection.cursor() |
| 510 | 510 |
| 511 try: | 511 try: |
| 512 cursor.execute('SELECT * from prototypes order by prototype_id, routeIDstart,routeIDend, nMatching') | 512 cursor.execute('SELECT * from prototypes order by prototype_id, routeIDstart,routeIDend, nMatching') |
| 513 except sqlite3.OperationalError as error: | 513 except sqlite3.OperationalError as error: |
| 514 utils.printDBError(error) | 514 printDBError(error) |
| 515 return [] | 515 return [] |
| 516 | 516 |
| 517 for row in cursor: | 517 for row in cursor: |
| 518 route=(row[1],row[2]) | 518 route=(row[1],row[2]) |
| 519 if route not in prototypes.keys(): | 519 if route not in prototypes.keys(): |
| 548 cursor = connection.cursor() | 548 cursor = connection.cursor() |
| 549 | 549 |
| 550 try: | 550 try: |
| 551 cursor.execute('SELECT * from labels order by object_id, routeIDstart,routeIDend, prototype_id') | 551 cursor.execute('SELECT * from labels order by object_id, routeIDstart,routeIDend, prototype_id') |
| 552 except sqlite3.OperationalError as error: | 552 except sqlite3.OperationalError as error: |
| 553 utils.printDBError(error) | 553 printDBError(error) |
| 554 return [] | 554 return [] |
| 555 | 555 |
| 556 for row in cursor: | 556 for row in cursor: |
| 557 route=(row[1],row[2]) | 557 route=(row[1],row[2]) |
| 558 p=row[3] | 558 p=row[3] |
| 592 cursor = connection.cursor() | 592 cursor = connection.cursor() |
| 593 | 593 |
| 594 try: | 594 try: |
| 595 cursor.execute('SELECT * from speedprototypes order by spdprototype_id,prototype_id, routeID_start, routeID_end, nMatching') | 595 cursor.execute('SELECT * from speedprototypes order by spdprototype_id,prototype_id, routeID_start, routeID_end, nMatching') |
| 596 except sqlite3.OperationalError as error: | 596 except sqlite3.OperationalError as error: |
| 597 utils.printDBError(error) | 597 printDBError(error) |
| 598 return [] | 598 return [] |
| 599 | 599 |
| 600 for row in cursor: | 600 for row in cursor: |
| 601 route=(row[2],row[3]) | 601 route=(row[2],row[3]) |
| 602 if route not in prototypes.keys(): | 602 if route not in prototypes.keys(): |
| 632 cursor = connection.cursor() | 632 cursor = connection.cursor() |
| 633 | 633 |
| 634 try: | 634 try: |
| 635 cursor.execute('SELECT * from routes order by object_id, routeIDstart,routeIDend') | 635 cursor.execute('SELECT * from routes order by object_id, routeIDstart,routeIDend') |
| 636 except sqlite3.OperationalError as error: | 636 except sqlite3.OperationalError as error: |
| 637 utils.printDBError(error) | 637 printDBError(error) |
| 638 return [] | 638 return [] |
| 639 | 639 |
| 640 for row in cursor: | 640 for row in cursor: |
| 641 route=(row[1],row[2]) | 641 route=(row[1],row[2]) |
| 642 if route not in Routes.keys(): | 642 if route not in Routes.keys(): |
