Skip to content

Commit

Permalink
working on #1270 and sarrac #169 together.
Browse files Browse the repository at this point in the history
It looks like sarrac #169 was being mostly hidden/corrected by
inexplicable logic here. Once #169 is corrected, the strange
adjustments to the relative path can be removed.
  • Loading branch information
petersilva committed Oct 22, 2024
1 parent 924ad2f commit d4ae32a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions sarracenia/flow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ def updateFieldsAccepted(self, msg, urlstr, pattern, maskDir,
if f in msg['fileOp']:
fopv = msg['fileOp'][f].split('/')
# an absolute path file posted is relative to '/' (in relPath) but the values in
# the link and rename fields may be absolute, requiring and adjustmeent when stripping
# the link and rename fields may be absolute, requiring and adjustment when stripping
if fopv[0] == '':
strip += 1
elif len(fopv) == 1:
Expand Down Expand Up @@ -947,9 +947,6 @@ def updateFieldsAccepted(self, msg, urlstr, pattern, maskDir,
if (f in msg['fileOp']) :
if msg['fileOp'][f].startswith(self.o.baseDir):
msg['fileOp'][f] = msg['fileOp'][f].replace(self.o.baseDir, d, 1)
elif os.sep not in msg['fileOp'][f] and f != 'link':
toclimb=len(token)-1
msg['fileOp'][f] = '../'*(toclimb) + msg['fileOp'][f]

elif 'fileOp' in msg and new_dir:
u = sarracenia.baseUrlParse(msg['baseUrl'])
Expand All @@ -958,9 +955,6 @@ def updateFieldsAccepted(self, msg, urlstr, pattern, maskDir,
if (len(u.path) > 1):
if msg['fileOp'][f].startswith(u.path):
msg['fileOp'][f] = msg['fileOp'][f].replace(u.path, new_dir, 1)
elif '/' not in msg['fileOp'][f] and f!= 'link':
toclimb=len(token)-1
msg['fileOp'][f] = '../'*(toclimb) + msg['fileOp'][f]

if self.o.mirror and len(token) > 1:
new_dir = new_dir + '/' + '/'.join(token[:-1])
Expand Down

0 comments on commit d4ae32a

Please sign in to comment.