config¶
Configuration structure, loading and storing
-
class
pdf2xlsx.config.JsonDict¶ OrderedDict class extended with serialization functions, store and load. The configuration will be stored in an orderedDictionary, each value in it will be a regular dictionary containing ‘value’ and ‘text’. Text could be used during GUI implementation, to show what is stored in the value.
-
load(path='C:\\Users\\tibger01\\.pdf2xlsx\\config.txt')¶ Update the config from the config file (path)
Parameters: path (str) – Path and filename of the config file
-
store(path='C:\\Users\\tibger01\\.pdf2xlsx\\config.txt')¶ Store the actual configuration to config file (path)
Parameters: path (str) – Path and filename of the config file
-
-
pdf2xlsx.config.init_conf(conf=JsonDict([('tmp_dir', {'value': 'tmp', 'text': 'tmp dir'}), ('file_extension', {'value': 'pdf', 'text': 'file ext'}), ('xlsx_name', {'value': 'invoices.xlsx', 'text': 'xlsx name'}), ('invo_header_ident', {'value': [1, 2, 3, 4], 'text': 'invo header pos'}), ('ME', {'value': ['Pár', 'Darab'], 'text': 'Me category'}), ('excel_path', {'value': 'C:\\Program Files (x86)\\Microsoft Office\\Office14\\excel.exe', 'text': 'Excel:'})]), cfg_path='C:\\Users\\tibger01\\.pdf2xlsx\\config.txt')¶ Load the config file from $HOME/pdf2xlsx/cfg_name. If it doesn’t exist try to create it. First create the pdf2xlsx directory, and then write out the default config