[sword-devel] Determining the repository a SWModule belongs to

contact at tklein.info contact at tklein.info
Fri Sep 27 12:24:05 MST 2019


Hi,

Using the SWORD API, is there an easy way to determine the  
remote/source repository a module is coming from?

I haven't found anything in the SWModule class or anywhere else.

This would be my approach without any API method:
1) Get the config entry "PrefixPath" using  
SWModule::getConfigEntry("PrefixPath"). This returns something like  
this:
/home/tobi/.sword/installMgr/20151110161300/
2) The last part of the path above is the "id" of the source repository
3) Looking up ~/.sword/installMgr/masterRepoList.conf I can find the  
mapping between the repo id and the actual repository name from a line  
like this one: 20151110161300=FTPSource=eBible.org|ftp.ebible.org|/sword

Would it make sense to provide a method in the SWModule or InstallMgr  
class to easily get this information?
This would be useful meta information when showing an about dialog for  
a module and I also see other use cases.

Best regards,
Tobias




More information about the sword-devel mailing list