gui

Not so simple tkinter based gui around the pdf2xlsx.do_it function.

class pdf2xlsx.gui.ConfOption(root, key, row)

This widget is used to place the configuration options to the ConfigWindow. It contains a label to show what is the configuration and an entry with StringVar to provide override possibility. The value of the config JsonDict is converted to a string for the entry. If the value of a configuration is a list, it is converted to a comma separated string.

Parameters:
  • root (Frame) – Tk parent frame
  • key (str) – Key to the “config” JsonDict
  • row (int) – Parameter for grid window manager
update_config()

Write the current entry value to the configuration. The original type of the config value is checked, and the string is converted to this value (int, list of int, list of string...)

class pdf2xlsx.gui.ConfigWindow(master)

Sub window for settings. The window is hidden by default, when the user clickes to the settings button it is activated. It contains the configuration options. There are two buttons the Save ( which hides the window ), and the Accept, both of them updates the configuration file. The configuration items are stored in a list.

Parameters:master – Tk parent class
accept_callback()

Goes through on every configuration item and updates them one by one. Stores the updated configuration.

save_callback()

Hides the ConfigWindow and updates and stores the configuration

class pdf2xlsx.gui.PdfXlsxGui(master)

Simple GUI which lets the user select the source file zip and the desitination directory for the xlsx file. Contains a file dialog for selecting the zip file to work with. There is a button to start the conversion, and also a Settings button to open the settings window

Parameters:master – Tk parent class
browse_src_callback()

Asks for the source zip file, the opened dialog filters for zip files by default The src_entry attribute is updated based on selection

config_callback()

Bring the configuration window up

process_pdf()

Facade for the do_it function. Only the src file and destination dir is updated the other parameters are left for defaults.