Tree Style units.csv & master_part_list.csv viewer / edi

A forum for the discussion and development of programs to assist working on or playing with the Vegastrike engine and data sets.
Post Reply
wowsher
Trader
Trader
Posts: 22
Joined: Sun Feb 04, 2007 5:16 pm
Contact:

Tree Style units.csv & master_part_list.csv viewer / edi

Post by wowsher »

I was looking for something a little different that what others had created.

Right now it is a viewer but as I continue I will add the ability to edit and save the file as well.

As you will see I have parsed the file into a nice tree format. This is built using python and wxpython and should work on any platform that they work on. If you are interested in running it I have attached the file. You can even browse the code as it is the py file.

Any thoughts comments groans etc? Constructive feedback is welcome.

thanks
wowsher
You do not have the required permissions to view the files attached to this post.
Last edited by wowsher on Fri Apr 11, 2008 3:31 pm, edited 2 times in total.
Oblivion
Artisan Extraordinaire
Artisan Extraordinaire
Posts: 1269
Joined: Tue Mar 21, 2006 10:55 am
Location: Philippines

Post by Oblivion »

hmm. the navigation is certainly easier in your app, easier to see what you've changed and what needs changing too. :D

can you post an exe too?
A Step Into Oblivion

Dreams of things that will never be,
Songs of thoughts only I can hear,
Leave me be to sleep forever,
To dream my dreams,
And sing my hymns,
Of things that will never be...
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

looking good wowsher looking forward to open/save functionality how is it with master_parts_list.csv our other csv beastie which works together with units.csv.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
wowsher
Trader
Trader
Posts: 22
Joined: Sun Feb 04, 2007 5:16 pm
Contact:

Post by wowsher »

I have not tackled the master_parts_list.csv yet but if the viewer portion is handy in its own then I could do that prior to adding the open/save/update code... Just let me know if that would be more important than I could switch the two around.

to get the exe version you will have to go over to www.ordner.us, downloads, vegastrike. I tried to upload here but it kept erroring out... maybe too big of file?

The exe has three files. The unit-editor.exe and .dll are required and the other exe is some kind of win9x compatibility deal and not needed on WinXP (my platform). I included it just in case.

wowsher
Last edited by wowsher on Tue Mar 25, 2008 9:15 pm, edited 1 time in total.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

I tried to upload here but it kept erroring out... maybe too big of file?
change the extension to zip :wink: and the size limit is 5 mb


