logger.error(f"{olddir} exists but it not a directory. Cannot continue with moving session directories. Please handle it yourself.")
errorString=QtCore.QCoreApplication.translate("movesessionroot","{} exists but it not a directory. Cannot continue with moving session directories. Please handle it yourself.".format(olddir))
text=QtCore.QCoreApplication.translate("movesessionroot","Detected both the new NSM 1.6.0 official session directory:\n{}\nAND the old one:\n{}\n\nDo you want Agordejo to move your old files and try to merge them with the new sessions? (Recommended)\n\nYou now have the chance to manually make a backup of your files before pressing 'Yes'".format(newdir,olddir))
text=QtCore.QCoreApplication.translate("movesessionroot","With NSM version 1.6.0 the official session directory moved to:\n{}\nYou are still using the old one:\n{}\n\nDo you want Agordejo to move your files? (Recommended)\n\nYou now have the chance to manually make a backup of your files before pressing 'Yes'".format(newdir,olddir))
logger.error(f"{newdir} exists but it not a directory. Cannot continue with moving session directories. Please handle it yourself.")
t=QtCore.QCoreApplication.translate("movesessionroot","{} exists but it not a directory.\nCannot continue moving session directories. Please handle it yourself.".format(newdir))
logger.info(f"Moving and renaming {olddir} to {unique_newdir} as new session root")
shutil_move(olddir,unique_newdir)#this moves and renames the old ~/NSM Sessions. It will disappear from the home dir.
else:#no. we can just move. But we need to move the contents, not the olddir itself into the newdir
foroldsessioninoldlist:
shutil_move(pathlib.Path(olddir,oldsession),newdir)#this moves and renames the old ~/NSM Sessions. It will disappear from the home dir.
else:#the new directory does not exist yet. We can move it.
logger.info(f"Moving and renaming {olddir} to {newdir} as new session root")
shutil_move(olddir,newdir)#this moves and renames the old ~/NSM Sessions. It will disappear from the home dir.
#If for some reason the old dir is empty and still exists, do this:
ifolddir.exists():
try:
rmdir(olddir)#will raise OSError if not empty.
exceptOSError:
logger.error(f"We tried to move and merge {olddir} to {newdir} but afterwards the source directory was not empty. There is nothing we can do here. Please handle it yourself. Please look out for incomplete data.")
t=QtCore.QCoreApplication.translate("movesessionroot","We tried to move and merge {} to {} but afterwards the source directory was not empty. There is nothing we can do here. Please handle it yourself. Please look out for incomplete data.".format(olddir,newdir))