Page 1 of 2
Check Versions of Plugins
Posted: 16 May 2012 12:55
by Jane
I have just built a new plugin to check the versions of installed plugins against those in the plugin store.
Check Installed Plugins Against the Store
I did have a progress bar in but it seemed to cause problems, so you if have a large number of plugins it could take a minute or so to run, but please let it run through.
Is it one which I should add to the store?
ID:6244
Check Versions of Plugins
Posted: 16 May 2012 13:17
by BillH
Jane,
I know this is one that I would use to make it easier to keep up to date with the latest versions.
Bill
Check Versions of Plugins
Posted: 16 May 2012 15:59
by RogerF
Very useful, Jane. Thanks.
Check Versions of Plugins
Posted: 16 May 2012 16:21
by johnmorrisoniom
Definitely a must have plugin.
I found and updated 3 of my plugins.
Check Versions of Plugins
Posted: 16 May 2012 18:53
by Jane
Check Versions of Plugins
Posted: 17 May 2012 11:10
by tatewise
Jane, I have added a Progress Bar to the Plugin that seems to work OK.
The revised code near the beginning is:
Code: Select all
require('luacom')
require('lfs')
ProgressBar = {
Start = function(strTitle,intMax)
-- Create & start Progress Bar window
if not DlgGauge then
IsBarStop = false
IntStart = os.time()
IntDelta = 0
StrClock = '00:00:00'
local btnStop = iup.button { title='Stop '..strTitle, font=StrFontBody, rastersize='200x30', fgcolor=StrRed, action=function() IsBarStop = true end, }
-- Signal Stop button pressed return iup.CLOSE -- Often caused main GUI to close !!!
BarGauge = iup.progressbar { rastersize='400x30', value=0, max=intMax, } -- Progress bar maximum range
LblText = iup.label { title=' ', expand='YES', alignment='ACENTER', tip='Percentage and Time Elapsed', }
DlgGauge = iup.dialog { title=strTitle..' Progress', dialogframe='YES', background=StrWhite, -- Remove Windows minimize/maximize menu
iup.vbox{ alignment='ACENTER', gap='10', margin=StrBigMargin,
LblText,
BarGauge,
btnStop,
},
move_cb = function(self,x,y) IntDataX=x IntDataY=y end,
close_cb = btnStop.action, -- Windows Close button = Stop button
}
DlgGauge:showxy(IntDataX,IntDataY) -- Show the Progress Bar window
end
end,
SetText = function(strText) -- Show the Progress text message
if DlgGauge then LblText.title = strText end
end,
Step = function(intStep) -- Step the Progress Bar forward
if DlgGauge then
local intVal = tonumber(BarGauge.value)
local intMax = tonumber(BarGauge.max)
intVal = intVal + intStep
if intVal > intMax then intVal = intMax end -- Ensure value does not exceed maximum
BarGauge.value = intVal
local intDelta = os.difftime(os.time(),IntStart)
if IntDelta < intDelta then -- Update clock of elapsed time
IntDelta = intDelta
local intHour = math.floor( intDelta / 3600 )
local intMins = math.floor( intDelta / 60 - intHour * 60 )
local intSecs = intDelta - intMins * 60 - intHour * 3600
StrClock = string.format('%02d : %02d : %02d',intHour,intMins,intSecs)
end
LblText.title = string.format('%4d %% %s ', math.floor( intVal / intMax * 100 ), StrClock) -- Display % and clock progress
DlgGauge.bringfront = 'YES'
iup.LoopStep()
end
end,
Reset = function() -- Reset the Progress Bar
if DlgGauge then BarGauge.value = 0 end
end,
Stop = function() -- Check if Stop button pressed
return IsBarStop
end,
Close = function() -- Close the Progress Bar window
IsBarStop = false
if DlgGauge then DlgGauge:destroy() DlgGauge = nil end
end,
} -- end ProgressBar
function main()
local tblPlugin = {}
local tblCurVer = {}
local tblStoreVer = {}
local tblUpgrade = {}
pluginDir = fhGetContextInfo('CI_APP_DATA_FOLDER')..'\plugins'
local intFile = 0
for filename,attr in dirtree(pluginDir) do
local _,name,ext = splitfilename(filename)
if ext == 'fh_lua' then
intFile = intFile + 1
end
end
ProgressBar.Start('Check Installed Plugins',intFile)
for filename,attr in dirtree(pluginDir) do
_,name,ext = splitfilename(filename)
if ext == 'fh_lua' then
ProgressBar.Step(1)
and near the end of loop:
Code: Select all
end
if ProgressBar.Stop() then break end
end
ProgressBar.Close()
-- Output Result Set
Check Versions of Plugins
Posted: 17 May 2012 11:38
by Jane
It worked OK, for me, but I found when prompted for updates with the progress bar running you could get it confused if you clicked on cancel button with the prompt up, so I need to close and re-open the progress bar at the point it prompts for updates. So I thought it might be best to see if the lack of progress bar caused any problems for people.
Check Versions of Plugins
Posted: 17 May 2012 12:38
by tatewise
I cannot make it fail whatever buttons I click in either dialogue.
Usually the Progress Bar is hidden by the Upgrade dialogue.
But even if the Progress Bar is brought in focus and the Stop/Cancel button clicked all is OK.
Although, the progress is not actually halted until the Upgrade dialogue is answered.
Check Versions of Plugins
Posted: 17 May 2012 15:33
by Jane
Thanks Mike, I have updated the plugin and it seems fine.
Can you try it off the dropbox link (first post) and see if it works OK for you.
Check Versions of Plugins
Posted: 17 May 2012 17:05
by tatewise
Seems OK.
Might benefit from including even the Plugins that are up-to-date in the Result Set and the summary Report at the end.
Check Versions of Plugins
Posted: 17 May 2012 17:28
by Jane
I have added a count of plugins checked and the number updated, already, what else would you want in the summary?
Check Versions of Plugins
Posted: 17 May 2012 17:48
by tatewise
For me, there are 75 Plugins Checked and X Updated reported in the summary window, but only 46 listed in the Result Set.
I would like ALL 75 Plugins listed in the Result Set.
Perhaps the Upgraded column could be renamed Status and show Updated (not Upgraded) and Latest as appropriate.
The final summary window would also say how many Plugins are Latest.
(Up-to-Date is an alternative status to Latest if you prefer.)
Some of my local Plugin scripts do not contain @Version: and are completely ignored.
Perhaps these could be listed too, but with a status such as No Version.
Check Versions of Plugins
Posted: 18 May 2012 08:50
by Jane
I have done a few more tweaks on the dropbox version.
Check Versions of Plugins
Posted: 18 May 2012 09:21
by johnmorrisoniom
Just tried your latest dropbox version Jane.
Worked very well.
Report found 7 plugins in the store that I have installed that have no Version number.
'Add GRO Source.fh_lua'
'Christening-Baptism Conversion.fh_lua'
'Find Date Phrases.fh_lua'
'List All Citations for a Source.fh_lua'
'Possible Problem Report.fh_lua'
'Possible Problem Set Ignore Markers.fh_lua'
'Search All Possible Names.fh_lua'
Check Versions of Plugins
Posted: 18 May 2012 10:12
by Jane
I added those to the store in the very early days of the store so I need to update them to to have versions code in the store.
I have added a bforcecheck flag so it will check every plugin even those with out a version, please try the dropbox routine again, I think I have updated the version ID's for the plugins with out them in the store (they won't show as updated in store as all I have done is add the version in to the source where it was missing).
Check Versions of Plugins
Posted: 18 May 2012 10:28
by tatewise
Yes, that tweaked version is comprehensive.
As John says, it highlights that several published Plugins have no @Version: header line.
To add to John's 7, I have these 3:
'Create and Update Ancestor and Decendant(sic) Counts Wiki.fh_lua' [EDIT still no version]
'Map Geo Code Maintenance.fh_lua' [EDIT - now OK]
'UDF List.fh_lua' [EDIT - now OK]
[EDIT - 'Add GRO Source.fh_lua' says Version 1.0 in header but 1.1 in Store]
These are reported as needing upgrade to newer version every time the Plugin is run, but despite upgrading, the lack of @Version: causes the the upgrade request to repeat.
Check Versions of Plugins
Posted: 18 May 2012 11:09
by Jane
Mike, I have fixed the name on the Ancestor Count plugin so the Checker won't find it, but it has been updated and a new version uploaded.
Can you run again to see if you have any more issues.
Check Versions of Plugins
Posted: 18 May 2012 13:44
by tatewise
Just one issue with this latest Plugin Store Download:
'Possible Problem Set Ignore Markers.fh_lua' Current @Version: 1.1 @LastUpdated: July 2011
BUT is different Version and Name to Plugin Store Details:
'Possible Problem Report Marker' Version 1.0 Updated 11 August 2011
Check Versions of Plugins
Posted: 18 May 2012 16:21
by Jane
I think that one is done now.
Check Versions of Plugins
Posted: 18 May 2012 16:47
by johnmorrisoniom
Just run latest version and got unexpected results and an error message
I got this error on first two runs of plugin, Third time plugin completed OK.
List follows
'A. Newer Than Store' '1.1' '1.0' 'Check Installed Plugins Against the Store .fh_lua'
'B. Upgraded' '0' '1.0' 'Find Date Phrases.fh_lua'
'B. Upgraded' '1.3' '1.4' 'Search All Possible Names.fh_lua'
'D. Up To Date' '1.1' '1.1' 'Add GRO Source.fh_lua'
'D. Up To Date' '1.2' '1.2' 'Address Reformatting.fh_lua'
'D. Up To Date' '1.0' '1.0' 'Ancestors Canada Census Checker.fh_lua'
'D. Up To Date' '1.2' '1.2' 'Ancestors UK Census Checker.fh_lua'
'D. Up To Date' '3.1' '3.1' 'Ancestral Sources Data Entry.fh_lua'
'D. Up To Date' '1.5' '1.5' 'Backup and Restore Family Historian Settings.fh_lua'
'D. Up To Date' '1.3' '1.3' 'Backup Family Historian Settings.fh_lua'
'D. Up To Date' '2.2' '2.2' 'Change Any Fact Tag.fh_lua'
'D. Up To Date' '1.5' '1.5' 'List All Citations for a Source.fh_lua'
'D. Up To Date' '3.1' '3.1' 'Map Life Facts.fh_lua'
'D. Up To Date' '1.0' '1.0' 'Possible Problem Report.fh_lua'
'D. Up To Date' '1.1' '1.1' 'Possible Problem Set Ignore Markers.fh_lua'
'D. Up To Date' '1.4' '1.4' 'Search and Replace.fh_lua'
'E. Not In Store' '0' ' ' 'Christening-Baptism Conversion.fh_lua'
'E. Not In Store' '2.1' ' ' 'Separate BMD Sources V2.fh_lua'
The Christening-Baptism plugin is now reported as not in store
Check Versions of Plugins
Posted: 18 May 2012 17:14
by BillH
Jane,
I ran the plugin and clicked on OK to upgrade the following plugins.
'B. Upgraded' '0' '1.0' 'Clean Living People.fh_lua'
'B. Upgraded' '0' '1.0' 'Family Anniversaries.fh_lua'
'B. Upgraded' '0' '1.0' 'Find Date Phrases.fh_lua'
'B. Upgraded' '1.3' '1.4' 'Search All Possible Names.fh_lua'
The result sets says that they were upgraded.
But, when I look at Tools > Plugins, they didn't actually get upgraded and when I run Check Installed Plugins Against the Store again, it wants to upgrade them again.
Other plugins did get upgraded successfully.
Bill
Check Versions of Plugins
Posted: 18 May 2012 18:22
by Jane
John, I suspect the error was just that the server was down momentarily (not much I can do for that). I can't see the Christening one in the store.
It was a sample in the Help though and I think early betas included it.
Bill, I have not been able to reproduce the problem, can you try it again for me perhaps using debug to see if there are any errors.
Check Versions of Plugins
Posted: 18 May 2012 18:31
by johnmorrisoniom
Jane,
I am getting the same as Bill on the same two plugins.
I ran the plugin in debug mod and got the following
Status = OK
attachment; filename='Find Date Phrases.fh_lua';
Find Date Phrases.fh_lua
Data Size :1757
Content-Length:1757
Cache-Control: public
Connection: Keep-Alive
Date: Fri, 18 May 2012 17:27:04 GMT
Keep-Alive: timeout=2, max=199
Pragma: public
Content-Length: 1757
Content-Type: application/force-download
Expires: 0
Server: Apache
X-Powered-By: PHP/5.2.17
X-Pingback:
http://www.family-historian.co.uk/xmlrpc.php
Content-Description: File Transfer
Content-Disposition: attachment; filename='Find Date Phrases.fh_lua';
Content-Transfer-Encoding: binary
Status = OK
attachment; filename='Search All Possible Names.fh_lua';
Search All Possible Names.fh_lua
Data Size :6693
Content-Length:6693
Cache-Control: public
Connection: Keep-Alive
Date: Fri, 18 May 2012 17:27:07 GMT
Keep-Alive: timeout=2, max=192
Pragma: public
Content-Length: 6693
Content-Type: application/force-download
Expires: 0
Server: Apache
X-Powered-By: PHP/5.2.17
X-Pingback:
http://www.family-historian.co.uk/xmlrpc.php
Content-Description: File Transfer
Content-Disposition: attachment; filename='Search All Possible Names.fh_lua';
Content-Transfer-Encoding: binary
Plugin has completed
AS you can see from the report.
It says two pligins upgraded, but they haven't been
'A. Newer Than Store' '1.1' '1.0' 'Check Installed Plugins Against the Store .fh_lua'
'B. Upgraded' '0' '1.0' 'Find Date Phrases.fh_lua'
'B. Upgraded' '1.3' '1.4' 'Search All Possible Names.fh_lua'
'D. Up To Date' '1.1' '1.1' 'Add GRO Source.fh_lua'
'D. Up To Date' '1.2' '1.2' 'Address Reformatting.fh_lua'
'D. Up To Date' '1.0' '1.0' 'Ancestors Canada Census Checker.fh_lua'
'D. Up To Date' '1.2' '1.2' 'Ancestors UK Census Checker.fh_lua'
'D. Up To Date' '3.1' '3.1' 'Ancestral Sources Data Entry.fh_lua'
'D. Up To Date' '1.5' '1.5' 'Backup and Restore Family Historian Settings.fh_lua'
'D. Up To Date' '1.3' '1.3' 'Backup Family Historian Settings.fh_lua'
'D. Up To Date' '2.2' '2.2' 'Change Any Fact Tag.fh_lua'
'D. Up To Date' '1.5' '1.5' 'List All Citations for a Source.fh_lua'
'D. Up To Date' '3.1' '3.1' 'Map Life Facts.fh_lua'
'D. Up To Date' '1.0' '1.0' 'Possible Problem Report.fh_lua'
'D. Up To Date' '1.1' '1.1' 'Possible Problem Set Ignore Markers.fh_lua'
'D. Up To Date' '1.4' '1.4' 'Search and Replace.fh_lua'
'E. Not In Store' '0' ' ' 'Christening-Baptism Conversion.fh_lua'
'E. Not In Store' '2.1' ' ' 'Separate BMD Sources V2.fh_lua'
Check Versions of Plugins
Posted: 18 May 2012 18:37
by BillH
Jane,
I get similar results to John. Mine were for the same 4 plugins that I reported earlier. It also upgraded Surname Summary Report which seems to have actually been upgraded.
Bill
Check Versions of Plugins
Posted: 18 May 2012 21:27
by Jane
I think they were caused by data problems in the 'Store', I have re-uploaded mine and they seem to match.
A good double check is the view source on the Store and check the version on that.