예제 #1
0
파일: test_wof.py 프로젝트: swtools/WOFpy
 def setUp(self):
     dao = TestDao()
     self.wof_inst = WOF(dao, TEST_CONFIG_FILE)
     waterml_schema_path = os.path.join(os.path.dirname(__file__),
                                        'cuahsiTimeSeries_v1_0.xsd')
     waterml_schema_doc = etree.parse(waterml_schema_path)
     self.waterml_schema = etree.XMLSchema(waterml_schema_doc)
예제 #2
0
    def setUp(self):
        dao = TestDao()
        testConfig = os.path.join(os.path.dirname(__file__), TEST_CONFIG_FILE)
        self.wof_inst = WOF(dao, testConfig)

        if not os.path.exists(
                os.path.join(os.path.abspath(os.path.curdir),
                             'watermlcvs.json')):
            wof.vocabularies.update_watermlcvs()

        waterml_schema_path = os.path.join(os.path.dirname(__file__),
                                           'cuahsiTimeSeries_v1_1.xsd')
        waterml_schema_doc = etree.parse(waterml_schema_path)
        self.waterml_schema = etree.XMLSchema(waterml_schema_doc)
예제 #3
0
database_connection_string = 'mssql+pyodbc://odm_user2:water123@JAMTAY-PC\SQLEXPRESS/LittleBear11'

2.  Example for SQLite

swis_connection_string = 'sqlite:///C:/PythonSandbox/WOFpy_Sandbox/WOFpy/examples/swis/swis2.db'

You can use relative paths too, e.g. if you are calling the above database from the same directory, 
the connection string can just be:

swis_connection_string = 'sqlite:///swis2.db' 
'''

LCM_connection_string = 'sqlite:///LCM_Data/LCM.db'

dao = LCMDao(LCM_connection_string, 'LCM_config.cfg')
LCM_wof = WOF(dao)
LCM_wof.config_from_file('LCM_config.cfg')

app = create_app(LCM_wof)
app.config.from_object(config.DevConfig)

ODMWOFService = create_wof_service_class(LCM_wof)

soap_app = soaplib.core.Application(services=[ODMWOFService],
                                    tns='http://www.cuahsi.org/his/1.0/ws/',
                                    name='WaterOneFlow')

soap_wsgi_app = soaplib.core.server.wsgi.Application(soap_app)

app.wsgi_app = DispatcherMiddleware(app.wsgi_app, {
    '/soap/wateroneflow': soap_wsgi_app,
예제 #4
0
from wof import WOF
from wof.soap import create_wof_service_class
from wof.flask import config, create_app

from examples.swis.swis_dao import SwisDao
from examples.barebones.LCM_dao import LCMDao

logging.basicConfig(level=logging.DEBUG)

swis_dao = SwisDao('swis/swis_config.cfg',
                   database_uri='sqlite:///swis/swis2.db')
lcm_dao = LCMDao('sqlite:///barebones/LCM_Data/LCM.db',
                 'barebones/LCM_config.cfg')

swis_wof = WOF(swis_dao)
swis_wof.config_from_file('swis/swis_config.cfg')

lcm_wof = WOF(lcm_dao)
lcm_wof.config_from_file('barebones/LCM_config.cfg')
#Create the Flask applications
swis_flask_app = create_app(swis_wof)
lcm_flask_app = create_app(lcm_wof)

#Create the soaplib classes
SWISWOFService = create_wof_service_class(swis_wof)
LCMWOFService = create_wof_service_class(lcm_wof)

#Create the soaplib applications
swis_soap_app = soaplib.core.Application(
    services=[SWISWOFService],