@Yakoby ... here, I wrote a book for you! :read:
Python 2.7, Latest version of the Unicode wxPython release for Python 2.7. If you want somethings to work you also need to install comtypes as it is no longer included in python 2.7
Ok, installed Python 2.7.1, Unicode wxPython 2.8.12.0, which says is for Py2.7, and comtypes 0.6.2. Even though I'm running a 64-bit OS, I went with the 32-bit versions, assuming this is what most folks have now.
Checked Wrye 84, and it seems to work properly. Also checked to see that it didn't break WMSA 85, and that runs properly, too. So all good there.
Now just need to get Wrye Mash 85 running in python mode, not stand alone, and I should be good to go. Already forked it and cloned it locally.
Yeah. I possibly could automatically save the log if you thought it would be good?
I really do think it's a good idea. I'd have it output to the /Data Files/tes3cmd/Backups folder. The updated tes3cmd batch file I wrote uses this path as the default for both ESP/M backups and log files, with the "--hide-backups" option (but not the broken "--backup-dir" option) for ESP/M files, and a matching "> [path] / plugin.name-cleaned.log 2>&1" command for log files.
I'd have the backups of the original 'dirty' mods go to the default tes3cmd path as well, which should avoid confusion / overwriting of Mash backups in its default directory /Data Files/Mash/Backups.
So something like this should do the trick, I would think...
Where %cd% is "current working directory"tes3cmd clean --hide-backups --replace [selected files] > %cd%/tes3cmd/backups/[selected files]-cleaned.log 2>&1...follow it up with...tes3cmd header --hide-backups --synchronize [selected files] >> %cd%/tes3cmd/backups/[selected files]-cleaned.log 2>&1...or...tes3cmd header --hide-backups --update-masters [selected files] >> %cd%/tes3cmd/backups/[selected files]-cleaned.log 2>&1...which will prevent those annoying Yellow or Orange unsynced masters check boxes in Mash.Notice the double >> on the second two lines? This appends to the log file created in the first line.
That's the DOS command, anyway; not sure how it would be done in python or the GUI wrapper method you're using.
The thing to note here is that the two lines of code in conjunction will create a "plugin.esp" and a "plugin~1.esp" in the /tes3cmd/backups folder if it cleans the file and updates masters. Not a bad thing, IMHO, but worth noting in help files so that users understand what each one is: "plugin.esp" is the dirty mod and "plugin~1.esp" is the cleaned mod without masters updated.
Ah. Point. This really an issue with tes3cmd. The 'evil' GMSTS that exist in the expansions shouldn't be treated as evil by tes3cmd. They can then just be pulled out of future mods as they are duplicates. I should point this out to John (I am not sure if he around any more though)
tes3cmd does have some code that ignores Official ESM files as well as some others; however, dropping the plugins onto a batch file overrides this functionality - I think because it passes the entire path to %1 rather than just the plugin name; so I could easily fix this with %~nx1, but I don't think ignoring them completely is necessarily the right thing to do. We all know gamesas coders made some mistakes and dirty mods along the way. As long as the GMSTs are left alone, it shouldn't cause any problems to clean official masters.
Here's a weird thing, though ... there are supposed to be 72 total 'Evil-GMSTs' - 61 from Bloodmoon and 11 from Tribunal. If you clean Tribunal.esm and Bloodmoon.esm with tes3cmd batch, without the batch checks, it will find only the following...
Tribunal:
5 Tribunal GMSTs
61 Bloodmoon GMSTs
Bloodmoon:
9 Tribunal GMSTs
21 Bloodmoon GMSTs
Huh. Have to figure that out.
Where there is a problem is with mods that use a master and then a "control file" plugin. In some cases, the duplicates in the plugin are intentional to prevent overwriting from other mods, but in other cases, they really should be cleaned. Short of a "no clean" list like John uses in his code, I don't see an easy way around this.
I'm seriously considering taking http://code.google.com/p/mlox/source/browse/trunk/util/tes3cmd?r=697 and porting it to python so that it can be truly integrated into Mash, rather than using the GUI wrapper method.
Doing that would offer a great deal more flexibility in defining what is and isn't cleaned, including opening the door for user-defined lists in a .csv file with flags for "NoGmst", "NoDups", "NoClean", etc.
Also, would be easier to distinguish between dirty backup and clean backup without updated masters by editing the name of the backup file depending on the command.
I think it is just a simple name based backup. But then IDK. I don't know about that area of code.
I tested this, and you're partly correct. When you backup a file with Mash, it creates a name-based copy, but also creates a .ESMF file. If you backup a different mod with the same name, it overwrites the first copy, but the .ESMF file remains the same. The .ESMF file is the "very first automated backup" that Mash makes of the file, and will not change, I assume, unless you delete it.
The help file suggests using Snapshots to create multiple copies of mods, appending -01, -02, etc. to the end of each to distinguish. But you would still have to know that My_Plugin-01.esp was of a different mod, not just a later version, than My_Plugin-02.esp.
Duplicate just creates a copy of the mod in the /Data Files folder, allowing you the option to give it your own name.
Regarding the problems with batch files. I don't have a clue (I don't use Windows and have never done anything in any shell scripting languages) so I am not much help there.
As far as the batch file, I figured out most of what I needed to do. What I couldn't do within tes3cmd code, I did with DOS batch commands.
However, I did find that the tes3cmd "--backup-dir" option appears to be broken, even from the command line.
I tried these different commands straight from the /Data Files command line, but none worked...
These...tes3cmd clean --replace --hide-backups --backup-dir "c:\temp\backups" plugin.esp > plugin.esp-cleaned.log 2>&1tes3cmd clean --replace --hide-backups --backup-dir c:\temp\backups plugin.esp > plugin.esp-cleaned.log 2>&1tes3cmd clean --replace --hide-backups --backup-dir "c:\temp\backups\" plugin.esp > plugin.esp-cleaned.log 2>&1tes3cmd clean --replace --hide-backups --backup-dir c:\temp\backups\ plugin.esp > plugin.esp-cleaned.log 2>&1...throw this...FATAL ERROR (): "c:\temp\backups" does not end in .esm/.esp/.ess" at script/tes3cmd line 4736...and these...tes3cmd clean --replace --hide-backups --backup-dir "c:\temp\backups\plugin.esp" plugin.esp > plugin.esp-cleaned.log 2>&1tes3cmd clean --replace --hide-backups --backup-dir c:\temp\backups\plugin.esp plugin.esp > plugin.esp-cleaned.log 2>&1...throw this...FATAL ERROR (): Not a plain file" at script/tes3cmd line 4739
However, just using "--hide-backups" without specifying a backup folder works just fine.
Get back to me when you can. I still have to figure out this GitHub stuff and start looking through the code.
Take care,
-RMWChaos