6464ReactiveType = TypeVar ("ReactiveType" )
6565
6666token = read_config ()["Murfey" ].get ("token" , "" )
67+ instrument_name = read_config ()["Murfey" ].get ("instrument_name" , "" )
6768
6869requests .get = partial (requests .get , headers = {"Authorization" : f"Bearer { token } " })
6970requests .post = partial (requests .post , headers = {"Authorization" : f"Bearer { token } " })
@@ -264,8 +265,9 @@ def __init__(
264265 self ._context = SPAModularContext
265266
266267 def compose (self ):
268+
267269 machine_data = requests .get (
268- f"{ self .app ._environment .url .geturl ()} /machine"
270+ f"{ self .app ._environment .url .geturl ()} /instruments/ { instrument_name } / machine"
269271 ).json ()
270272 self ._dir_tree = _DirectoryTree (
271273 str (self ._selected_dir ),
@@ -699,7 +701,7 @@ def on_button_pressed(self, event: Button.Pressed):
699701 )
700702 log .info (f"Posted visit registration: { response .status_code } " )
701703 machine_data = requests .get (
702- f"{ self .app ._environment .url .geturl ()} /machine"
704+ f"{ self .app ._environment .url .geturl ()} /instruments/ { instrument_name } / machine"
703705 ).json ()
704706
705707 if self ._switch_status :
@@ -766,12 +768,16 @@ def on_button_pressed(self, event: Button.Pressed):
766768 )
767769 log .info (f"Posted visit registration: { response .status_code } " )
768770 machine_data = requests .get (
769- f"{ self .app ._environment .url .geturl ()} /machine"
771+ f"{ self .app ._environment .url .geturl ()} /instruments/ { instrument_name } / machine"
770772 ).json ()
771773
772774 self .app .install_screen (
773775 DirectorySelection (
774- [p for p in machine_data .get ("data_directories" , []) if p .exists ()]
776+ [
777+ p
778+ for p in machine_data .get ("data_directories" , [])
779+ if Path (p ).exists ()
780+ ]
775781 ),
776782 "directory-select" ,
777783 )
@@ -787,11 +793,7 @@ def on_button_pressed(self, event: Button.Pressed):
787793 )
788794 self .app .push_screen ("gain-ref-select" )
789795 else :
790- if self ._switch_status :
791- self .app .push_screen ("directory-select" )
792- else :
793- self .app .install_screen (LaunchScreen (basepath = Path ("./" )), "launcher" )
794- self .app .push_screen ("launcher" )
796+ self .app .push_screen ("directory-select" )
795797
796798 if machine_data .get ("upstream_data_directories" ):
797799 upstream_downloads = requests .get (
@@ -817,7 +819,7 @@ def compose(self):
817819
818820 def on_button_pressed (self , event : Button .Pressed ):
819821 machine_data = requests .get (
820- f"{ self .app ._environment .url .geturl ()} /machine"
822+ f"{ self .app ._environment .url .geturl ()} /instruments/ { instrument_name } / machine"
821823 ).json ()
822824 if machine_data .get ("upstream_data_download_directory" ):
823825 # Create the directory locally to save files to
0 commit comments