model Package

model Package

This file is part of open-hea.

open-hea is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

open-hea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with open-hea. If not, see <http://www.gnu.org/licenses/>.

common Module

This file is part of open-hea.

open-ihm is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

open-ihm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with open-ihm. If not, see <http://www.gnu.org/licenses/>.

model.common.getDbString(strSeed)
model.common.getIntMonth(month)
model.common.getStringMonth(month)
model.common.getViewString(strSeed)

config Module

This file is part of open-ihm.

-- coding: utf-8 --

open-ihm is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

open-ihm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with open-ihm. If not, see <http://www.gnu.org/licenses/>.

class model.config.Config

Bases: object

Configures the mysql database connector which is then called as below:

includes.mysql.connector.Connect(**Config.dbinfo())

CHARSET = 'utf8'
DATABASE = 'openheadb'
HOST = 'localhost'
PASSWORD = 'hea2012'
PORT = 3306
UNICODE = True
USER = 'openhea'
WARNINGS = True
classmethod dbinfo()

config_parser Module

This file is part of open-hea.

open-hea is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

open-hea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with open-hea. If not, see <http://www.gnu.org/licenses/>.

class model.config_parser.OpenHEAConfig

Bases: ConfigParser.SafeConfigParser

Configuration file parser based on ConfigParser.SafeConfigParser

The parser is setup with defaults for most of the settings.

config = OpenHEAConfig() config.read(CONFIGFILE)

The config file can contain these directives,

[database] host = host database = database user = user password = userpassword port = 3306 superuser = root superuser_password = password driver = mysql+mysqldb
database_config()

Returns a dictionary containing the database configuration information. If it can not load the settings from the ini file it simply returns the default settings.

{
‘host’: ‘localhost’, ‘database’: ‘openheadb’, ‘user’: ‘openhea’, ‘password’: ‘hea2012’, ‘port’: 3306, ‘superuser’: ‘root’, ‘superuser_password’: ‘’,

}

dbinfo()

Returns a dictionary containing the database configuration information.

{
‘host’: ‘localhost’, ‘database’: ‘openheadb’, ‘user’: ‘openhea’, ‘password’: ‘hea2012’, ‘charset’: ‘utf8’, ‘use_unicode’ : True, ‘get_warnings’ : True,

}

get_driver()

Returns the database driver to use in sqlalchemy

schema_script_path()

Returns the path to look for the database schema scripts. This is primarily configurable to make testing easier.

sqlalchemy_connection_string()

Returns a connection string for sqlalchemy. The defaults will produce the following connection string,

mysql+mysqldb://openhea:hea2012@localhost/openheadb
sqlalchemy_mysql_unix_socket()

Returns the unix socket specified in the configuration file for the sqlalchemy connection.

This shouldn’t be a commonly necessary function, but it is used on our CI server. The parameter should be unix_socket in the configuration file. For example,

unix_socket = /var/run/mysqld/mysqld.sock
sqlalchemy_superuser_connection_string()

Returns a connection string for the superuser for sqlalchemy. The defaults will produce the following connection string,

Note: this may not work with blank passwords. Then again it might. I have no way to test it, your mileage may vary.

superuser_dbinfo()

Returns a dictionary containing the database configuration information for the super user.

{
‘host’: ‘localhost’, ‘database’: ‘openheadb’, ‘user’: ‘root’, ‘password’: ‘’, ‘charset’: ‘utf8’, ‘use_unicode’ : True, ‘get_warnings’ : True,

}

databaseinitialiser Module

schema Module

unstableschema Module

Project Versions

Table Of Contents

Previous topic

controller Package

Next topic

view Package

This Page