Jump to content

Sharlikran

Recommended Posts

33 minutes ago, Sharlikran said:

I don't think I'm approaching this the right way. If there are strings to display on the screen that should be unicode. I have one plugin and the author is Russian and some of the text for the description has unicode chars in it so that needs to be accounted for.  If it's part of the file system that should be based on the file system's settings.  I'm going to have to look into things and it could be a while. I'll keep you posted. I want to resolve it correctly instead of just trying to circumvent the error.

If you mean this mod then yes, the author is a Russian modder and can be contacted at TAL.  Also, both Envy123 and Fritz are Russian modders.

Better Armor (rev-14 Glass Armor)

Link to comment
Share on other sites

I have not finalized all of the changes but I did do something that I'd like you to test and look at when you have time.  It still may not exactly address the key error because I'm still looking into that. There is a chance when I am done you may need to reset the data files again. For now what I want to test it part of wxPython and how it displays text.

After you have the current code, open a command prompt, go to the Mopy\mash folder:

1. Type "C:\Python27\python.exe mish.py dumpTranslator

2. Type "C:\Python27\python.exe mish.py getLocaleInfo

3. getLocaleInfo will write a file named localinfo.txt, post the contents here.

4. There will be a language file in the Mopy\mash\l10n folder named NEW[language].txt
 

=== masher.py, 1170
Must be sorted by Modified to enable ctrl based sorting.
>>>>
Debe estar algo aquí. íÑñóú

5. Open the file and search for, "Must be sorted by Modified to enable ctrl based sorting." don't worry about a proper translation, just put words in your language and make sure the text contains any special chars. For example in Spanish I would have íñóÑ and so on like I show above.  Make sure some are in the string below the ">>>>" symbols.

6. Rename the file by removing the NEW, so if it were NEWEnglish.txt, that would be English.txt. When you run Wrye Mash it will make a English.pkl file or a file with the proper name for your language.

7. Run Wrye Mash and on the mods tab make sure you are not sorting by modified so that you get an error trying to change the sort of the mods.

Try to sort the mods and when the error displays, can you see the special chars or are they garbled? If they are garbled try two things, one thing at a time.  The first thing is to delete the old .pkl file. Then change the mash.ini and uncomment benableunicode, so that it's true. Then run Wrye Mash and see if the text is correct. For the second test you don't have to delete the .pkl file, just uncomment benableutf8.

Which of the two things or both do you have to do for Wrye Mash to display the special chars?  If possible of course, I'm hoping you don't have to uncomment either, or possibly you only have to uncomment the benableutf8 but not benableunicode.  I'm just curious what you have to do to make it work.

Link to comment
Share on other sites

Here is the information you need to know about my language (Swedish).

cp1252
mbcs
Swedish_Sweden
1252
sv_SE
cp1252

I don't have the NEW[langauge].txt in the Mopy\mash\l10n folder and I assume it would be the Swedish.txt, but I don't have such a .txt file just these files.

de.txt

fr.pkl_

fr.txt_

Italian.txt. 

 

This is the code there is in line 1170 and I can't see anything that make sense, except for the return command and of course the gui.dialog.ErrorMessage line is quite obvious.

        if conf.settings['mash.mods.sort'] != 'Modified':
            err = _(u'Must be sorted by Modified to enable ctrl based sorting.')
            gui.dialog.ErrorMessage(self.GetParent(), err)
            return

I think we need to split this in two parts since there is something missing in the code and I can't follow your instructions when seeing this in the code in line 1170 in the masher.py file.  If that's okay with you.

Link to comment
Share on other sites

We can split it into two parts but, the first part is done already. ;)

What happens when you type "C:\Python27\python.exe mish.py dumpTranslator" from the Mopy\mash folder? It seemed to work for getLocaleInfo, so just make sure dumpTranslator is spelled correctly.  You should end up with a "NEWSwedish.txt in the "Mopy\mash\l10n" folder.

The block of code you showed me is from a python file. I wanted you to edit the NEWSwedish.txt file, and then rename it to Swedish.txt.  So try to get mish to make that file first.

Link to comment
Share on other sites

@Leonardo I found a place that didn't have the correct installer directory. Download the new Python code and see if that happens to fix your install issue with the package that had the two files.

EDIT: Actually i found more, so if you grabbed it within the last hour get it again.
EDIT2: now I get your error about the file
 

Spoiler

 


