Beispiel #1
0
    def to_xml(self, file_name=None):
        """
            Write all reduction parameters to XML
            @param file_name: name of the file to write the parameters to
        """
        xml_str = "<Reduction>\n"
        xml_str += "  <instrument_name>%s</instrument_name>\n" % self.instrument_name
        xml_str += "  <timestamp>%s</timestamp>\n" % time.ctime()
        xml_str += "  <python_version>%s</python_version>\n" % sys.version
        xml_str += "  <platform>%s</platform>\n" % platform.system()
        xml_str += "  <architecture>%s</architecture>\n" % str(platform.architecture())
        if HAS_MANTID:
            xml_str += "  <mantid_version>%s</mantid_version>\n" % version_str()

        for item in self._observers:
            if item.state() is not None:
                xml_str += item.state().to_xml()

        xml_str += "</Reduction>\n"

        if file_name is not None:
            f = open(file_name, 'w')
            f.write(xml_str)
            f.close()

        return xml_str
Beispiel #2
0
    def to_xml(self, file_name=None):
        """
            Write all reduction parameters to XML
            @param file_name: name of the file to write the parameters to
        """
        xml_str = "<Reduction>\n"
        xml_str += "  <instrument_name>%s</instrument_name>\n" % self.instrument_name
        xml_str += "  <timestamp>%s</timestamp>\n" % time.ctime()
        xml_str += "  <python_version>%s</python_version>\n" % sys.version
        xml_str += "  <platform>%s</platform>\n" % platform.system()
        xml_str += "  <architecture>%s</architecture>\n" % str(
            platform.architecture())
        if HAS_MANTID:
            xml_str += "  <mantid_version>%s</mantid_version>\n" % version_str(
            )

        for item in self._observers:
            if item.state() is not None:
                xml_str += item.state().to_xml()

        xml_str += "</Reduction>\n"

        if file_name is not None:
            f = open(file_name, 'w')
            f.write(xml_str)
            f.close()

        return xml_str
Beispiel #3
0
    def __init__(self, parent, view=None, usage_reporting_verification_view = None):
        self.view = view if view else AboutView(parent, self, version_str(), release_date().strip())
        self.usage_reporting_verification_view = usage_reporting_verification_view \
            if usage_reporting_verification_view  else UsageReportingVerificationView(parent, self)
        self.parent = parent
        self.view.clbReleaseNotes.clicked.connect(self.action_open_release_notes)
        self.view.clbSampleDatasets.clicked.connect(self.action_open_download_website)
        self.view.clbMantidIntroduction.clicked.connect(self.action_open_mantid_introduction)
        self.view.clbPythonIntroduction.clicked.connect(self.action_open_python_introduction)
        self.view.clbPythonInMantid.clicked.connect(self.action_open_python_in_mantid)
        self.view.clbExtendingMantid.clicked.connect(self.action_open_extending_mantid)
        self.view.lblPrivacyPolicy.linkActivated.connect(self.action_open_external_link)
        self.view.pbMUD.clicked.connect(self.action_manage_user_directories)
        self.view.pbClose.clicked.connect(self.action_close)
        self.setup_facilities_group()

        # set chkAllowUsageData
        isUsageReportEnabled = ConfigService.getString(self.USAGE_REPORTING, True)
        if isUsageReportEnabled == "0":
            self.view.chkAllowUsageData.setChecked(False)
        self.view.chkAllowUsageData.stateChanged.connect(self.action_usage_data_changed)

        # set do not show
        qSettings = QSettings()
        qSettings.beginGroup(self.DO_NOT_SHOW_GROUP)
        doNotShowUntilNextRelease = int(qSettings.value(self.DO_NOT_SHOW, "0"))
        qSettings.endGroup()
        self.view.chkDoNotShowUntilNextRelease.setChecked(doNotShowUntilNextRelease)
        self.view.chkDoNotShowUntilNextRelease.stateChanged.connect(self.action_do_not_show_until_next_release)
Beispiel #4
0
###############################################################################
import mantid.kernel as kernel
import mantid.geometry as geometry
import mantid.api as api
import mantid.dataobjects as dataobjects

###############################################################################
# Make the aliases from each module accessible in a the mantid namspace
###############################################################################
from mantid.kernel._aliases import *
from mantid.api._aliases import *

###############################################################################
# Make the version string accessible in the standard way
###############################################################################
__version__ = kernel.version_str()

###############################################################################
# Load the Python plugins now everything has started.
#
# Before the plugins are loaded the simpleapi module is called to create
# fake error-raising functions for all of the plugins. After the plugins have been
# loaded the correction translation is applied to create the "real" simple
# API functions.
#
# Although this seems odd it is necessary so that any PythonAlgorithm
# can call any other PythonAlgorithm through the simple API mechanism. If left
# to the simple import mechanism then plugins that are loaded later cannot
# be seen by the earlier ones (chicken & the egg essentially).
################################################################################
from . import simpleapi as _simpleapi