[wxPython-users] update mechanism of some kind ...

Jorgen Bodde jorgen.maillist at gmail.com
Tue Nov 20 02:06:45 PST 2007


Hi Jasper,

> Hi Jorgen,
>
> This sounds like a great idea, I've been thinking about making smth like
> this myself earlier. Never got to it though.
> If you figure out something, or decide to develop smth yourself, please let
> me know.. I'd be interested in getting this working as well, maybe I could
> help with the development.
>
Well I am developing a tool that would benefit greatly from something
like this. For this release I will probably not add the update
mechanism unless I find it too valuable not to do it. I do not want to
divert too much from my current work because this needs to be released
soon.

If you are also thinking about writing something like this, we might
join effort on it. I will tell you basically what the idea was how to
do updates from the web, in kind of a use case way.

On the user side:
--------------

- In your app or an external updater app using this 'library', just
enter an URL (HTTP but if possible even FTP or local directory)
- An XML file is read from that location containing a list of delta
files (ZIP files) per update increment
- Somehow locally the version of the "repository" the user has, needs
to be determined (the simplest way is keeping a version file on disk)
- The updater checks this version inside the downloaded XML file. The
updater should get the dellta file that is next in line to be updated.
So if I have version 4 on my local disk, and the last version is 6,
delta file 5 needs to be downloaded, and after that delta file 6.
- Inside the delta ZIP file(s) an XML file resides, with a list of
states and hashcodes per file that it will update
- Per file, the updater checks the hash code, and if it matches the
"previous hash" inside the delta file, the action is executed. This
action can be 1) updating the original file, 2) deleting the file if
it's removed in this delta state. If the file to be copied does not
yet exist on disk, no hash comparision is done and the file is simply
copied (or in case of deletion, ignored)
- If a hash does not match, an error needs to be generated, or the
offending file needs to be renamed but not deleted, so that local
changes can be preserved.
- At the end, all the delta's are executed and your work copy should
contain the latest version

On the submitter side:
--------------

- The submitter will issue new repository / package updates.
- A small (wx)python tool should help here by simply examining the
current state of the files to be updated against the md5 hash inside a
local XML file containing the hashes per file from the last issued
update.
- If files are new / changed, they are added to a ZIP file, which will
be the new delta file
- If local files are deleted, this is noted in the XML file inside the
delta ZIP file so on the user side, this can be performed as well
- The tool packs everything up inside the ZIP file, ready for
submitting to the web. If the tool is friendly enough this submitting
can be done automatically.

I was intending to make a python only library with a wxPython GUI back
end which should be very thin, so that people can customize this in
their own applications by just calling a few methods for the update to
take place and only providing the user with feedback.

Extra thoughts might be if the user does not have a local copy of the
upgraded data yet, the whole zip file containing the latest 'dump'  of
the files can be downloaded. The 'delta' system provides smaller space
on your server especially with huge releases all the time, smaller
download cycles and for future increments no need to download huge zip
files all the time.

I hope this helps concerning the basic idea I had. When my tool (CVL)
will have it's first release, I willl probably focus on this unless
you or someone else is already working on it, then I will gladly give
input or help developing..

With regards,
- Jorgen




More information about the wxpython-users mailing list