Auto Update CudaText

hycmos
Posts: 86
Joined: 06.11.2019 02:17

Post by hycmos »

could we have at least an auto notification that there is an update available?
I have made one plugin by the "Make Plugin" by myself to check the new version.
It only have the check function manually.

here is the modified code in the __init__.py of this plugin:
(just modify the def run() only)

Code: Select all

import os,urllib.request,re
    def run(self):
        response =  urllib.request.urlopen('https://cudatext.github.io/history.txt') # open URL
        html = response.read()            # read
        html = html.decode('utf-8')            # decode
        newcudatext1=re.search('\d+\.\d+\.\d+\s*\(',html).end()
        html0=html[0:newcudatext1]
        html1=html[newcudatext1:len(html)]
        newcudatext2=re.search('\d+\.\d+\.\d+\s*\(',html1).start()
        html2=html1[0:newcudatext2]
        msg_box_ex('New Version',html0+html2, ['OK'], MB_ICONINFO, focused=0)
This plugin can works.
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

Nice, you can add ^ regex modifier to search for NN.NN.NN only at line start.
But it shows info about one last version, not N last versions since e.g. 1.160.0.
hycmos
Posts: 86
Joined: 06.11.2019 02:17

Post by hycmos »

main Alexey wrote:Nice, you can add ^ regex modifier to search for NN.NN.NN only at line start.
But it shows info about one last version, not N last versions since e.g. 1.160.0.
OK, I added the '^' to search at the line start. It makes the result is more accurate. the words in the middle of text will not be matched.
:lol:
Post Reply