GarryMorrison / Semantic-DB

The Semantic DB
GNU General Public License v3.0
4 stars 2 forks source link

implement a config file #19

Open GarryMorrison opened 6 years ago

GarryMorrison commented 6 years ago

I think we should store a config file in home-dir: .sdb/config I presume we create this in setup.py, just after the install examples/docs section.

Current list of options:

shell-history-length = 1000
save-shell-history = False
shell-history-location = '.'
shell-history-filename = 'sdb-history.txt'
sw-directory = '.'
graph-directory = '.'
quiet-mode = False
logging-level = 'warning'
save-table = True
save-matrix = False
save-table-filename = 'saved-table.txt'
save-matrix-filename = 'saved-matrix.txt'

And any more we can think of. Most of these are only relevant to the shell, but the last four need to be passed to functions.py. I'm thinking pass a dictionary to functions.py. Not sure that would work. Maybe put a load_config() function in both the shell and functions.py. functions.py should run it at import time.

config_dict['save-table'] = True
config_dict['save-matrix'] = False
config_dict['save-table-filename'] = 'saved-table.txt'
config_dict['save-matrix-filename'] = 'saved-matrix.txt'

OK. What do we want to do if we don't install via setup.py? Do we want to write out a default config file first time the shell is called? Yes or no?

GarryMorrison commented 6 years ago

I started work on this yesterday, but we had a 9 hour long power outage! Hopefully I can get it done today.