Ejemplo n.º 1
0
 def service_message(self, text, color):
     self.__send_to_socket(text,
                           row=oc.get_overlay_layout("service_row"),
                           col=oc.get_overlay_layout("service_col"),
                           color=color,
                           ttl=oc.get_overlay_ttl("service_ttl"),
                           size="large")
Ejemplo n.º 2
0
    def display_info(self, pilot_name, cmdrData):
        """
        Display an entry
        :param pilot_name:
        :param cmdrData:
        :return:
        """

        # Display cmdr name
        self.display_cmdr_name(pilot_name)

        # Display section headers
        self._display_section_header("Inara",
                                     oc.get_overlay_layout("first_col"))
        self._display_section_header("ROA DB",
                                     oc.get_overlay_layout("second_col"))

        # Inara
        inara_data = omniinara.parse_reply_for_overlay(cmdrData['inara'])

        if inara_data:
            if 'role' in inara_data:
                self._display_role(inara_data['role'])

            lines = []

            if 'wing' in inara_data:
                for line in inara_data['wing']:
                    lines.append(line)

            for line in inara_data['base']:
                lines.append(line)

            for line in inara_data['rank']:
                lines.append(line)

            text = "\n".join(lines)

            self._display_section(text, oc.get_overlay_layout("first_col"))
        else:
            self.display_warning("No results",
                                 oc.get_overlay_layout("first_col"))

        roa_data = omniroa.parse_reply_for_overlay(cmdrData['roa'])

        if roa_data:
            # Remove 'Clan' if 'wing' is in already in inara
            # 'Clan' is always returned from roa.parse_reply
            # or this will not work
            if inara_data and 'wing' in inara_data:
                text = "\n".join(roa_data[1:])
            else:
                text = "\n".join(roa_data)

            self._display_section(text, oc.get_overlay_layout("second_col"))
        else:
            self.display_warning("No results",
                                 oc.get_overlay_layout("second_col"))
Ejemplo n.º 3
0
 def flush(self):
     """
     Try to flush the overlay with empty lines
     :return:
     """
     self.display(FLUSH, oc.get_overlay_layout("sub_header_row"),
                  oc.get_overlay_layout("first_col"),
                  oc.get_overlay_color("text"))
     self.display(FLUSH, oc.get_overlay_layout("detail_row"),
                  oc.get_overlay_layout("first_col"),
                  oc.get_overlay_color("text"))
     self.display(FLUSH, oc.get_overlay_layout("detail_row"),
                  oc.get_overlay_layout("second_col"),
                  oc.get_overlay_color("text"))
Ejemplo n.º 4
0
 def _display_role(self, text):
     self.display(text,
                  row=oc.get_overlay_layout("sub_header_row"),
                  col=oc.get_overlay_layout("first_col"),
                  color=oc.get_overlay_color("cmdr_role"))
Ejemplo n.º 5
0
 def display_cmdr_name(self, text):
     self.display(text,
                  row=oc.get_overlay_layout("header_row"),
                  col=oc.get_overlay_layout("first_col"),
                  color=oc.get_overlay_color("cmdr_name"),
                  size="large")
Ejemplo n.º 6
0
 def display_warning(self, text, col):
     self.display(text,
                  row=oc.get_overlay_layout("detail_row"),
                  col=col,
                  color=oc.get_overlay_color("warning"),
                  size="large")
Ejemplo n.º 7
0
 def display_error(self, text):
     self.display(text,
                  row=oc.get_overlay_layout("detail_row"),
                  col=oc.get_overlay_layout("first_col"),
                  color=oc.get_overlay_color("error"),
                  size="large")
Ejemplo n.º 8
0
 def display_notification(self, text):
     self.display(text,
                  row=oc.get_overlay_layout("header_row"),
                  col=oc.get_overlay_layout("first_col"),
                  color=oc.get_overlay_color("notification"),
                  size="large")
Ejemplo n.º 9
0
 def _display_section(self, text, col):
     self.display(text,
                  row=oc.get_overlay_layout("detail_row"),
                  col=col,
                  color=oc.get_overlay_color("text"))
Ejemplo n.º 10
0
 def _display_section_header(self, title, col):
     self.display(title,
                  row=oc.get_overlay_layout("info_row"),
                  col=col,
                  color=oc.get_overlay_color("sect_title"),
                  size="large")