irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

get_db_schema_version.py
Go to the documentation of this file.
1 #!/usr/bin/python
2 from __future__ import print_function
3 
4 import contextlib
5 import sys
6 import logging
7 
8 from irods.configuration import IrodsConfig
9 import irods.log
10 
11 
12 def get_current_schema_version(irods_config=None, cursor=None):
13  if irods_config is None:
14  irods_config = IrodsConfig()
15  return irods_config.get_schema_version_in_database()
16 
17 if __name__ == '__main__':
18  logging.getLogger().setLevel(logging.NOTSET)
19  l = logging.getLogger(__name__)
20  irods.log.register_tty_handler(sys.stdout, logging.INFO, logging.WARNING)
21  irods.log.register_tty_handler(sys.stderr, logging.WARNING, None)
22 
23  irods_config = IrodsConfig()
24  irods.log.register_file_handler(irods_config.control_log_path)
25 
26  print(get_current_schema_version(irods_config))
irods.configuration.IrodsConfig
Definition: configuration.py:22
irods.configuration
Definition: configuration.py:1
get_db_schema_version.get_current_schema_version
def get_current_schema_version(irods_config=None, cursor=None)
Definition: get_db_schema_version.py:12
irods.log
Definition: log.py:1
irods.log.register_tty_handler
def register_tty_handler(stream, minlevel, maxlevel)
Definition: log.py:46
irods.log.register_file_handler
def register_file_handler(log_file_path, level=logging.DEBUG)
Definition: log.py:57