Config Files Need Updating, Too
-
Thanks for those catches. v1.03 is now available at the permalink, and should fix both of those issues
-
@PeterJones ,
The first is what mine shows.
PythonScript plugin v2.0.0.0 uses Python 2.7.
Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 20 2020, 13:25:05) [MSC v.1500 64 bit (AMD64)] Copyright (c) 2001-2020 Python Software Foundation. All Rights Reserved.
I have Python27.dll in the C:\Program Files\Notepad++\plugins\PythonScript - directory.
And, I didn’t have the Prefer option checked, in the Options menu.
Just for confirmation. -
P PeterJones referenced this topic on
-
v1.06 is available from the permalink:
- v1.05 (2024-Sep-05): Add URLs to source code, so you remember where to get an updated copy. (was not announced, since it was not a critical feature/bugfix upgrade)
- v1.06 (2024-Sep-14): IMPROVEMENT = error handling for
<installed>\themes\
permissions- The most common error is that you don’t have write permissions for the default themes, which are installed in the installation directory instead of your AppData or other config directory.
- Users have been confused when it doesn’t complete because of write permissions, because I forgot that not everyone has PythonScript set to show the Console if there’s an error, and that error isn’t intuitive to the general audience even if they look in the Console.
- I now trap that error, and I’ve added a MessageBox to inform you of the error, letting you know that if you re-run Notepad++ As Admin, then it should work.
- Some users have found that when they run As Admin, PythonScript no longer sees their user scripts from the AppData hierarchy. If that’s the case, just save another copy of the script in the Machine Scripts section while you’re running As Admin.
- Even if you get the write error on the
<installed>\themes
, your AppData or other config-directory stylers and themes and langs.xml should all be properly updated. (If you use Windows Explorer, you should be able to see the last-modified time on the AppData or other config-directory files has been updated after running the script.)
-
v1.07 is available from the permalink:
- fix global styles
- copy global-styles colors from
stylers.model.xml
tostylers.xml
(similar to what’s already done onstylers.xml
’s lexer-styles) - when updating/adding global styles in either
stylers.xml
orthemes\*.xml
, make sure global-styles don’t have extra attributes that confuse the StyleConfigurator interface
- copy global-styles colors from
running v1.07 will clean up the Global Styles attributes to match the
stylers.model.xml
, even if you’ve run a previous version of the script - fix global styles
-
@PeterJones, I used version 1.07 of the script and the copyright information on top got removed from the theme files.
They were also unmodified, straight from the install directories, version Portable v8.7.1
-
Apparently the
xml.etree
library behaves differently between Python 2.7 and 3.12 (used by PS2 and PS3 respectively).I really wish PS3 would move out of alpha and release into Plugins Admin, so that we could just stick with PythonScript 3 for sharing scripts in the forum, and not have to contend with all the headaches of keeping scripts compatible with two major versions of Python, and all the library differences that come with that.
(it also would’ve been nice if Don hadn’t allowed theme authors to submit themes with XML that have invalid top-level comments, which the XML parsing engines don’t like because it’s not valid XML)
v1.08 is available from the permalink, fixing the handling of the invalid XML in PythonScript 2.
However, I highly recommend making the switch to PythonScript 3, despite it claiming to be alpha, unless you are using a lot of ANSI characterset files rather than real unicode-based encodings. I don’t know how much longer I’ll support PythonScript 2 for this script.
-
P PeterJones referenced this topic on
-
ConfigUpdater v1.99_beta1 – Plugin Version
Initial Beta Testing Wanted
I have what I believe to be a working ConfigUpdater Plugin which implements the same functionality as the
ConfigUpdater.py
script, but without requiring the PythonScript plugin (which is a huge overhead for many normal users).For the next few days, you can download theConfigUpdater.dll
from the Artifacts listed in this GitHub build of v1.99_beta1If, like @Alan-Kilborn, you like having a copy of the “intermediate sorted” files (which don’t include any of the “updates” that the plugin grabs from the model files, but are sorted in the same order as will be in the final version of each config file, for easier comparison of what changed), then create
...\plugins\Config\ConfigUpdaterSettings.xml
before running this plugin, with the contents:<ConfigUpdaterSettings> <Setting name="DEBUG" isIntermediateSorted="1"/> </ConfigUpdaterSettings>
If it needs Elevated UAC permissions, it will ask you, and restart Notepad++: if it restarts, you will have to run the plugin command again after Notepad++ is ready. (It will also ask, once done, if you want to go back to non-Elevated mode, because running AsAdmin is a bad idea. ;-) )
For beta testing, it’s probably a good idea to keep a copy of your original langs.xml/stylers.xml/theme files
Everything else should hopefully be self-explanatory.
Please let me know if you have problems (or if everything works great).
-
@PeterJones said in Config Files Need Updating, Too:
Please let me know if you have problems (or if everything works great).
A lot of upvotes, but no comments. Must not have any bugs. :-)
Since that post, I did a few micro updates, including improved About box, and better automation of the zipfile when I create a tag.
For beta5, I added one last feature: even on portable, where you don’t need elevated permission, when it finishes the updates, it will ask if you want to restart Notepad++ (since changes won’t take effect until a restart)
If anyone was interested in testing, the v1.99_beta5 is available at https://github.com/pryrt/NppPlugin-ConfigUpdater/releases/tag/v1.99_beta5
I am planning on submitting v2.0 to the nppPluginList repo this weekend.
-
v1.99_beta6 = BugFix: better error handling if langs.xml or a stylers/themes XML file has invalid XML – under many circumstances, it will tell you there’s an error, then open the offending file and embed a scintilla Annotation on the appropriate line number. (If it cannot figure out a line number, it will just do a MessageBox with the error, and then stop processing that file.)
(Thanks to @Ekopalypse for catching the problem.)
-
@PeterJones said in Config Files Need Updating, Too:
A lot of upvotes, but no comments. Must not have any bugs. :-)
Haven’t had a chance to test it yet, so not sure if that’s true. :-)
Update: I’ve posted my Debug info and a screenshot of what I see on a Standard install to the Github page. No request to shutdown, it just shuts down after a while of looking at the spinning wheel, and then crash closes as far as I can tell.
The portable install worked fine from what I can see. It has the same ConfigUpdaterSettings.xml file settings as the one in the AppData for the standard install, but the log for the standard install is empty. The portable one has a log of the changes made.
Not sure what happened. I did initially install it to the wrong location, putting it in the Appdata directory, but it didn’t show in plugins so did not run. I then cut and copied the entire folder to the Programs folder location and it showed in the Standard install Plugins, I ran it, and the same things happened when I ran it for the first time, and everytime I run it again…consistent.
If it doesn’t change anything being as it’s the latest version of NPP, shouldn’t it not shutdown after running it with no changes?
-
As I say in my reply over there, it looks like your copy is getting stuck long before it would ask to restart – it should have printed at least
stylers.xml
in the Status dialog. When I use my Win11 installed v8.8.1, or spin up a Win10 VM with an installed v8.8.1, it works as expected for me, so I don’t know what’s happening for you. We can continue the debug over in your Issue #2 discussion.If it doesn’t change anything being as it’s the latest version of NPP, shouldn’t it not shutdown after running it with no changes?
haha, you’re funny. The “latest version of NPP” ships with themes that have many missing LexerTypes (languages) and stylers within the lexers, which is a major reason this plugin is needed. If you’ve never run the old
ConfigUpdater.py
or the plugin version, it’s guaranteed to make changes. (And even if you have run it before, because it does things like sort the languages, it always attempts to write all the themes, so will ask to restart even if it’s writing the same values back – someday, I might get my logic better to figure out how to compare the old-vs-new for the XML, and not ask to write if it doesn’t need to; but for now, that was the easiest to program.)