From 8f520bfe057c2d1cca5be4debb85661753ad9dba Mon Sep 17 00:00:00 2001 From: Elghinnarisa Date: Fri, 9 Sep 2022 20:58:30 +0200 Subject: [PATCH] long path udpates --- .gitignore | 1 + long_path_test.py | 24 +++--------------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 31b3bfb..8a5e7d9 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ input.txt .gitignore *.mkv long_path_test.py +__pycache__/ \ No newline at end of file diff --git a/long_path_test.py b/long_path_test.py index 016e3b4..0039ccf 100644 --- a/long_path_test.py +++ b/long_path_test.py @@ -26,36 +26,18 @@ print("printing original: ", originalfiles) joined = (' '.join(originalfiles)) print("printing joined: ", joined) +re.sub (' +', ' ', joined) +print("duble spaces removed? :", joined) listed = re.split(r'([A-Z]:.+?)(?=[A-Z]:)', joined) listed = list(filter(None, listed)) print("printing listed: ", listed) -sym_target = "E:/Projects/python/ffmpeg_collection/temp/test/" -sym_location = os.path.split(listed[0]) -print("sym locations: ", sym_location) - -#os.symlink(sym_location[0], sym_target ,target_is_directory=True) -#sym_list = [] -#for each in listed: -# r = tuple(os.path.split(each)) -# name = tuple(r[1]) -# print("printing R", r[1]) -# path_used = tuple(sym_target) -# print(type(name)) -# print(type(path_used)) -# join_before = (''.join(path_used + name )) -# sym_list.append(join_before) -# print("printing symlist: ", sym_list) - - - #get path of script location and remove the tail head_tail = os.path.split(sys.argv[0]) output_path = head_tail[0] -del sys.argv[0] #check if output folder exists, otherwise create it isExist = os.path.exists(output_path+output_folder_name) @@ -90,7 +72,7 @@ audio_track = "".join(" -map 0:a:{}".format(y) for y in x) z = (int(z) for z in input ("Enter subtitle tracks to keep: ").split()) subtitle_track = "".join(" -map 0:s:{}".format(y) for y in z) -for file in sym_list: +for file in listed: basename = os.path.basename(file)