File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
src/murfey/client/contexts Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 44"""
55
66import logging
7- from datetime import datetime
87from pathlib import Path
98from typing import Dict , Generator , List , Optional
109from urllib .parse import quote
@@ -31,13 +30,16 @@ def _file_transferred_to(
3130 instrument_name = environment .instrument_name ,
3231 demo = environment .demo ,
3332 )
34- # rsync basepath and modules are set in the microscope's configuration YAML file
35- return (
36- Path (machine_config .get ("rsync_basepath" , "" ))
37- / str (datetime .now ().year )
38- / source .name
39- / file_path .relative_to (source )
33+
34+ # Construct destination path
35+ base_destination = Path (machine_config .get ("rsync_basepath" , "" )) / Path (
36+ environment .default_destinations [source ]
4037 )
38+ # Add the visit number to the path if it's not present in 'source'
39+ if environment .visit not in environment .default_destinations [source ]:
40+ base_destination = base_destination / environment .visit
41+ destination = base_destination / file_path .relative_to (source )
42+ return destination
4143
4244
4345def _get_source (
You can’t perform that action at this time.
0 commit comments