Skip to content

Commit a7dd06c

Browse files
Merge pull request #12 from ISISComputingGroup/fixes_pyright_system_tests
Get instrument full name
2 parents 00312af + 4ce1235 commit a7dd06c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/genie_python/genie_advanced.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,19 @@ def get_instrument() -> str | None:
328328
return __api.get_instrument()
329329

330330

331+
@usercommand
332+
@helparglist("")
333+
@log_command_and_handle_exception
334+
def get_instrument_full_name() -> str | None:
335+
"""
336+
Gets the full name of the local instrument
337+
338+
Returns:
339+
the full name of the machine
340+
"""
341+
return __api.get_instrument_full_name()
342+
343+
331344
@usercommand
332345
@helparglist("verbose")
333346
@log_command_and_handle_exception

src/genie_python/genie_simulate_impl.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import inspect
44
import os
5+
import socket
56
import xml.etree.ElementTree as ET
67
from builtins import object, str
78
from collections import OrderedDict
@@ -1263,3 +1264,6 @@ def get_alarm_from_block(self, block: str) -> str:
12631264

12641265
def get_block_units(self, block: str) -> str:
12651266
return "mm"
1267+
1268+
def get_instrument_full_name(self) -> str:
1269+
return socket.gethostname()

0 commit comments

Comments
 (0)