Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnitConvert3 is not showing a file browser in configure #3

Open
evertvorster opened this issue Aug 28, 2020 · 3 comments
Open

UnitConvert3 is not showing a file browser in configure #3

evertvorster opened this issue Aug 28, 2020 · 3 comments

Comments

@evertvorster
Copy link
Contributor

Hey, this is the first time I managed to get this tool to work on the Python3 version.

It's only a small niggle, but when I click on "Browse" to locate my installation of VegaStrike, I get an error message in the console, and no file browser.

Here is the error message:

[evert@Vorster UnitConverter3]$ ./uc
iniRead: config variable Config/WORKDIR not yet set
iniRead: config variable Config/VEGASTRIKE_ROOT not yet set
iniRead: FAILED reading active model
Reading workspace
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python3.8/tkinter/init.py", line 1883, in call
return self.func(*args)
File "unitconverter.py", line 2694, in
Button(iframe, text='Browse', command=lambda:self.getFolder(self.vegastrike)).pack(side=LEFT, padx=5)
File "unitconverter.py", line 467, in getFolder
folder = askdirectory(initialdir=self.vegastrike.get(), title="Select A Folder", mustexist=1)
NameError: name 'askdirectory' is not defined

@P-D-E
Copy link
Contributor

P-D-E commented Apr 10, 2021

Replace
folder = askdirectory(initialdir=self.vegastrike.get(), title="Select A Folder", mustexist=1)

with
folder = filedialog.askdirectory(initialdir=self.vegastrike.get(), title="Select A Folder", mustexist=1)

That one escaped the first-pass conversion

@P-D-E
Copy link
Contributor

P-D-E commented Apr 11, 2021

...on a side note, here's a prototype with split csv handling support:

https://github.com/P-D-E/Tools/tree/split_csv/modtools/UnitConverter3

The new combo box at the top of the Unit section gets preloaded with all the .csv files found in the units subdir of the path specified in Config; select one and press Load, the rest of the GUI will work on that file.

@P-D-E
Copy link
Contributor

P-D-E commented Apr 16, 2021

...and after some updates, here's a PR:
#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants