Jump to content

Recommended Posts

Hey @Utumno, I know Wrye Mash would never be refactored to use this wrapper, but for general everyday Python, I just wanted to make you aware of Path.py.

I think it's awesome and makes short work of anything to do with os.path.

For example, instead of:

import os

with open(os.path.abspath(os.path.join(*path_list)), 'w', encoding='utf-8') as f:
    f.write(text)

You'd just write:

from path import Path

Path(path_string).write_text(text, encoding='utf-8')

Whaaaaat. :teehee:

Check out the linked API. Just thought I'd mention it because I saw a bunch of commits in my inbox about os.walk.

Link to post
Share on other sites
  • Replies 328
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Yeah I was able to add another field! There was also a bug in the routine where the Morrowind directory wasn't assigning the path to the global variable correctly.

All I can say right now is that I do the testing and Sharlikran does the coding stuff.  Here is the latest improvement, but that's a lot more stuff to do.  I'll leave the rest to Sharlikran since

Thanks for asking but I'm not sure how to answer that. What would you be looking for in a status? I am going to try and just say what I have changed. I am still adding Unicode syntax as it is an

Posted Images

29 minutes ago, fireundubh said:

Hey @Utumno, I know Wrye Mash would never be refactored to use this wrapper, but for general everyday Python, I just wanted to make you aware of Path.py.

I think it's awesome and makes short work of anything to do with os.path.

For example, instead of:


import os

with open(os.path.abspath(os.path.join(*path_list)), 'w', encoding='utf-8') as f:
    f.write(text)

You'd just write:


from path import Path

Path(path_string).write_text(text, encoding='utf-8')

Whaaaaat. :teehee:

Check out the linked API. Just thought I'd mention it because I saw a bunch of commits in my inbox about os.walk.

Thanks but if I'd go for a wrapper I'd go for pathlib which is in the python3 std

 

EDIT: those commits are for scandir which considerably speeds up os.walk - also in p3 std

Link to post
Share on other sites

I see.  That might explain why the first code line you posted hasn't changed since Wrye (he retired from the modding scene in May 2009) stop maintaining Wrye Mash back in 2008 when Wrye Mash 84 was released IIRC.

Since then nobody has refactor the code until now when Sharlikran began to work with Wrye Mash.  Both Melchor and Yacoby only added improvements for Wrye Mash like this.

Melchor - make it is possible to run Wrye Mash as an exe , hence its name Wrye Mash Stand Alone, and added the Utility tab

Yacoby - backported the Ctrl+<arrow key> mod sorting feature that WB has into the code, plus created menu commands for external mod tools such as mlox and tes3cmd (simply mod cleaner tool and from what I heard a powerful tool)

Link to post
Share on other sites
8 hours ago, Leonardo said:

If you want to test the new code as an exe then just say the word and I'll compile the code for you. :)

WORD. :P  I've been looking for a good reason to load up Morrowind again! :D

Is there anything in particular you'd like me to look for? I suppose I should look at the "Issues" on Git?

Link to post
Share on other sites

Yes.  I think what Sharlikran wants to know is how his updated WMSA works for people in the US.  Looking for issues on Git is not a bad idea, plus make observations for existing issues and possibly new issues when installing/uninstalling mods in BAIN.

I know one issue that hasn't been fixed yet and that's the "edit the file header" bug, which Yacoby's WMSA has and Melchor's WMSA has not.  Sharlikran's WMSA is a fork of Yacoby's WMSA, so the "edit the file header" bug still exist in the latest WMSA branch.

Wrye Mash.rar

Download this archive and extract it where you want it, but remember not to extract it into the Morrowind folder, otherwise you'll get a Morrowind\Wrye Mash folder.

Instead open it in 7zip or in WinRAR (I use WinRAR) and only extract the Data Files, Mopy folder by clicking on the Wrye Mash folder then select both the Data Files and the Mopy folder.

After that select the Wrye Mash.exe then right click and send it as a shortcut to desktop.

Link to post
Share on other sites

It's when I click on the Save button and this is the error I get when I try to Save the file header via the master lists to the bottom right.

