Community
    • Login

    highlighting log files

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    pythonhighlightingudl
    15 Posts 5 Posters 7.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • gbilai1G
      gbilai1 @Ekopalypse
      last edited by

      @Ekopalypse

      I (mildly) agree since npp is a marvellous tool and as you say does risk being too feature packed with things people don’t use or are of limited value and are just clutter or bloat for regular users.

      Obviously someone created a sample exactly like the requirement I was after so the requirement isn’t too bespoke or unheard of, and I have been known to switch to use gVim to quickly scan through logs so see them colour coded and make issues just “jump out at me” quickly and easily.

      Peter’s reply of using find and mark using regex ala “.(!!!|???).” is something I was aware of and goes some way towards a non-python solution but I’ve used that in the past and yet still asked the question as it seems too clunky and I have other strings I need to search for and mark.

      I am down-level on Python - 1.0.8.0! but last time I tried upgrade npp itself to V7 the whole thing went to pot running any python script (a built-in or non-python plug-in (possibly) wouldn’t suffer). I have a few python scripts so am just concerned over upgrade paths but don’t like being down level so I may try again soon using advice on the forum as many people had issues with python and some versions of npp V7 which, hopefully, are resolved ;-(
      I even had problems going back from V7 to V6, but, I can’t remember what that issue was, but, once bitten twice shy as we say.

      ian

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones
        last edited by PeterJones

        @gbilai1 said:

        I am down-level on Python - 1.0.8.0! but last time I tried upgrade npp itself to V7 the whole thing went to pot running any python script (a built-in or non-python plug-in (possibly) wouldn’t suffer). I have a few python scripts so am just concerned over upgrade paths but don’t like being down level so I may try again soon using advice on the forum as many people had issues with python and some versions of npp V7 which, hopefully, are resolved ;-(
        I even had problems going back from V7 to V6, but, I can’t remember what that issue was, but, once bitten twice shy as we say.

        1. It’s actually possible to install PythonScript 1.4 on older Notepad++ (like v7.5.9) by just downloading the most recent PythonScript zip, and unzipping the various files on top of the existing ones in your Notepad++ plugins installation.

        2. To run python in the newest Notepad++ (v7.7.1), follow this Guide. It works, too.

        You also said:

        Obviously someone created a sample exactly like the requirement I was after so the requirement isn’t too bespoke or unheard of,

        But it’s not a universal or even majority feature-need. And it’s handled by a pythonscript, so the developers will likely see no reason to implement it natively.

        1 Reply Last reply Reply Quote 0
        • EkopalypseE
          Ekopalypse @gbilai1
          last edited by

          @gbilai1

          unfortunately, the pythonscript plugin isn’t up-to-date anymore.
          As you’ve already figured out, the plugin, for x64, isn’t fully functional since npp >=7.7
          The reason is that with 7.7 npp updated its scintilla control which itself introduced
          a change in the notification structure and therefore broke backward compatibility. :-(
          In addition, there doesn’t seem to be any progress in moving to python3.

          I’m currently working on a python3 plugin with a slightly different approach.
          The plugin itself provides just the UI interface as well as the initial python initialization
          but the wrapper code (for scintilla and notepad++) are python modules.
          I hope to make the first alpha version available at github mid to end next week.
          I’m trying to be backward compatible with the existing pythonscript plugin, means one should have minimum or better no work to do to make it run with my version of it.
          The only headache problem I have is how to implement the boost::regex thing.

          1 Reply Last reply Reply Quote 0
          • PeterJonesP
            PeterJones
            last edited by

            @Ekopalypse said:

            unfortunately, the pythonscript plugin isn’t up-to-date anymore.
            As you’ve already figured out, the plugin, for x64, isn’t fully functional since npp >=7.7
            The reason is that with 7.7 npp updated its scintilla control which itself introduced
            a change in the notification structure and therefore broke backward compatibility. :-(

            The only thing I’ve seen not work is notifications / callbacks. Other than that, PythonScript works just fine with NPP v7.7.1, for everything I’ve tried. That said, it is likely that LogfileLexer relies on notifications/callbacks, so the example script might not work with v7.7.1.

            So then my advice of how to update PythonScript in an older Notepad++ is still valid.

            EkopalypseE 1 Reply Last reply Reply Quote 1
            • EkopalypseE
              Ekopalypse @PeterJones
              last edited by

              @PeterJones

              yes, all the lexer stuff and automatic change things stuff depends on notifications.
              But you are right, PS can still be used without those limitations and < 7.7. it should be full functioning.

              1 Reply Last reply Reply Quote 1
              • Alan KilbornA
                Alan Kilborn
                last edited by

                @Ekopalypse maybe should have been more specific. Pythonscript is only broken with 64-bit version of Notepad++ >= 7.7. For 32-bit it works just fine in all aspects.

                EkopalypseE 1 Reply Last reply Reply Quote 0
                • EkopalypseE
                  Ekopalypse @Alan Kilborn
                  last edited by

                  @Alan-Kilborn

                  As you’ve already figured out, the plugin, for x64, isn’t fully functional since npp >=7.7

                  you did this on purpose so that I don’t feel dump, didn’t you? :-D

                  Alan KilbornA 1 Reply Last reply Reply Quote 0
                  • Alan KilbornA
                    Alan Kilborn @Ekopalypse
                    last edited by

                    @Ekopalypse

                    the plugin, for x64, isn’t fully functional since npp >=7.7

                    OK, you did say it. Sorry; there’s a lot going on in this thread! Including your announcement! :)

                    The only headache problem I have is how to implement the boost::regex thing.

                    Is it a headache? Can you just do it how Pythonscript does it? Or is that what keeps P.S. tied to Python 2.7? I really don’t know…

                    EkopalypseE 1 Reply Last reply Reply Quote 0
                    • EkopalypseE
                      Ekopalypse @Alan Kilborn
                      last edited by

                      @Alan-Kilborn

                      No, unfortunately not that easy.
                      I’m using cffi to build the plugin and I haven’t figured out how to add boost::regex to it and make it compile.
                      Currently I’m investigating how to make a python extension module using cython
                      or cppyy or maybe nuitka (I’m unsure, it seems to be an exe builder).
                      I’ve read that cython can handle boost templates very well so …

                      1 Reply Last reply Reply Quote 2
                      • DuckGod.pyD
                        DuckGod.py @Ekopalypse
                        last edited by

                        This post is deleted!
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors