我正在尝试使用 FunkyPenguin 的RadarrSync脚本,但是我在尝试将其注销时遇到了一些字符串替换问题,因此我可以看到发生了什么:
path = movie['path']
path_fr = ConfigSectionMap(server)['path_from']
path_to = ConfigSectionMap(server)['path_to']
logging.debug('path {0}'.format(path))
logging.debug('pathto {0}'.format(path_to))
logging.debug('pathfrom {0}'.format(path_fr))
path2 = path.replace(path-fr, path_to)
logging.debug('path2 {0}'.format(path2))
给了我这个结果:
2020-04-30 16:19:35,409 [MainThread ] [DEBUG] path /mnt/unionfs/Plex/Film/Film/The Big Lebowski (1998)
2020-04-30 16:19:35,409 [MainThread ] [DEBUG] pathto '/mnt/unionfs/4K/'
2020-04-30 16:19:35,409 [MainThread ] [DEBUG] pathfrom '/mnt/unionfs/Plex/Film/Film/'
2020-04-30 16:19:35,409 [MainThread ] [DEBUG] path2 /mnt/unionfs/Plex/Film/Film/The Big Lebowski (1998)
我不明白为什么 path2 变量仍然显示路径。
料青山看我应如是
相关分类