Beispiel #1
0
 def __init__(self, name="", facility=""):
     self.instrument_name = name
     self.facility_name = facility
     self._observers = []
     self._output_directory = os.path.expanduser('~')
     if HAS_MANTID:
         config = ConfigService.Instance()
         #register startup
         if HAS_MANTID:
             UsageService.registerFeatureUsage(FeatureType.Interface, "Reduction_gui:{0:.5}-{1:.10}".format(facility, name), False)
         try:
             head, _tail = os.path.split(config.getUserFilename())
             if os.path.isdir(head):
                 self._output_directory = head
         except (StopIteration, AttributeError, ImportError, NameError, TypeError, ValueError, Warning):
             Logger("scripter").debug("Could not get user filename")
Beispiel #2
0
 def __init__(self, name="", facility=""):
     self.instrument_name = name
     self.facility_name = facility
     self._observers = []
     self._output_directory = os.path.expanduser('~')
     if HAS_MANTID:
         config = ConfigService.Instance()
         #register startup
         if HAS_MANTID:
             UsageService.registerFeatureUsage("Interface",
                                               "Reduction_gui:{0:.5}-{1:.10}".format(facility, name),False)
         try:
             head, _tail = os.path.split(config.getUserFilename())
             if os.path.isdir(head):
                 self._output_directory = head
         except (StopIteration, AttributeError, ImportError, NameError, TypeError, ValueError, Warning):
             Logger("scripter").debug("Could not get user filename")
Beispiel #3
0
 def test_registerFeatureUsage(self):
     UsageService.setEnabled(False)
     #this will do nothing as it is disabled
     UsageService.registerFeatureUsage(FeatureType.Algorithm, "testv1", True)
     UsageService.setEnabled(True)
     UsageService.registerFeatureUsage(FeatureType.Algorithm, "testv1", True)
     UsageService.registerFeatureUsage(FeatureType.Algorithm, ["testv1","level2feature"], True)
Beispiel #4
0
 def test_registerFeatureUsage(self):
     UsageService.setEnabled(False)
     #this will do nothing as it is disabled
     UsageService.registerFeatureUsage("Algorithm","Test.v1",True)
Beispiel #5
0
 def open_mantid_help(self):
     UsageService.registerFeatureUsage(FeatureType.Feature.Interface,
                                       ["Mantid Help"], False)
     self.interface_manager.showHelpPage('')
Beispiel #6
0
def report_interface_startup(name):
    #interface startup
    UsageService.registerFeatureUsage(FeatureType.Interface, name, False)
Beispiel #7
0
 def test_registerFeatureUsage(self):
     UsageService.setEnabled(False)
     #this will do nothing as it is disabled
     UsageService.registerFeatureUsage("Algorithm","Test.v1",True)