Enjoy the Choice :)
Edit: your link to the exec gives me a 404 :(
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
wowsher
Trader
Trader
Posts: 22
Joined: Sun Feb 04, 2007 5:16 pm
Contact:

Post by wowsher »

It appears to have included the comma in the link... funny.

www.ordner.us

try that link or type it in.

I tried 7z first then zip and got a message about uploading an empty file... the size is 4728757 so that should be less then 5 mb I think... but i did not do the math..

thanks
wowsher
Last edited by wowsher on Tue Mar 25, 2008 9:16 pm, edited 1 time in total.
wowsher
Trader
Trader
Posts: 22
Joined: Sun Feb 04, 2007 5:16 pm
Contact:

Post by wowsher »

I have added the master_part_list.csv to the tree. No save yet but it is a pretty decent viewer anyhow. It now must reside in the same directory as the master_part_list.csv file and it will look for the units.csv in \units

Again I just get the empty file upload error so you can find the exe (in a zip file) over at www.ordner.us in the download section.

wowsher
You do not have the required permissions to view the files attached to this post.
Last edited by wowsher on Tue Mar 25, 2008 9:16 pm, edited 1 time in total.
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

This might not be important, but, it doesn't work with version 0.4.3 of units.csv

allegedly because there is less columns in the 0.4.3 units.csv file...
that aside, it's awesome!

The Cargo_Import value is rather long, so you might consider visual word wrapping for the "edit value field".
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
wowsher
Trader
Trader
Posts: 22
Joined: Sun Feb 04, 2007 5:16 pm
Contact:

Post by wowsher »

There is a blank line in the 0.4.3 release units.csv file right after redeemer (line 553 is blank). If you delete it then it works fine. I wrote this to be flexable for number of fields but if they move the key or object type field then it may get a little strange. I am guessing this is why they want the empty rows to have commas in the newest units.csv files. I need to add some more logging, error checking and such at some point.

fyi all of the units.csv objects appear under FIXME in the 0.4.3 file

By the way the code should work on Linux and possibly Mac since it is written in python 2.5 / wxpython 2.8. If anyone needs the source to try it on those platforms let me know and I will post it.

thanks
wowsher
wowsher
Trader
Trader
Posts: 22
Joined: Sun Feb 04, 2007 5:16 pm
Contact:

Post by wowsher »

I have added some enhancements to the parsing... check out the screenshot...

I also added word wrapping to the text box.

I still have not fixed the blank line crash on version 0.4.3 but I may add code to fix it later.

The updated exe will be up over at www.ordner.us shortly.

thanks
wowsher
You do not have the required permissions to view the files attached to this post.
Last edited by wowsher on Tue Mar 25, 2008 9:17 pm, edited 1 time in total.
ismeagain
Explorer
Explorer
Posts: 15
Joined: Sun Mar 25, 2007 10:02 am

Post by ismeagain »

hey wowsher, in my program, I just tell it to edit out the blank lines. That saves a guy lots of problems, especially since blank lines contains no data, it's useless anyways.
if linelen>1:
self.data.append(line)
else:
self.control.AppendText("Blank line skipped\n")
The alternative is insert a placeholder for the blank line, then when you save the file, just insert a blank line there. Since it's a CSV viewer, then blank lines are redundant anyways.
wowsher
Trader
Trader
Posts: 22
Joined: Sun Feb 04, 2007 5:16 pm
Contact:

Post by wowsher »

ismeagain,

Thanks for the ideas. I currently like to preserve the lines (like your placeholder idea) so I can place them back into the file identically. In the newer csv files there are commas so all of the fields are there even in a "blank" line whereas in the 0.4.3 version it was a completely blank line with no commas so I will probably have to use a check like your line length check and force an entry for a blank line like I do with the newer csv (Blank# line#) so I can reconstruct the file. I appreciate your feedback!

thanks!
wowsher
wowsher
Trader
Trader
Posts: 22
Joined: Sun Feb 04, 2007 5:16 pm
Contact:

a little update

Post by wowsher »

I have now added the code to allow you to select the directory which contains master_part_list.csv and then assume that units.csv is in the units directory directly under the master_part_list.csv file. You will notice that I have split the window to allow both files to be browsed at the same time -- right now it allows browsing but I need to fix the display line at the bottom. Once I get that finished I will start looking at the save functionality. Here is a screenshot of the current build. FYI I am not releasing any functional update at this time.. once I get the bottom display fields working again I will post that update.

wowsher
You do not have the required permissions to view the files attached to this post.
wowsher
Trader
Trader
Posts: 22
Joined: Sun Feb 04, 2007 5:16 pm
Contact:

Update to v0.4.0

Post by wowsher »

I have posted the update to http://www.ordner.us go to the downloads section. I now has split trees one for units and one for the master part list you can browse both at the same time independently. Still no save ability but the open code is working so you can place the files anywhere and browse to the master part list file.

enjoy
wowsher
Last edited by wowsher on Tue Mar 25, 2008 9:17 pm, edited 1 time in total.
wowsher
Trader
Trader
Posts: 22
Joined: Sun Feb 04, 2007 5:16 pm
Contact:

Source Code Updated Site Info

Post by wowsher »

Ok I have been busy for so long I do not know if I will ever actually finish this. I think it is somewhat helpful even just as a viewer. I have not gotten too much feedback so maybe no one else likes this format? Or maybe they were holding their breath waiting for save capability? Either way I have going to post the python code here for anyone to play with etc. I may or may not ever finish. It runs on Python 2.5 (there is no reason I know of it will not run on 2.4 but I have not tried it) and wxpython (www.wxpython.org) needs to be installed to compile. I have dropped ferryside.net in favor of http://www.ordner.us which I plan to keep around for awhile. the exe version is now hosted there (nothing has changed with it).

wowsher

ps maybe posting this will give me the kick in the pants to complete this... you just never know with me...
You do not have the required permissions to view the files attached to this post.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

Thx wowsher will try it out later.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
wowsher
Trader
Trader
Posts: 22
Joined: Sun Feb 04, 2007 5:16 pm
Contact:

It's back VSEditor v0.5.0 released

Post by wowsher »

I have finally gotten some time to play with this again. I have enabled you to make changes and actually SAVE them to units.csv.out. The output format matches at the row level and I am going to test it with the engine tonight but the order of the rows within the file does NOT yet match the input. Maybe if everyone likes this we could get rid of the empty rows and such ... The master_part_list.csv is NOT yet enabled for saving. I have posted both the source and exe over at http://www.ordner.us in the downloads section. Check it out and let me know what you think. If things go well I will enable the master_part_list save then worry about the order of the rows.

oh and just to be clear there are probably a few bugs I missed so feel free to mention them in case I do not know about them.

Enjoy
wowsher aka tony
You do not have the required permissions to view the files attached to this post.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

Thx wowsher will grab your new version and put it through the proverbial winger :D


Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
bgaskey
Elite Venturer
Elite Venturer
Posts: 718
Joined: Wed Mar 07, 2007 9:05 pm
Location: Rimward of Eden

Post by bgaskey »

Busy w/ real life now (bummer :? ) but I'll give it a spin over the weekend. Even loading mpl.csv in text editor takes forever and is impossible to use :? Hope this works well 8)
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

It not bad takes a bit of getting used to like any app but it works .

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
wowsher
Trader
Trader
Posts: 22
Joined: Sun Feb 04, 2007 5:16 pm
Contact:

output not quite correct

Post by wowsher »

Well I got home and tried to run the output (units.csv.out renamed to units.csv) and it caused Vegastrike to crash. I see the file size is a couple clicks different so I must have missed one of the tricky fields. I also found out that I needed to include another dll with the exe version and have updated the files on my site with it. Funny I did not have any trouble on my other computer... It was msvcp71.dll for any that are interested no idea why. Anyhow I will have a closer look at that output when I get a chance. One other thing I found was that the refresh after saving was failing so right now you should reopen the file after you save it to ensure you are seeing what is really there. Here is the fixed / updated source to turn off that problem for now.

Thanks for taking a look!
wowsher
You do not have the required permissions to view the files attached to this post.
wowsher
Trader
Trader
Posts: 22
Joined: Sun Feb 04, 2007 5:16 pm
Contact:

version 0.5.1 Released

Post by wowsher »

I have now gotten the file saved (units.csv.final) to successfully load into Vegastrike. Unfortunately it will not reload the saved file for further editing due to some extra double quotes. However it is closer. For this release double quotes are also causing trouble with the master parts list so I have disabled that for now. The exe and source are up on www.ordner.us in the download section. I have started to integrate sqlite into the application and currently use it in the save process in a very inefficient manner (read in two csv files, join them in sqlite, reorder them, then output them to another csv).
I have posted the current source here as well.

enjoy
wowsher aka tony
You do not have the required permissions to view the files attached to this post.
Post Reply