Esempio n. 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")
Esempio n. 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")
Esempio n. 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)
Esempio n. 4
0
 def test_registerFeatureUsage(self):
     UsageService.setEnabled(False)
     #this will do nothing as it is disabled
     UsageService.registerFeatureUsage("Algorithm","Test.v1",True)
Esempio n. 5
0
 def open_mantid_help(self):
     UsageService.registerFeatureUsage(FeatureType.Feature.Interface,
                                       ["Mantid Help"], False)
     self.interface_manager.showHelpPage('')
Esempio n. 6
0
def report_interface_startup(name):
    #interface startup
    UsageService.registerFeatureUsage(FeatureType.Interface, name, False)
Esempio n. 7
0
 def test_registerFeatureUsage(self):
     UsageService.setEnabled(False)
     #this will do nothing as it is disabled
     UsageService.registerFeatureUsage("Algorithm","Test.v1",True)