pngtile/application.py
changeset 152 7bd8d6062c9e
parent 146 0f2a918eb90a
child 164 e1e0c8099c8b
--- a/pngtile/application.py	Mon Sep 15 01:48:29 2014 +0300
+++ b/pngtile/application.py	Fri Oct 03 21:07:59 2014 +0300
@@ -1,10 +1,19 @@
 from werkzeug import Request, Response, exceptions
 from werkzeug.utils import html
+import werkzeug.urls
 
 import pypngtile
 
 import os.path
 
+def url (server, *path, **args):
+    """
+        >>> url('http://foo/', 'bar, 'quux.png', x=5, y=2)
+        'http://foo/bar/quux.png?x=5&y=2'
+    """
+
+    return werkzeug.urls.Href(server)(*path, **args)
+
 class BaseApplication (object):
     IMAGE_TYPES = (
         'png',