<div dir="ltr">On Tue, Aug 5, 2008 at 10:05 AM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Hi,<br><br>I've created a function to normalize Subversion URLs, however when I return a string, printing the result of the function becomes "None". When I print the value of the string before I return from the function, I see a valid string. What's going on? The function is below:<br>

<br><br><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">def normurl( url_root, url ):</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">    mutableurl = url[len(url_root):]</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">

<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">    </span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">    split1 = mutableurl.split( "..", 1 )    </span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">

<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">    if len(split1) == 1:</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">        print "Returning:", split1[0]</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">

<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">        return split1[0]</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">        </span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">

<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">    split2 = split1[0][:-1].rsplit( "/", 1 )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">    combined = split2[0] + split1[1]</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">

<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">    normurl( url_root, url_root + combined )</span><br></div>
</blockquote></div><br>Bah, never mind. I just figured it out. I needed a 'return' before my recursive normurl() call. Sorry for the wasted post!<br></div>