Traceback (most recent call last):
  File "mash\masher.py", line 4836, in Execute
    globalvars.gInstallers.RefreshUIMods()
  File "mash\masher.py", line 2206, in RefreshUIMods
    if mosh.modInfos.refresh():
  File "mash\mosh.py", line 3088, in refresh
    self.unload(loadFile)
  File "mash\mosh.py", line 3206, in unload
    mwIniFile.unload(fileName, False)
  File "mash\mosh.py", line 2426, in unload
    self.refreshDoubleTime()
  File "mash\mosh.py", line 2358, in refreshDoubleTime
    mtime = modInfos[loadFile].mtime
  File "mash\mosh.py", line 2770, in __getitem__
    return self.data[key]
KeyError: u'IcesRobeReplacerMW.esp'

 

 

 

If I get the above error, but I ignore it I can install the file again, and uninstall it. Then once I have installed and uninstalled it a few times I don't get the error again. It's gonna drive me crazy.

Link to comment
Share on other sites

6 hours ago, Sharlikran said:

We can split it into two parts but, the first part is done already. ;)

What happens when you type "C:\Python27\python.exe mish.py dumpTranslator" from the Mopy\mash folder? It seemed to work for getLocaleInfo, so just make sure dumpTranslator is spelled correctly.  You should end up with a "NEWSwedish.txt in the "Mopy\mash\l10n" folder.

The block of code you showed me is from a python file. I wanted you to edit the NEWSwedish.txt file, and then rename it to Swedish.txt.  So try to get mish to make that file first.

Last night, I follow your instructions and I make sure that I spelled the dumpTranslator correct as I type it now, but despite that there were no NEWSwedish.txt file present in the l10n folder.

However, today when I did that a second time there is now a NEWSwedish.txt file present.  Why I didn't see the NEWSwedish.txt last night is a mystery to me, but the only thing I can think of is that next time you want me to do something similiar in DOS I need to rename the archive first before extracting the archive that has max 8 characters due to the limitation in DOS.

Which I always do when extracting an archive by using the name of the archive as a name for a folder like this.  Extracting an archive in Windows doesn't need me to rename the archive.

test-dev.rar

test-dev folder

And having a name for an archive like Wrye-Mash-dev-yacoby-wrye.zip force me to use this "cd\Wrye~1\Mopy\mash" command in DOS, otherwise I can't go into the correct folder and execute the Python command I need to type.

5 hours ago, Sharlikran said:

@Leonardo I found a place that didn't have the correct installer directory. Download the new Python code and see if that happens to fix your install issue with the package that had the two files.

EDIT: Actually i found more, so if you grabbed it within the last hour get it again.
EDIT2: now I get your error about the file
 

  Reveal hidden contents

 



Traceback (most recent call last):
  File "mash\masher.py", line 4836, in Execute
    globalvars.gInstallers.RefreshUIMods()
  File "mash\masher.py", line 2206, in RefreshUIMods
    if mosh.modInfos.refresh():
  File "mash\mosh.py", line 3088, in refresh
    self.unload(loadFile)
  File "mash\mosh.py", line 3206, in unload
    mwIniFile.unload(fileName, False)
  File "mash\mosh.py", line 2426, in unload
    self.refreshDoubleTime()
  File "mash\mosh.py", line 2358, in refreshDoubleTime
    mtime = modInfos[loadFile].mtime
  File "mash\mosh.py", line 2770, in __getitem__
    return self.data[key]
KeyError: u'IcesRobeReplacerMW.esp'

 

 

 

If I get the above error, but I ignore it I can install the file again, and uninstall it. Then once I have installed and uninstalled it a few times I don't get the error again. It's gonna drive me crazy.

Ah, so you were able to reproduce the error I got when uninstalling a BAIN archive that has two esp at the same time.

Link to comment
Share on other sites

6 hours ago, Sharlikran said:
  Reveal hidden contents

 



Traceback (most recent call last):
  File "mash\masher.py", line 4836, in Execute
    globalvars.gInstallers.RefreshUIMods()
  File "mash\masher.py", line 2206, in RefreshUIMods
    if mosh.modInfos.refresh():
  File "mash\mosh.py", line 3088, in refresh
    self.unload(loadFile)
  File "mash\mosh.py", line 3206, in unload
    mwIniFile.unload(fileName, False)
  File "mash\mosh.py", line 2426, in unload
    self.refreshDoubleTime()
  File "mash\mosh.py", line 2358, in refreshDoubleTime
    mtime = modInfos[loadFile].mtime
  File "mash\mosh.py", line 2770, in __getitem__
    return self.data[key]