Traceback (most recent call last):
  File "mash\masher.pyo", line 1502, in OnSave
  File "mash\mosh.pyo", line 2649, in writeHedr
  File "mash\mosh.pyo", line 2008, in getSize
struct.error: argument for 's' must be a string

 

Link to post
Share on other sites

Then I need to have all the exact details and the exact file because I can't reproduce it.  When I try to reproduce it I'm working with test files that have Morrowind.esm and Bloodmood.esm as the master.  So when I change Bloodmood.esm  to Tribunal.esm then click save it works.  I even have the description and the author as empty strings, it still packs the data and returns the size of the data which is what those routines do.

Link to post
Share on other sites
3 minutes ago, Leonardo said:

The plugin I try to edit the file header is the Mashed Lists.esp (can be found in the Mopy\Extras folder) in WMSA had the same error that Yacoby's WMSA has.

That's what I'm changing as well. So I would need the exact setps.

1. Right click import blah blah blah

2. do blah

3. do blah

4. do blah

5. Right click file name in plugin

6 set it to blah

7 Right click file name in plugin

8. Right click import blah blah blah

9. right click the file name and set it to Tribunal.esm

Then tell me that I will get the error after the 9th step.

You can't leave out even one thing because remember I have never used this so if you listed 2 steps when really you do 9 steps I still may not reproduce it. Also I need some of the files you are using because remember you have a Unicode system. Who knows whether or not that's a factor. I have no idea what could be happening. All I know is it works for me no matter how many times I change the filename in the header and no matter which plugin I choose. I can even choose that mod by that Russian guy, whatever I want to test with works.

So you are simply doing everything correctly, nothing wrong, nothing unreasonable, but you know what you are doing and I don't so I just test renaming the file and it works so then I can't fix it since I can't reproduce it.

Link to post
Share on other sites

Oh boy, let us slow down a bit.  When I say "edit the file header" I mean to select the Mashed Lists.esp then start typing, shown in this picture, in the description field to the right.

mod_description-WMSA.thumb.jpg.3171b3bf2d5b808965ecc77c592ae997.jpg

Then I click on the Save button in the bottom and doing that will always throw this error below.

Traceback (most recent call last):
  File "mash\masher.pyo", line 1502, in OnSave
  File "mash\mosh.pyo", line 2649, in writeHedr
  File "mash\mosh.pyo", line 2008, in getSize
struct.error: argument for 's' must be a string

So if you want to fix it then I suggest that you take a closer at the code for Melchor's WMSA, because in his WMSA the edit the file header feature does work as intended.

Link to post
Share on other sites
1 hour ago, Sharlikran said:

I have still never imported the leveled lists or whatever because I just have the three DLC installed usually. I install other mods to test with but them I uninstall them because I'm not playing or using them. I'm just testing the program.

So you have never imported the Levelled Lists.  Well then do this...

1.  Install the LotsOfRings mod I mention here

2.  In the Mods tab select the Mashed Lists.esp and make sure it's activated then right click

3. Select the Import menu option and click on the Merge Levelled Lists in the sub-menu

4. Now you should get a message window saying that the levelled lists for the following mod(s) has been merged

That's about it.

Link to post
Share on other sites

Like I said previously. To address an issue I can't compare Wrye's code, Melchor's code, or Yacoby's code to the current code because it's all the same code and I haven't just gone around and randomly changing stuff.  So I can't go back and look at the code if I don't know where the variables get their information from, what values are in the variables, what you have to do in the UI to get the error, and so on.

Now you said you updated the header "via master lists to the bottom right" but you are actually editing the description of the file. For example, say I have a mod and the author didn't give a description. Now I can't see why you would want to do that, but who cares, it's a valid thing to do in my opinion. So in the empty description field, you are adding a description, and after you do that then you go to the bottom, where the only save button is under the list of masters, and you click save to save the header.

So the short version is, you are altering the description of the mod and when you save it you get that error, correct?

Link to post
Share on other sites

I just want to clarify about what I meant by looking in the code for Melchor's WMSA, because his WMSA does not have the edit the file header bug that Yacoby's WMSA has, but my guess is that Yacoby may have change the lines for a variable or two when he added the menu command for both mlox and tes3cmd via the popup menu in the Mods tab.

