[sword-devel] InstallMgr in python

Ben Morgan benpmorgan at gmail.com
Fri Feb 1 17:59:06 MST 2008


Hi,

The basic way you would use it is (I think):

from Sword import *
class StatusRep(StatusReporter):
 """Report on the status of downloads"""
 def preStatus(self, totalBytes, completedBytes, message):
  print "Before", totalBytes, completedBytes, message

 def updateStatus(self, dtTotal, dtNow):
  print "Update", dtTotal, dtNow

s = StatusRep()

m = InstallMgr("./", s.__disown__())
for item, install_source in m.sources.items():
 print item.c_str()
 # update based on the remote source. This will download a
mods.d.tar.gzinto a subdirectory,
 # and extract some of the .conf's into a mods.d folder in the subdirectory
 m.refreshRemoteSource(install_source)
 swmgr = install_source.getMgr()
 print "Modules", [name.c_str() for name in swmgr.getModules()]

Use m.ftpCopy to download the files, m.installModule to install a module,
and m.getModuleStatus to compare modules in two managers. Your best point
for working out what you can do is probably the header files and possibly
looking at other SWORD programs to see how they use it.

The dates refers to the fact that two of the .confs it extracts have
modified dates in the year 30044 in the mods.d directory. This is clearly
not as it should be, and will cause the Microsoft Visual C runtime to crash.
If I open up the mods.d.tar.gz in 7zip, these two are the first two (though
they have correct dates). I'm not sure how it orders, though.


-- 
God Bless,
Ben
-------------------------------------------------------------------------------------------
The Lord is not slow to fulfill his promise as some count slowness,
but is patient toward you, not wishing that any should perish,
but that all should reach repentance.
2 Peter 3:9 (ESV)


On 2/2/08, Pierre Amadio <pierre.amadio at laposte.net> wrote:
>
> Hi there.
>
> On Thu, Jan 31, 2008 at 11:46:34PM +1100, Ben Morgan wrote:
> > Hi,
> >
> > It still seems to have those same two files not working, even when I use
> the
> > SVN version. Anyone got any ideas why these dates would come up?
> >
>
> A quick not to let you know the python module compiles and shows a
> InstallMgr class after applying your changes on a a svn sword tree in a
> debian etch machine.
>
> I have no idea how to use it though :)
>
> What dates were you refering at ?
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.crosswire.org/pipermail/sword-devel/attachments/20080202/8af37ec6/attachment.html 


More information about the sword-devel mailing list