bzrweb?

Robey Pointer robey at lag.net
Wed Nov 30 23:57:07 GMT 2005


On 30 Nov 2005, at 15:22, Goffredo Baroncelli wrote:

> On Thursday 01 December 2005 00:05, you (Robey Pointer) wrote:
>>
>> I had to change one thing in hgweb.cgi to make it work with the
>> plugin being installed in .bazaar/plugins/ instead of directly  
>> into bzr:
>>
>> 	sys.path.insert(0, "/home/robey/.bazaar/plugins")
>> 	from webserve import hgweb
>>
>> This is probably not the right solution, but no variant of "import
>> bzrlib.plugins.webserve" was working.
>
> I should clarify this better in the readme; but it shall be  
> specified a path which
> includes bzrlib....
>
> My cgi is
> ---- cut ---- cut ---- cut ----
> #!/usr/bin/env python
> #
> # An example CGI script to export multiple hgweb repos, edit as  
> necessary
>
> import cgitb, sys
> cgitb.enable()
>
> # sys.path.insert(0, "/path/to/python/lib") # if not a system-wide  
> install
> sys.path.insert(0, "../bzr.dev") # if not a system-wide install
> from bzrlib.plugins.webserve import hgweb
>
> # The config file looks like this:
> # [paths]
> # virtual/path = /real/path
> # virtual/path = /real/path
>
> h = hgweb.hgwebdir("hgwebdir.config")
> h.run()
> ---- cut ---- cut ---- cut ----
>
> where '../bzr.dev' is the root of the bazaar installation


Right:  That doesn't appear to work, though, if I installed hgweb in  
my ~/.bazaar/plugins folder instead of inside bzr.dev itself.  The  
import fails.

I'm not sure of the right solution.  I would guess there's some way  
to ask bzrlib to load plugins, and then pull the reference out of there?

robey





More information about the bazaar mailing list