However, I can compare the files between Melchor's WMSA and Yacoby's WMSA by using the ExamDiff tool, just to see if I can find a difference between these files in the code.  I'll start with the files that's inlcuded in the error and go from there.

27 minutes ago, Sharlikran said:

So the short version is, you are altering the description of the mod and when you save it you get that error, correct?

Yes, that's correct.

Link to post
Share on other sites
3 hours ago, Leonardo said:

However, I can compare the files between Melchor's WMSA and Yacoby's WMSA by using the ExamDiff tool, just to see if I can find a difference between these files in the code.  I'll start with the files that's inlcuded in the error and go from there.

You can of course I'm not going to stop you but it's not needed. I really don't want to keep discussing what the old code did.  I want to look at the issue, figure out why there is no string assigned to things when you just updated the description field, and make sure that changes so it works.

Just in the future do what I did with the short version. Type the long version out to yourself, and then paraphrase it to me. Then you can say things like when I update the description field for a mod and click save I get an error. Then I don't go looking at the masters of the file trying to figure out why renaming the files works fine for me but not you, when you are changing the description.

Link to post
Share on other sites
57 minutes ago, Sharlikran said:

Okay now try the new code and see if it works.

Yes, you fixed the edit file header bug for both Python and exe version. :dancing:

I just want to report something and maybe I did something wrong, but now I notice there is a Data Files folder in the same folder level as Morrowind.  Which is wrong and it has the Mash\Backup folder (empty) inside the Data Files folder.  Why is that?

Link to post
Share on other sites

That I'm not sure. So there is supposed to be a backup folder, and I have one with files in it. So there could be something going on with unicode that I have to fix but I don't know. Also it could be because you are not running Wrye Mash from the morrowind folder because I overlooked something. I can test it but no promises.  So here is what I would expect anyway.

  • G:\Games\steamapps\common\Morrowind\Data Files\Mash
  • G:\Games\steamapps\common\Morrowind\Data Files\Mash\Table.pkl
  • G:\Games\steamapps\common\Morrowind\Data Files\Mash\Backups

You Should not have this:

G:\Games\steamapps\common\Morrowind\Data Files\Data Files\Mash\Backups

Link to post
Share on other sites
4 minutes ago, Sharlikran said:

That I'm not sure. So there is supposed to be a backup folder, and I have one with files in it. So there could be something going on with unicode that I have to fix but I don't know. Also it could be because you are not running Wrye Mash from the morrowind folder because I overlooked something. I can test it but no promises.  So here is what I would expect anyway.

  • G:\Games\steamapps\common\Morrowind\Data Files\Mash
  • G:\Games\steamapps\common\Morrowind\Data Files\Mash\Table.pkl
  • G:\Games\steamapps\common\Morrowind\Data Files\Mash\Backups

I know about the backup folder for Wrye Mash.  Maybe it's Unicode, I dunno.  Yes, I run WMSA outside of Morrowind, so perhaps the Data Files\Mash\Backup folders are generated into the wrong folder level.

Agreed, it should be what you listed there.

4 minutes ago, Sharlikran said:

You Should not have this:

G:\Games\steamapps\common\Morrowind\Data Files\Data Files\Mash\Backups

Definitely not expected so something is wrong and the question is what is wrong.

Link to post
Share on other sites

But I gave an example.  Your response to my example was, "Definitely not expected so something is wrong and the question is what is wrong" which is confusing. Do you have that? If not then don't comment on it.  Only report what you do have.

Quote

but now I notice there is a Data Files folder in the same folder level as Morrowind.  Which is wrong and it has the Mash\Backup folder (empty) inside the Data Files folder.  Why is that?

So that didn't make any sense. Well it does but to me what you said is that you have a Data Files folder the same level as Morrowind.  Which would be this.

G:\Games\steamapps\common\Morrowind\Data Files

Which was confusing because that's how it works. Your supposed to have that.

So rather then put it in words, give me the complete path to the empty backup folder.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...