Example #1
0
 def test_str(self):
     from concert.session.utils import get_default_table
     table = get_default_table(["Parameter", "Value"])
     table.border = False
     table.add_row(["readonly", "1"])
     table.add_row(["writeonly", "N/A"])
     self.assertEqual(str(self.device), table.get_string())
Example #2
0
    def test_str(self):
        table = get_default_table(["Parameter", "Value"])
        table.border = False
        table.add_row(["readonly", "1"])
        table.add_row(["state", Device.NA])

        self.assertEqual(str(self.device), table.get_string())
Example #3
0
 def info_table(self):
     from concert.session.utils import get_default_table
     locked = "yes" if self.locked else "no"
     table = get_default_table(["attribute", "value"])
     table.header = False
     table.border = False
     table.add_row(["info", self._parameter.help])
     table.add_row(["locked", locked])
     return table
Example #4
0
 def info_table(self):
     from concert.session.utils import get_default_table
     locked = "yes" if self.locked else "no"
     table = get_default_table(["attribute", "value"])
     table.header = False
     table.border = False
     table.add_row(["info", self._parameter.help])
     table.add_row(["locked", locked])
     return table
Example #5
0
    def __str__(self):
        from concert.session.utils import get_default_table

        table = get_default_table(["Parameter", "Value"])
        table.border = False

        for param in self:
            table.add_row([param.name, str(param.get().result())])

        return table.get_string(sortby="Parameter")
Example #6
0
    def __str__(self):
        from concert.session.utils import get_default_table

        table = get_default_table(["Parameter", "Value"])
        table.border = False

        for param in self:
            table.add_row([param.name, str(param.get().result())])

        return table.get_string(sortby="Parameter")
Example #7
0
    async def info_table(self):
        from concert.session.utils import get_default_table

        table = get_default_table(["Parameter", "Value"])
        table.border = False

        for param in self:
            try:
                value = str(await param.get())
            except ReadAccessError:
                value = 'N/A'
            table.add_row([param.name, value])

        return table