From 20153749307abd8df5a1b57766daf5374b3694ac Mon Sep 17 00:00:00 2001 From: Guillaume Chazarain Date: Sat, 18 Jun 2011 14:50:25 +0200 Subject: [PATCH] - Fix path parsing - Widen the tree at the deep levels to make it more shallow --- gsh/file_transfer.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gsh/file_transfer.py b/gsh/file_transfer.py index e53d58f..0103f5e 100644 --- a/gsh/file_transfer.py +++ b/gsh/file_transfer.py @@ -61,9 +61,9 @@ def base64version(): return encoded def tarCreate(path): - path = path.rstrip('/') or '/' if path else '.' - dirname = pipes.quote(os.path.dirname(path)) or '.' - basename = pipes.quote(os.path.basename(path)) or '/' + path = path.rstrip('/') or ('/' if path else '.') + dirname = pipes.quote(os.path.dirname(path) or '.') + basename = pipes.quote(os.path.basename(path) or '/') return 'tar c -C %s %s' % (dirname, basename) BASE64_PITY_PY = base64version() @@ -80,7 +80,7 @@ CMD_REPLICATE_EMIT = '%s | ' + CMD_PREFIX + ' %s replicate %s\n' CMD_FORWARD = CMD_PREFIX + ' %s forward %s %s %s\n' def tree_max_children(depth): - return 2 + return 2 + depth/2 class file_transfer_tree_node(object): def __init__(self, @@ -105,6 +105,8 @@ class file_transfer_tree_node(object): depth += 1 for i in xrange(num_children): begin = i * child_length + if begin >= len(children_dispatchers): + break child_dispatcher = children_dispatchers[begin] end = begin + child_length begin += 1 -- 2.11.4.GIT