# HG changeset patch # User jhammel # Date 1351264266 0 # Node ID 6ffbad8cc31f108ec155f4cd05556b1939a80f92 # Parent 427a94428f04f38ceb264ca7e3a7cd29a8f7d0c7 deal with paths diff -r 427a94428f04 -r 6ffbad8cc31f dogdish/dispatcher.py --- a/dogdish/dispatcher.py Fri Oct 26 15:04:47 2012 +0000 +++ b/dogdish/dispatcher.py Fri Oct 26 15:11:06 2012 +0000 @@ -112,7 +112,7 @@ body = """ - + """ @@ -145,6 +145,7 @@ variables = dict(update=current_update.filename, size=current_update.size, hash=current_update.hash(), + path=self.app.path, query=query) return Response(content_type='text/xml', @@ -155,7 +156,8 @@ ### class level variables - defaults = {'directory': here, + defaults = {'directory': here, + 'path': None, 'update_class': Update} def __init__(self, **kw): @@ -165,6 +167,10 @@ setattr(self, key, kw.get(key, self.defaults[key])) self.handlers = [ Get ] + # path + if not self.path: + self.path = os.path.split(self.directory.strip(os.path.sep)) + # cache self.updates = {} self.current_update = None