Thanks to you ;)

I made a quick patch but I don't know how to post on github.
Here it's what I've done (in catalog.py) :

  def __init__(self, url, username="admin", password="geoserver"):
    self.service_url = url
    if(self.service_url.endswith("/")):
        self.service_url = self.service_url.strip("/")
    self.http = httplib2.Http()
    self.username = username
    self.password = password
    self.http.add_credentials(self.username, self.password)
    self._cache = dict()

Best regards and thank you again for your help

Arnaud

On Tue, Aug 24, 2010 at 10:00 PM, David Winslow <[email protected]> wrote:
> Ah, nice catch.  I updated the wiki.  (I also added a ticket for this; it
> would be reasonably easy to fix this in gsconfig.py if you are interested in
> providing a patch. http://github.com/dwins/gsconfig.py/issues/#issue/3 )
> Glad you were able to get things working.
> --
> David Winslow
> OpenGeo - http://opengeo.org/
> On Tue, Aug 24, 2010 at 3:48 PM, Arnaud Vandecasteele <[email protected]>
> wrote:
>>
>> It works for me as well, thanks to your explications !
>> My mistake was to add a slash after the rest >  "/geoserver/rest/"
>>
>> But in the wiki [1] it was writing with a slash at the end of the URL.
>>
>> Thanks for your help.
>>
>> Arnaud
>>
>> [1]>>> cat = Catalog("http://localhost:8080/geoserver/rest/";, "admin",
>> "geoserver")
>>
>>
>> On Tue, Aug 24, 2010 at 12:16 AM, David Winslow <[email protected]>
>> wrote:
>> > Well, it works for me :)  One problem that I run into a lot is adding a
>> > trailing slash to the URL.  When you construct your Catalog, make sure
>> > that
>> > you spell out the "/geoserver/rest" path exactly so (well, if you have
>> > changed the servlet context, you should adjust accordingly.)
>> > However, this sort of problem usually results in something other than
>> > XML
>> > coming back from the server and produces a python stack trace, so it may
>> > just be a bug.
>> > If you can provide a Python script (and data directory if necessary)
>> > that
>> > demonstrate the problem, I will be glad to take a look.
>> > --
>> > David Winslow
>> > OpenGeo - http://opengeo.org/
>> > On Mon, Aug 23, 2010 at 5:09 PM, Arnaud Vandecasteele
>> > <[email protected]>
>> > wrote:
>> >>
>> >> Hi all,
>> >>
>> >> I have installed gsconfig.py to see how I can use it with geoserver
>> >> (I'm working with xubuntu (arramagong edition)).
>> >> When I have install (with a virtual environnement) it for the for the
>> >> first time everything was fine. I tried some query like
>> >> cat.get_layers() and the result was good.
>> >> But to make a cleaner installation and because I was writing a
>> >> tutorial about it, I deleted my previous work to understand better
>> >> each steps.
>> >> But since that, and despite I think I made exactly the same thing,
>> >> gsconfig returns me an empty array when I ask for example a
>> >> get_layers() query.
>> >> When I try the URL http://localhost:8082/geoserver/rest/layers in my
>> >> browser I can see the list of layers i got in GeoServer.
>> >> Do you know what I'm doing wrong ?
>> >>
>> >> Thanks for your help
>> >>
>> >> Best regards
>> >>
>> >> Arnaud
>> >>
>> >> [1] http://github.com/dwins/gsconfig.py
>> >>
>> >>
>> >>
>> >> ------------------------------------------------------------------------------
>> >> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
>> >> Be part of this innovative community and reach millions of netbook
>> >> users
>> >> worldwide. Take advantage of special opportunities to increase revenue
>> >> and
>> >> speed time-to-market. Join now, and jumpstart your future.
>> >> http://p.sf.net/sfu/intel-atom-d2d
>> >> _______________________________________________
>> >> Geoserver-users mailing list
>> >> [email protected]
>> >> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>> >
>> >
>>
>>
>>
>> --
>> --------------------------------------------------------------------
>> Van De Casteele Arnaud
>> Mines Paris Tech - CRC
>> Sophia-Antipolis
>> 0698 24 25 29
>> SIG - WebMapping - SOLAP - BI - GeoCollaboration
>>
>> Web Site
>> http://geotribu.net/
>> http://www.sismaris.org/
>
>



-- 
--------------------------------------------------------------------
Van De Casteele Arnaud
Mines Paris Tech - CRC
Sophia-Antipolis
0698 24 25 29
SIG - WebMapping - SOLAP - BI - GeoCollaboration

Web Site
http://geotribu.net/
http://www.sismaris.org/

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to