Old Pythonscript stopped working



  • I am on latest npp and latest python script.

    Previously, my this script used to remove some not-visible (zero-width) spaces that Google Translate used to put in the translated text.

    #coding=utf8
    editor.beginUndoAction()
    #removes ZERO WIDTH SPACE
    editor.replace(unichr(8203),"")
    #removes ZERO WIDTH NON JOINER
    editor.replace(unichr(8204),"")
    #removes ZERO WIDTH JOINER
    editor.replace(unichr(8205),"")
    editor.endUndoAction()
    

    It is not working not to do the same thing. I don’t know when it stopped working and how many such characters seeped in to my final text.

    रोग के लिए नैदानिक ​​परीक्षण विकसित करना
    ----------------^
    

    If you go through above Hindi (devanagari) line, there are two such not-visible (zero-width) spaces at the start of 5th word परीक्षण। you can feel that by moving keyboard cursor over there.

    If you don’t know this script and face problem in locating that, move keyboard cursor over entire line and at a place you will notice that when you press right arrow on keyboard, cursor doesn’t move on the screen twice.

    I don’t know what changes npp or python script had introduced that had caused my working script to stop working.

    I don’t know why you can incorporate such changes that breaks down a working script, especially when now everything is on “autoupdate” mode, that we don’t prevent updates from being incorporated.

    Anyway, what is the problem causing it and what is the solution for me?

    Thanks.

    Rawat



  • something is inconsitent

    my npp7.8.9 (64bit) (W10) Plugin manager is showing installed Pytonscript 3.0.3.0

    but when I google for python script and reach
    https://bruderste.in/npp/ps/download.shtml

    that shows latest version 1.0.8.0

    so where did I get 3.0.3.0 version? I downloaded and installed from information given in mailing list. I have deleted the posts so I am not able to remember which mailing list.

    I don’t know if that is what caused the problem.

    it is sad that pythonscript About page doesn’t give any single site name or link to reach official page, download page or help forum of pythonscript.

    Thanks.
    Rawat





  • @V-S-Rawat

    Please note that v3.0.3.0 is clearly marked on https://github.com/bruderstein/PythonScript/releases as a “Pre-release” alpha version with Python 3 support:
    d0828abd-755d-4c6a-9901-0037bfa1fab5-image.png

    This means it is not necessarily fully debugged. It also means that some scripts are likely to change, because all fully-released versions of PythonScript have used Python 2, not Python 3, and there are differences in syntax.

    my npp7.8.9 (64bit) (W10) Plugin manager is showing installed Pytonscript 3.0.3.0

    No it doesn’t, because Plugin Manager is a deprecated plugin which is not compatible with NPP7.8.9. Plugins Admin is the builtin tool that shows and manages npp7.8.9 plugins. You have been around long enough to know the difference, and to use the right words.

    https://bruderste.in/npp/ps/download.shtml that shows latest version 1.0.8.0

    v1.0.8.0 is not the latest version. I’m pretty sure that version isn’t even compatible with Notepad++ v7.8.9. That website is out of date. Please note that the Plugins Admin tool tells you that the modern homepage for PythonScript is the github page:
    a28f7d05-9dff-48ed-9ef7-d855d0d7370d-image.png

    The version that you can download from Plugins Admin is the version I showed above: v1.5.4. If you look on the official github releases page, v1.5.4 is clearly marked as the “latest release”:
    a32c9c18-c5cc-428f-93f5-404ef9e5ced4-image.png

    When I run your code with v1.5.4, it works.

    If you are going to be an alpha/beta tester for v3.0.3, you are going to have to use Python 3 syntax and make sure that the PythonScript API hasn’t changed. But if you want things to “just work” the way they used to, I would highly recommend you un-install the v3.0.3 Alpha version, restart, then use Plugins Admin to install the latest v1.5.4 full-release.



  • @V-S-Rawat said in Old Pythonscript stopped working:

    especially when now everything is on “autoupdate” mode, that we don’t prevent updates from being incorporated.

    By the way: nothing forced you to install the pre-release alpha version. If you had just used Plugins Admin to install PythonScript in the first place, you would have gotten a version that worked as you would expect. Don’t complain about “auto updates” when nothing about the installation of 3.0.3 was automatic: you had to manually install that, by choice.



  • @V-S-Rawat said in Old Pythonscript stopped working:

    I don’t know why you can incorporate such changes that breaks down a working script

    Please try to bear in mind that all this is provided to you at NO COST.
    Thus you should approach things from an attitude of GRATITUDE.
    And not one of BLAME.

    everything is on “autoupdate” mode

    Nothing here is on full “autoupdate mode”
    You have to approve all updates before they happen.
    This means that it is your responsibility to know what you are doing (that is, to know what you might be getting into).

    It is also your responsibility to know what versions of softwares you are using, and where you obtained them from.
    AND…what differences there might be from previous versions.

    So…about your issue:

    Pythonscript 3.x is a major change from 1.x.
    If you’ll notice, 2.x was skipped.
    This is a tip off that there are huge changes, and also a nod to the fact that it uses Python 3.x rather than Python 2.7.x as its base.
    If you know anything about Python, you’ll know that the major difference between 2.x and 3.x is that 3.x is fully prepped for Unicode handling.
    And, in looking at your script, what is it doing?
    A Unicode manipulation.
    So your choices are to either figure it out (what you need to do to your script so that it works under PS 3.x, or downgrade PS to 1.x where your script will likely go back to working.

    And also, learn some gratitude. :-)



  • @PeterJones

    yes it was Plugin Admin, sorry for not updating my old lingua.

    this link
    https://github.com/bruderstein/PythonScript
    that is shown in your image takes to a page that shows this link
    npppythonscript.sourceforge.net/
    that again takes to the page that shows pythonscript v 1.0.8.0

    so, back to square one.

    where do you find this 1.5.4 version? If you could give some link I will download and install this version itself and test whether my script starts working again.

    Thanks.

    Rawat



  • @V-S-Rawat said in Old Pythonscript stopped working:

    where do you find this 1.5.4 version?

    My post included a link and a screenshot.

    https://github.com/bruderstein/PythonScript/releases

    Note, I gave this link. But you gave the link https://github.com/bruderstein/PythonScript/ earlier, and the only way to get v3.0.3 from that site, which you apparently already accomplished, was to navigate from there through the “releases” link to the https://github.com/bruderstein/PythonScript/releases page.
    So you knew that page already.

    Scroll down to the first one on that page that doesn’t say “pre-release”. Note that it matches my screenshot from above:

    Or use the Plugins Admin to install Notepad++, as I suggested you do. It will install v1.5.4, like I said it would.



  • @Alan-Kilborn

    It is not my first interaction on this site, and my previous interactions didn’t fetch me tags of “no cost” “nobody forced”, “gratitudeless” “blamer”, etc, that you coined.

    Rather, you came here to undermine and scold me like a school going kid.

    Someone has a problem that is big for him, You don’t have any solution to him, You should have stayed away and first let others help who can help. Your scolding could have come later.

    but you have your priorities.

    I don’t know python or pythonscript, I “assembled” my script taking codes from this that site, without understanding what it means, just that the final script did work.

    Now, something happened sometime back in unknown duration, and the script didn’t work, and I didn’t come to know and might have spoiled my 90000 rows of excel data.

    And it is my mistake keeping my software updated, using free software, not having gratitude. Great assessment of me.

    If we use a free software, we become slave of the developer and we loose all our human rights and the developer can kill us, destroy us or our data?

    Now I understand this fine print.

    Thanks for your nice words.

    Rawat



  • @V-S-Rawat said in Old Pythonscript stopped working:

    this link
    https://github.com/bruderstein/PythonScript
    that is shown in your image takes to a page that shows this link

    that again takes to the page that shows pythonscript v 1.0.8.0

    Perhaps the problem is that the link you show takes you to a page that doesn’t directly have a “releases” button. However, if you click where it (currently) says “30 tags” you are quickly taken to the correct place.

    Your linked page also shows text that says “see also (sourceforge)”.
    These days I’m not sure why someone would think that a project that is on github would have a more-current hosting on sourceforge, but maybe that’s just my thinking. The “see-also…” part should have been a big clue that it is “historical”, but again, just the way I happen to think.



  • @PeterJones

    I downloade v1.5.4 and installed it,

    though my Plugin Admin is still showing pythonscript v3.0.3 and when I ran my pythonscript on my text, it crashed with the message given in this image.

    ps.jpg

    seems I have to first uninstall previous pythonscript, and then reinstall 1.5.4.

    though I wonder whether that would all previous settings of pythonscript and delete my old script, and I have to figure out again what goes where, that I have forgotten across the years.

    Anyway, going to do that. no other way out.

    And Kilborn will again be angry at me that my 2 hours got wasted on all this and more is going to be spent.

    Thanks.

    Rawat



  • @Alan-Kilborn said in Old Pythonscript stopped working:

    that doesn’t directly have a “releases” button.

    d2fa3632-eb85-4076-a0b9-01fd07382f97-image.png
    The “Releases” on the right (which turns blue when you hover, indicating it’s a link) takes you to the releases page, with all the alpha and permanent releases.
    The “Latest” link in the green takes you to just the latest release, v1.5.4.



  • @V-S-Rawat said in Old Pythonscript stopped working:

    seems I have to first uninstall previous pythonscript, and then reinstall 1.5.4.

    Yes. That is why I specifically said,

    I would highly recommend you un-install the v3.0.3 Alpha version, restart, then use Plugins Admin to install the latest v1.5.4 full-release.

    Note the words “I would highly recommend you un-install the v3.0.3 Alpha version”. That was meant to indicate that you uninstall the v3.0.3 before trying to install the v1.5.4. Apparently, that wasn’t clear enough.



  • @PeterJones

    Solved.

    I uninstalled and reinstalled pythonscript, this time directly through plugin admin, it installed v1.5.4

    Then I ran my script on my text, and the script is working again.

    Thank God.

    Now, I am freezing my pythonscript plugin to 1.5.4 and will not update it ever, untill it stops working for some future npp.

    Thanks.

    Rawat



  • @PeterJones said in Old Pythonscript stopped working:

    The “Releases” on the right (which turns blue when you hover, indicating it’s a link) takes you to the releases page, with all the alpha and permanent releases.
    The “Latest” link in the green takes you to just the latest release, v1.5.4.

    I stand corrected.
    Perhaps I’m alone in this, but I’m more used to github showing a “releases” button/link up across the top of such pages, and not on the right; but truly, Peter is correct, and it is there.



  • @Alan-Kilborn said in Old Pythonscript stopped working:

    Perhaps I’m alone in this, but I’m more used to github showing a “releases” button/link up across the top of such pages

    That’s a recent change. I think I originally opted into the “feature preview” that made the UI slightly more “modern”, but moved the releases/most-recent links to the harder-to-find location, so I got used to it. But it appears that’s no longer a “feature preview”, and may have been pushed to everyone.



  • So that readers here know: @V-S-Rawat submitted a feature request on https://github.com/bruderstein/PythonScript/issues/155 to add the github URL to the PythonScript About dialog: I agree with that. I also added in the same request that they either get the old sourceforge pages updated to direct people back to the github for newer revisions, or that they remove the sourceforge links from the github page altogether, as it causes nothing but confusion.



  • Hello, @v-s-rawat, @peterjones, @Alan-kilborn and All,

    @v-s-rawat

    Of course, I understand that you may easily assign a shortcut, using a Python script for such a task !

    But, personally, you could use the simple regex S/R below :

    SEARCH [\x{200B}-\x{200D}\x{2060}]

    REPLACE Leave EMPTY

    Moreover, you may also record this specific S/R in a macro ! Insert these lines, below, in the Macros node of your active shortcut.xml configuration file

            <Macro name="Zero Width Format Characters" Ctrl="no" Alt="no" Shift="no" Key="0">
                <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
                <Action type="3" message="1601" wParam="0" lParam="0" sParam="[\x{200B}-\x{200D}\x{2060}]" />
                <Action type="3" message="1625" wParam="0" lParam="2" sParam="" />
                <Action type="3" message="1602" wParam="0" lParam="0" sParam="" />
                <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
                <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            </Macro>
    

    To see a representation of these zero-width format characters, use the Mark feature, and the regex :

    SEARCH [\x{200B}-\x{200D}\x{2060}]

    against the text, below :

    -----> <-----	0020	0020	SP		SPACE
    
    ----->​<-----	200B	8203	ZWSP	ZERO WIDTH SPACE
    ----->‍<-----	200C	8204	ZWNJ	ZERO WIDTH NON-JOINER
    ----->‌<-----	200D	8205	ZWJ		ZERO WIDTH JOINER
    ----->⁠<-----	2060	8288	WJ		WORD JOINER
    

    Strangely, depending of the current font used, in N++ :

    • The zero width space wrongly looks like a normal space character or like a thin space character

    • The word joiner character is wrongly seen as a true character, with a glyph representation

    On my system, only the PMingLiU and Symbola_Monospacified fonts show, as expected, 4 zero-width characters !


    Refer to the link, below, for additional information :

    https://www.unicode.org/charts/PDF/U2000.pdf

    Best Regards

    guy038



  • @guy038

    dear sir,

    my issue is: How do I know what has stopped with each update of npp/ pythonscript/ python?

    How many of us dutifully every word of release note each of hundreds of software/ plugins/ addons/ drivers that we are using on our pc.

    When we have installed something and seen it working once, we wish and believe that it will be forward compatible and will continue working in future updates of any component of it.

    AND, if it doesn’t work, we should be notified somehow that it will not work any more, so that we check what has stopped working and how to correct it.

    There is the irresponsible work of a developer.

    If something has stopped working in a ps update, we don’t come to know that it has stopped working, and there is no message and we believe that it has worked behind the screen as earlier.

    That is what is wrong. If some previous syntax has stopped working, python and/ or pythonscript developers should throw a syntax error for that right there in the first run, so that the user at least gets to know that it is not working any more, then the user either learn the new syntax and edit his script to work with the new update, or the user can revert to previous update to keep his old script working.

    I think it is a mistake of pythonscript developers that they have allowed the old syntax as valid even when it is not working.

    I think that is what alpha beta testings are for.

    So I guess ps developers should give a thought to this.

    Thanks.

    Rawat



  • @guy038

    npp shortcuts themselves are not a easy task. Such a simple thing is made so complex in npp. If we need to copy a shortcut to a new one and make a few changes to create another shortcut doing something else, that is not easy and probably just impossible, it is rather easy to go through entire charade of recording a new shortcut from scratch.

    You can compare how easy a MS-word macro is to copy and modify, and how complicated is a npp shortcut to copy and modify.

    I had planned to learn pythonscript as that opens a wide range of possibilities to create various MS-word like macros to do various things. It has far more flexibility.

    Thus, I learnt and made this first pythonscript and it started working, then I lost steam about learning pytonscript, and got busy in other things. Human mind is not so eager to learn new things at age of 60 years.

    so, when ps is available as a allrounder option, I would like to use that, instead of using a npp shortcut.

    Though I indeed have created half a dozen npp shortcuts that I have to use several times almost daily.

    Thanks.

    Rawat


Log in to reply