--- /dev/null
+#! /usr/bin/env python
+
+__all__ = ['ml_conf']
+
+import os
+from ConfigParser import SafeConfigParser
+
+config_dirs = []
+if 'XDG_CONFIG_HOME' in os.environ:
+ config_dirs.append(os.environ['XDG_CONFIG_HOME'])
+if 'XDG_CONFIG_DIRS' in os.environ:
+ config_dirs.extend(os.environ['XDG_CONFIG_DIRS'].split(':'))
+home_config = os.path.expanduser('~/.config')
+if home_config not in config_dirs:
+ config_dirs.append(home_config)
+
+for d in config_dirs:
+ ml_conf_file = os.path.join(d, 'm_librarian.conf')
+ if os.path.exists(ml_conf_file):
+ ml_conf = SafeConfigParser()
+ ml_conf.read(ml_conf_file)
+ break
+else:
+ ml_conf = ml_conf_file = None
+
+if __name__ == '__main__':
+ print "Config dirs:", config_dirs
+ print "Config file:", ml_conf_file
--- /dev/null
+[database]
+; DB URI syntax examples:
+
+; URI = mysql://host/database?debug=1
+; URI = mysql://user:password@host/database
+; URI = postgres:///full/path/to/socket/database
+; URI = postgres://host:5432/database
+; URI = postgres://user@host/database?debug=&cache=
+; URI = sqlite:///full/path/to/database
+; URI = sqlite:/C:/full/path/to/database