Looks good.  But can you change the comment too.  This is stripping the
server part of the baseurl.

On Mon, 2008-08-04 at 15:13 -0700, Wil Clouser wrote:
> While we're patching up that regex we should add SSL support.  How
> about something like:
> 
> +    baseurl = re.sub('https?://[^/]*', '', self.instance.baseurl)
> 
> Wil
> 
> On Mon, Aug 4, 2008 at 1:23 PM, Daniel Schafer <[EMAIL PROTECTED]> wrote:
> > When working with the baseurl code in pootle.py, I noticed the
> > following command was used to strip the baseurl (on line 231):
> > baseurl = re.sub('http://[^/]', '', self.instance.baseurl)
> >
> > It seems like this command should be
> > baseurl = re.sub('http://[^/]*', '', self.instance.baseurl)
> > as the current regex will only match one character after "http://"; in
> > the baseurl.
> >
> > A proposed patch for this follows:
> >
> > Index: pootle.py
> > ===================================================================
> > --- pootle.py (revision 7983)
> > +++ pootle.py (working copy)
> > @@ -228,7 +228,7 @@
> >      argdict = newargdict
> >
> >      # Strip of the base url
> > -    baseurl = re.sub('http://[^/]', '', self.instance.baseurl)
> > +    baseurl = re.sub('http://[^/]*', '', self.instance.baseurl)
> >      # Split up and remove empty parts
> >      basepathwords = filter(None, baseurl.split('/'))
> >      while pathwords and basepathwords and basepathwords[0] ==
> > pathwords[0]:
> >
> > Thanks,
> > Dan Schafer
> > Intern - Mozilla Corporation
> > [EMAIL PROTECTED]
> >
> > -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> > Build the coolest Linux based applications with Moblin SDK & win great 
> > prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > _______________________________________________
> > Translate-pootle mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/translate-pootle
> >
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Translate-pootle mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/translate-pootle
-- 
Dwayne Bailey
Managing Director                              +27 12 460 1095 (w)
Translate.org.za                               +27 83 443 7114 (c)


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Translate-pootle mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/translate-pootle

Reply via email to