KeyError: u'IcesRobeReplacerMW.esp'

 

 

 

If I get the above error, but I ignore it I can install the file again, and uninstall it. Then once I have installed and uninstalled it a few times I don't get the error again. It's gonna drive me crazy.

It looks like the error will go away, if I install two plugins and activated both of them then I uninstall both and install them again without activating the last one since it appears to be stuck due for not being removed properly during the uninstallation.

Link to comment
Share on other sites

I just to want inform you that the Unicode error I got, which you asked about here, are now gone when using KINGPIX's BSA tool for the Better Armor (Rev-14) mod at the same time I have WMSA open. :)

Link to comment
Share on other sites

4 hours ago, Leonardo said:

I just to want inform you that the Unicode error I got, which you asked about here, are now gone when using KINGPIX's BSA tool for the Better Armor (Rev-14) mod at the same time I have WMSA open. :)

That's good to hear. I figured it might after more things were converted to unicode.

4 hours ago, Leonardo said:

It looks like the error will go away, if I install two plugins and activated both of them then I uninstall both and install them again without activating the last one since it appears to be stuck due for not being removed properly during the uninstallation.

This one is the most odd one. I can get it to work and I can get it to fail but not reliably enough.  If it failed the exact same way each and every time I might have a better idea.  I think once I get a few more things done I have to literally just go though each function, document it and then see what it really does and then I think I am going to try and get some kind of output to a file or the screen and track just how many times refresh is called. Even for the main Wrye Bash the refresh is overdone sometimes but Utumno has really streamlined that from what I understand.

Link to comment
Share on other sites

21 minutes ago, Sharlikran said:

This one is the most odd one. I can get it to work and I can get it to fail but not reliably enough.  If it failed the exact same way each and every time I might have a better idea.  I think once I get a few more things done I have to literally just go though each function, document it and then see what it really does and then I think I am going to try and get some kind of output to a file or the screen and track just how many times refresh is called. Even for the main Wrye Bash the refresh is overdone sometimes but Utumno has really streamlined that from what I understand.

After I posted my report I came to think about a feature that WB has and what I'm talking about is shown in this picture.

In the Mods tab in WB there is a "Installer" column and that column list what installed BAIN-archive a mod belongs to and clicking on one mod installer will switch to the Installers tab for the actual installed archive IIRC.

Is it possible to add that feature into WMSA?

Link to comment
Share on other sites

I may not add anything like that right away.  It just depends on what's involved and whether or not I understand enough python to do it.

For now I think I figured out the key error. I kept thinking it was related to the filename and therefore the unicode stuff. After looking at error with the key, it seems refreshDoubleTime is the cause, You have been mentioning that it happens when files have the same date, so now I just have to figure out a new routine for handling that because it's just weird how it does it.

Link to comment
Share on other sites

1 hour ago, Sharlikran said:

I may not add anything like that right away.  It just depends on what's involved and whether or not I understand enough python to do it.

For now I think I figured out the key error. I kept thinking it was related to the filename and therefore the unicode stuff. After looking at error with the key, it seems refreshDoubleTime is the cause, You have been mentioning that it happens when files have the same date, so now I just have to figure out a new routine for handling that because it's just weird how it does it.

Fair enough.  Let us focus of other things for now.  I will post my suggestions later when it's time for that.

You know that has always been a real PITA since Wrye himself released Wrye Mash 84 almost 10 years ago and when it happens one must run mlox to correct the timestamps for two plugins or more plugins.

Or manually change the timestamp in Wrye Mash and I remember how boring it was back then.

Link to comment
Share on other sites

@Leonardo Try the new code, I think I fixed it. I tested it with some test files that had the same date and it seems to uninstall them without causing an exception.

Now that you have a Sweedish.txt did you get a chance to look for that line and add some random text with special chars from your language, and test forcing the error to see if the chars show up? Don't forget to toggle the INI settings.

Link to comment
Share on other sites

Sure, I'll test it.

No, I didn't because I don't know where I need to put the special characters for the Swedish language in the line 1170.

        if conf.settings['mash.mods.sort'] != 'Modified':
            err = _(u'Must be sorted by Modified to enable ctrl based sorting.')
            gui.dialog.ErrorMessage(self.GetParent(), err)
            return
Link to comment
Share on other sites

Yes, but I mentioned you are looking in the wrong file. Don't look in the python files. You are editing the Swedish.txt file.

From the Swedish .txt file alter:

