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/>.
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/>.
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/>.
Bases: object
Configures the mysql database connector which is then called as below:
includes.mysql.connector.Connect(**Config.dbinfo())
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/>.
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
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’: ‘’,
}
Returns a dictionary containing the database configuration information.
- {
- ‘host’: ‘localhost’, ‘database’: ‘openheadb’, ‘user’: ‘openhea’, ‘password’: ‘hea2012’, ‘charset’: ‘utf8’, ‘use_unicode’ : True, ‘get_warnings’ : True,
}
Returns the database driver to use in sqlalchemy
Returns the path to look for the database schema scripts. This is primarily configurable to make testing easier.
Returns a connection string for sqlalchemy. The defaults will produce the following connection string,
mysql+mysqldb://openhea:hea2012@localhost/openheadb
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
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.
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,
}