![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Plugin update warning?
Perhaps it would be feasible to have Sigil check every now and then if there is an update of a plugin available. Just a check as far as I am concerned, no need for automatic download and install.
I often forget to update the plugins or even to check if there is a new version available. Could be that I am the only one though. |
![]() |
![]() |
![]() |
#2 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,174
Karma: 144286760
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
Doesnt require this a repository? Currently everything is "hidden" in Post's as an attachment,
|
![]() |
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,485
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Yes, but each plugin developer's plugin code could query their own plugin's date or filename right on MR and download its updated self.
In other words, you do your own update check pointing to wherever you make your plugin available. This should be doable in python quite easily. |
![]() |
![]() |
![]() |
#5 |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,485
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Once I get Sigil-0.9.2 out there (hopefully before the holidays), I will put together a code fragment that does this by example (unless someone beats me to it)
KevinH |
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Super Kevin, that would work as well of course.
|
![]() |
![]() |
![]() |
#8 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,485
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi,
Here is a little snippet of code to give the general idea. I put this together quickly to give you some idea of how to go about this. I am sure a simpler/tighter version is possible but this works in my testing for both python and python3 Code:
from __future__ import unicode_literals, division, absolute_import, print_function import sys import os from quickparser import QuickXHTMLParser try: import urllib.request as url_request except ImportError: import urllib2 as url_request def check_for_updates(site_url, plugin_path): plugin_name = None version = None ps = QuickXHTMLParser() try: # get the most up to date release version info # looks for the name of the current Mobileread Attachment # You could easily add current version info anyplace on the site req = url_request.Request(site_url) response = url_request.urlopen(req) the_page = response.read() # you could replace all of the parsing with simple regular # expressions here as well ps.setContent(the_page) get_plugin_name = False for (text, tagprefix, tname, ttype, tattr) in ps.parse_iter(): if text is not None: if get_plugin_name: plugin_name = text break elif tname == "a" and "href" in tattr: href = tattr["href"] if href.startswith("attachment.php?"): get_plugin_name = True; except: pass # now get the current version of the installed plugin try: ppath = os.path.join(plugin_path, "plugin.xml") get_version = False with open(ppath,'rb') as f: data = f.read() ps.setContent(data) for (text, tagprefix, tname, ttype, tattr) in ps.parse_iter(): if text is not None: if get_version: version = text break elif tname == "version"and ttype == "begin": get_version = True except: pass return plugin_name, version SITE_URL = "https://www.mobileread.com/forums/showpost.php?p=2973066&postcount=1" PLUGIN_PATH = "/Users/kbhend/Desktop" plugin_name, version = check_for_updates(SITE_URL, PLUGIN_PATH) print(plugin_name, version) Using regular expression would probably make the code shorter. As I said, I just threw this together to illustrate how things could be done in a way that works on both python 2.7 and python 3.4. After I get more time I will clean this up and add a specific current version info to the first post on the ePub3-itizer MR site to make this even simpler. KevinH Last edited by KevinH; 12-16-2015 at 01:46 PM. |
![]() |
![]() |
![]() |
#9 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,485
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi,
FWIW, we could probably use the sigil_bs4 soup interface and find command to make this even easier. KevinH |
![]() |
![]() |
![]() |
#10 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,174
Karma: 144286760
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I think it would be better if Sigil did this instead of relying on the plugin makers to do it. We've seen some plugins for Calibre be killed off because they didn't get updated. I see the same thing happening (some not getting updated).
|
![]() |
![]() |
![]() |
#11 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,485
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi JSWolf,
Not a chance. Sigil is not in the plugin development business. The only exception is the flightcrew plugin which was previously part of Sigil. Sigil has no interest in controlling or centralizing plugins for plugin developers. As volunteer developers, we simply do not have the time to keep up or manage a repository for plugins. The key for Sigil is to keep the interface as simple as possible and to allow plugin developers full reign in their own world to do what they want as long as they do not violate the plugin launcher interface. As for plugins dying off, we only have 18 or so plugins, and as far as I know, they all still work. I have been careful to make the plugin launcher interface as backwards compatible as possible while still fixing bugs. In other words, if you want to check for updates you do it for your own plugin with whatever code you want. It is only handful of lines in python to do the above. KevinH |
![]() |
![]() |
![]() |
#12 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,485
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Unless of course ... someone wants to volunteer their time and server space to manage all plugins and keep them up to date! Any takers?
KevinH |
![]() |
![]() |
![]() |
#13 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,174
Karma: 144286760
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Why not use the plugin forum? Just check if there's an update in the given thread?
|
![]() |
![]() |
![]() |
#14 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
All Sigil needs to do is scrape a plugin index and then scrape individual threads for updates.
Or you can store the plugin index in the Sigil repository and scrape the individual threads. Yes, I know calibre hosts the calibre plugin index. That doesn't mean Sigil needs to as well. |
![]() |
![]() |
![]() |
#15 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,485
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Sigil is not going to do that. The plugin can do that just as easily and with much less web traffic since it will only check when your own plugin is run. It is still screen scraping either way.
In fact some smart person could write a screen scraper plugin that updates other plugins installed by the user. As they say in textbooks, "this will be left as an exercise for the reader". Last edited by KevinH; 12-16-2015 at 03:54 PM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Firmware Update Kindle Paperwhite Update Warning | dpbmobi | Amazon Kindle | 41 | 08-06-2015 12:04 AM |
WARNING, Do not update your Kindle application | MikeGolf | Kindle Fire | 6 | 02-23-2012 08:11 AM |
iPhone Warning about Stanza 2.1 Update | kjk | Apple Devices | 2 | 02-02-2010 03:44 AM |
warning about 2.9.5 update install | xyzzy | iRex | 3 | 04-26-2007 08:06 AM |