|
1 | | -import sys |
2 | | -import os |
3 | | -from src.api.ODMconnection import dbconnection |
4 | | -import pprint |
5 | | -from src.api.ODM1_1_1.services import SeriesService |
| 1 | +__author__ = 'stephanie' |
6 | 2 |
|
7 | | -this_file = os.path.realpath(__file__) |
8 | | -directory = os.path.dirname(this_file) |
9 | | -sys.path.insert(0, directory) |
| 3 | +import matplotlib.pyplot as plt |
| 4 | +from matplotlib import dates |
| 5 | +import pprint |
| 6 | +from api.ODMconnection import dbconnection |
| 7 | +from api.ODM1_1_1.services import SeriesService |
10 | 8 |
|
11 | 9 |
|
12 | 10 | # Create a connection to the ODM2 database |
13 | 11 | # ---------------------------------------- |
14 | | -# conn = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM', 'ODM123!!') |
15 | | -# conn = dbconnection.createConnection('mysql', 'jws.uwrl.usu.edu', 'odm2', 'ODM', 'ODM123!!', 2.0) |
16 | | -# conn = dbconnection.createConnection('mssql', '(local)', 'ODM2SS', 'ODM', 'odm') |
17 | | -# conn = dbconnection.createConnection('postgresql', 'localhost', 'ODM2', 'odm', 'odm') |
18 | | -# conn = dbconnection.createConnection('mysql', '127.0.0.1:3306', 'ODM2', 'Stephanie', 'odm') |
19 | | -# ------------------------------------------------- |
| 12 | + |
| 13 | +#createconnection (dbtype, servername, dbname, username, password) |
| 14 | +#session_factory = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM', 'odm') |
| 15 | +session_factory = dbconnection.createConnection('mysql', 'jws.uwrl.usu.edu', 'odm2', 'ODM', 'ODM123!!', 2) |
| 16 | + |
20 | 17 |
|
21 | 18 | #ODM1 DB |
22 | | -conn = dbconnection.createConnection('mysql', 'jws.uwrl.usu.edu', 'odm', "ODM", "ODM123!!", 1.1) |
| 19 | +# session_factory = dbconnection.createConnection('mysql', 'jws.uwrl.usu.edu', 'odm', "ODM", "ODM123!!", 1.1) |
23 | 20 |
|
24 | 21 | pp = pprint.PrettyPrinter(indent=8) |
25 | 22 |
|
|
29 | 26 | print "************************************************" |
30 | 27 | print |
31 | 28 |
|
32 | | -odm1service = SeriesService(conn) |
33 | | -pp.pprint(conn) |
| 29 | +odm1service = SeriesService(session_factory) |
| 30 | +pp.pprint(session_factory) |
34 | 31 |
|
35 | 32 | print |
36 | 33 | print "************************************************" |
|
79 | 76 | print "************************************************" |
80 | 77 | print |
81 | 78 |
|
82 | | -#pp.pprint(odm1service.get_all_series()) |
| 79 | +pp.pprint(odm1service.get_all_series()) |
83 | 80 |
|
84 | 81 |
|
85 | 82 | print |
|
88 | 85 | print "************************************************" |
89 | 86 | print |
90 | 87 |
|
91 | | -#pp.pprint(odm1service.get_values_by_series(1)) |
92 | | - |
| 88 | +pp.pprint(odm1service.get_values_by_series(1)) |
93 | 89 |
|
94 | | -# |
0 commit comments