=== masher.py, 1170
Must be sorted by Modified to enable ctrl based sorting.   <<-- Don't translate this part >>>>
>>>>
Debe estar algo aquí. íÑñóú  <<-- Insert your sweedish chars and text on the line below the >>>>

Which looks like this:

=== masher.py, 1170
Must be sorted by Modified to enable ctrl based sorting.
>>>>
Debe estar algo aquí. íÑñóú

 

Link to comment
Share on other sites

Something like this, perhaps translate the "Must be sorted by Modified to enable ctrl based sorting." and add that as well.

=== masher.py, 1171
Must be sorted by Modified to enable ctrl based sorting.
>>>>
åäöÅÄÖ

 

Link to comment
Share on other sites

Yes put that, just like you have it.  Don't translate the English line, leave that part alone.  Also, you need to make sure that you set the encoding of Swedish.txt to UTF8 in Notepad++. To do that when you open the file go to encoding, and then Convert to UTF8. After you do that then it should respect the extended chars for your language.

After that try to force the error in Wrye Mash by making sure it's obviously not set to modified.  Then toggle the INI settings to see what you have to do in order to see the extended chars in the error message Wrye Mash displays.

Link to comment
Share on other sites

6 minutes ago, Sharlikran said:

Yes put that, just like you have it.  Only you need to make sure that you set the encoding of Swedish.txt to UTF8 in Notepad++. To do that when you open the file go to encoding, and then Convert to UTF8. After you do that then it should respect the extended chars for your language.

After that try to force the error in Wrye Mash by making sure it's obviously not set to modified.  Then toggle the INI settings to see what you have to do in order to see the extended chars in the error message Wrye Mash displays.

Just a quick question.  I open it in Notepad++ and there are two options for converting;  1) UTF8 [without BOM] - 2) UTF8.  However, in the Format menu it says Coding UTF8 (without BOM).  Which one should I pick or just leave it as it is?

Link to comment
Share on other sites

Choose the one in the lower portion of that menu that says "Convert to UTF-8" don't choose the without BOM one.

Also don't bother translating anything because text will most likely change. This is just to test out the language settings for wxPython.

See you tomorrow.

Link to comment
Share on other sites

Alright.  Done.

Btw... I tested the new code and now I made an interesting observation regarding the bug we both had when installing two plugins at the same time from a BAIN archive.  What I found is that the last plugin is activated by default while the first one are not activated.  Perhaps that is why the "installing two plugins from a BAIN archive" bug gets triggered and make it impossible to click on without getting this error.

Traceback (most recent call last):
  File "mash\masher.py", line 4836, in Execute
    globalvars.gInstallers.RefreshUIMods()
  File "mash\masher.py", line 2206, in RefreshUIMods
    if mosh.modInfos.refresh():
  File "mash\mosh.py", line 3089, in refresh
    self.unload(loadFile)
  File "mash\mosh.py", line 3207, in unload
    mwIniFile.unload(fileName, False)
  File "mash\mosh.py", line 2427, in unload
    self.refreshDoubleTime()
  File "mash\mosh.py", line 2359, in refreshDoubleTime
    mtime = modInfos[loadFile].mtime
  File "mash\mosh.py", line 2771, in __getitem__
    return self.data[key]
KeyError: 'LotsOfRingsPlus.esp'

Shouldn't all installed plugins from a BAIN archive be deactivated by default in the Mods tab and AFAIK that has always been like that in WB.

Link to comment
Share on other sites

Traceback (most recent call last):
  File "mash\masher.py", line 4836, in Execute
    globalvars.gInstallers.RefreshUIMods()
  File "mash\masher.py", line 2206, in RefreshUIMods
    if mosh.modInfos.refresh():
  File "mash\mosh.py", line 3089, in refresh
    self.unload(loadFile)
  File "mash\mosh.py", line 3207, in unload
    mwIniFile.unload(fileName, False)
  File "mash\mosh.py", line 2427, in unload
    self.refreshDoubleTime()
  File "mash\mosh.py", line 2359, in refreshDoubleTime
    mtime = modInfos[loadFile].mtime
  File "mash\mosh.py", line 2771, in __getitem__
    return self.data[key]
KeyError: 'LotsOfRingsPlus.esp'

 

You don't have the latest code. That's still the old code.

Those lines in unload are commented out now, so there is no line 2427 that has a command on it, it's a comment now.

Link to comment
Share on other sites

I just tested installing 7 mods for a total of 11 ESP/ESM files. None of them were active by default and that's exactly how I want it.  Although, I didn't make it do that.

Link to comment
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...