def test_01_01_equality(self):
     x = cps.Setting("text", "value")
     self.assertTrue(x == "value")
     self.assertTrue(x != "text")
     self.assertFalse(x != "value")
     self.assertFalse(x == "text")
     self.assertEqual(x.value, "value")
Пример #2
0
    def create_settings(self):
        """Create the module settings and name the module"""
        self.wants_default_output_directory = cps.Binary(
            "Store batch files in default output folder?",
            True,
            doc="""\
Select "*Yes*" to store batch files in the Default Output folder.
Select "*No*" to enter the path to the folder that will be used to
store these files. The Default Output folder can be set by clicking the "View output settings" button in the main CP window, or in CellProfiler Preferences. """
            % globals(),
        )

        self.custom_output_directory = cps.Text(
            "Output folder path",
            cpprefs.get_default_output_directory(),
            doc=
            "Enter the path to the output folder. (Used only if not using the default output folder)",
        )

        # Worded this way not because I am windows-centric but because it's
        # easier than listing every other OS in the universe except for VMS
        self.remote_host_is_windows = cps.Binary(
            "Are the cluster computers running Windows?",
            False,
            doc="""\
Select "*Yes*" if the cluster computers are running one of the
Microsoft Windows operating systems. In this case, **CreateBatchFiles**
will modify all paths to use the Windows file separator (backslash \\\\ ).
Select "*No*" for **CreateBatchFiles** to modify all paths to use the
Unix or Macintosh file separator (slash / ).""" % globals(),
        )

        self.batch_mode = cps.Binary("Hidden: in batch mode", False)
        self.distributed_mode = cps.Binary("Hidden: in distributed mode",
                                           False)
        self.default_image_directory = cps.Setting(
            "Hidden: default input folder at time of save",
            cpprefs.get_default_image_directory(),
        )
        self.revision = cps.Integer("Hidden: revision number", 0)
        self.from_old_matlab = cps.Binary("Hidden: from old matlab", False)
        self.acknowledge_old_matlab = cps.DoSomething(
            "Could not update CP1.0 pipeline to be compatible with CP2.0.  See module notes.",
            "OK",
            self.clear_old_matlab,
        )
        self.mappings = []
        self.add_mapping()
        self.add_mapping_button = cps.DoSomething(
            "",
            "Add another path mapping",
            self.add_mapping,
            doc="""\
Use this option if another path must be mapped because there is a difference
between how the local computer sees a folder location vs. how the cluster
computer sees the folder location.""",
        )
Пример #3
0
    def create_settings(self):
        '''Create the module settings and name the module'''
        self.wants_default_output_directory = cps.Binary(
                "Store batch files in default output folder?", True, doc="""
            Select <i>%(YES)s</i> to store batch files in the Default Output folder. <br>
            Select <i>%(NO)s</i> to enter the path to the folder that will be used to store
            these files.""" % globals())

        self.custom_output_directory = cps.Text(
                "Output folder path",
                cpprefs.get_default_output_directory(), doc="""
            Enter the path to the output folder.""")

        # Worded this way not because I am windows-centric but because it's
        # easier than listing every other OS in the universe except for VMS
        self.remote_host_is_windows = cps.Binary(
                "Are the cluster computers running Windows?",
                False, doc="""
            Select <i>%(YES)s</i> if the cluster computers are running one of the Microsoft
            Windows operating systems. In this case, <b>CreateBatchFiles</b> will
            modify all paths to use the Windows file separator (backslash &#92;). <br>
            Select <i>%(NO)s</i> for <b>CreateBatchFiles</b> to modify all paths to use
            the Unix or Macintosh file separator (slash &#47;).""" % globals())

        self.batch_mode = cps.Binary("Hidden: in batch mode", False)
        self.distributed_mode = cps.Binary("Hidden: in distributed mode", False)
        self.default_image_directory = cps.Setting("Hidden: default input folder at time of save",
                                                   cpprefs.get_default_image_directory())
        self.revision = cps.Integer("Hidden: revision number", 0)
        self.from_old_matlab = cps.Binary("Hidden: from old matlab", False)
        self.acknowledge_old_matlab = cps.DoSomething(
                "Could not update CP1.0 pipeline to be compatible with CP2.0.  See module notes.", "OK",
                self.clear_old_matlab)
        self.mappings = []
        self.add_mapping()
        self.add_mapping_button = cps.DoSomething("",
                                                  "Add another path mapping", self.add_mapping, doc="""
            Use this option if another path must be mapped because there is a difference
            between how the local computer sees a folder location vs. how the cluster
            computer sees the folder location.""")

        self.go_to_website = cps.Binary(
                "Launch BatchProfiler", True,
                doc="""Launch BatchProfiler after creating the batch file. This
            setting will launch a web browser to the BatchProfiler URL to
            allow you to create batch jobs to run the analysis on a cluster.
            """)

        self.check_path_button = cps.DoSomething(
                "Press this button to check pathnames on the remote server",
                "Check paths", self.check_paths, doc="""
            This button will start a routine that will ask the
            webserver to check whether the default input and default output
            folders exist. It will also check whether all remote
            path mappings exist.""")
 def test_00_00_init(self):
     x = cps.Setting("text", "value")
     x.test_valid(None)
     self.assertEqual(x.text, "text")
     self.assertEqual(x.value, "value")
     self.assertTrue(x.key())