pgtoolkit/toolbase.py
changeset 78 64c62ac8f65d
parent 62 af637235ca81
child 83 515fadd3d286
equal deleted inserted replaced
77:2cfef775f518 78:64c62ac8f65d
     1 import argparse
     1 import argparse
     2 import logging
     2 import logging
     3 import re
     3 import re
     4 
     4 
     5 from pgtoolkit import pgmanager, pgbrowser, config
     5 from pgtoolkit import pgmanager, pgbrowser, configparser
     6 from pgtoolkit.coloredformatter import ColoredFormatter
     6 from pgtoolkit.coloredformatter import ColoredFormatter
     7 from pgtoolkit.highlight import highlight
     7 from pgtoolkit.highlight import highlight
     8 
     8 
     9 
     9 
    10 class ConnectionInfoNotFound(Exception):
    10 class ConnectionInfoNotFound(Exception):
    19     def __init__(self, name, desc, **kwargs):
    19     def __init__(self, name, desc, **kwargs):
    20         self.parser = argparse.ArgumentParser(description=desc)
    20         self.parser = argparse.ArgumentParser(description=desc)
    21         self.parser.add_argument('-d', dest='debug', action='store_true',
    21         self.parser.add_argument('-d', dest='debug', action='store_true',
    22             help='Debug mode - print database queries.')
    22             help='Debug mode - print database queries.')
    23 
    23 
    24         self.config = config.ConfigParser()
    24         self.config = configparser.ConfigParser()
    25         self.config.add_argument('databases', type=dict)
    25         self.config.add_argument('databases', type=dict)
    26         self.config.add_argument('meta_db')
    26         self.config.add_argument('meta_db')
    27         self.config.add_argument('meta_query')
    27         self.config.add_argument('meta_query')
    28 
    28 
    29         self.pgm = pgmanager.get_instance()
    29         self.pgm = pgmanager.get_instance()