def opt1(self, p_iJoy=None, p_iLine=None):
     try:
         self.m_oWIFIClass
     except:
         self.m_oWIFIClass = wifi()
     if p_iJoy == None:
         return self.opt1_datas()
 def opt6(self, p_iJoy=None, p_iLine=None):
     try:
         self.m_oWIFIClass
     except:
         self.m_oWIFIClass = wifi()
     if p_iJoy == None:
         return self.opt6_datas()
     if p_iJoy & CRT_OK:
         value = self.m_oWIFIClass.get_ssid()
         if value == "[A:SCAN]":
             if len(self.m_oWIFIClass.get_ssid_list()) > 1:
                 self.info("Select an SSID", "icon_info")
             else:
                 self.info("Scan SSIDs", "icon_info")
         elif value == "[Your SSID]":
             self.info("Write your SSID", "icon_info")
         elif value == self.m_oWIFIClass.status():
             self.info("Already connected", "icon_info")
         elif not self.m_oWIFIClass.get_pwd():
             self.info("Write a password", "icon_info")
         else:
             self.info("Connecting", "icon_clock")
             if self.m_oWIFIClass.connect():
                 self.info("Connected", "icon_info")
             else:
                 self.info("Could not connect", "icon_info")
                 #self.m_oWIFIClass.clear()
         time.sleep(2)
         self.info()
 def opt4(self, p_iJoy=None, p_iLine=None):
     try:
         self.m_oWIFIClass
     except:
         self.m_oWIFIClass = wifi()
     if p_iJoy == None:
         return self.opt4_datas()
     if p_iJoy & CRT_LEFT or p_iJoy & CRT_RIGHT:
         if self.m_oWIFIClass.get_mode().lower() == "manual":
             return
         list = self.m_lLines[p_iLine]['options']
         value = self.m_lLines[p_iLine]['value']
         new = explore_list(p_iJoy, value, list)
         if new:
             self.m_oWIFIClass.ssid(new)
             self.m_lLines[p_iLine]['value'] = new
     elif p_iJoy & CRT_OK:
         if self.m_oWIFIClass.get_mode().lower() == "manual":
             value = self.m_lLines[p_iLine]['value']
             new = self._launch_kbd("", 30).strip()
             if new:
                 self.m_oWIFIClass.ssid(new)
                 self.m_lLines[p_iLine]['value'] = new
         elif self.m_oWIFIClass.get_mode().lower() == "detect":
             value = self.m_lLines[p_iLine]['value']
             self.info("Scanning SSIDs", "icon_clock")
             list = self.m_oWIFIClass.detect(value)
             if list:
                 self.m_lLines[p_iLine]['options'] = list
                 self.m_lLines[p_iLine][
                     'value'] = self.m_oWIFIClass.get_ssid()
             self.info()
 def opt7_datas(self):
     try:
         self.m_oWIFIClass
     except:
         self.m_oWIFIClass = wifi()
     p_lLines = {'color_val': "type_color_1", 'icon': "icon_bin"}
     if self.m_oWIFIClass.status():
         p_lLines.update({'text': "Disconnect from SSID"})
     else:
         p_lLines.update({'text': "Clear config"})
     return p_lLines
 def opt6_datas(self):
     try:
         self.m_oWIFIClass
     except:
         self.m_oWIFIClass = wifi()
     p_lLines = {
         'text': "Connect to WIFI",
         'color_val': "type_color_1",
         'icon': "icon_bin"
     }
     return p_lLines
 def opt7(self, p_iJoy=None, p_iLine=None):
     try:
         self.m_oWIFIClass
     except:
         self.m_oWIFIClass = wifi()
     if p_iJoy == None:
         return self.opt7_datas()
     if p_iJoy & CRT_OK:
         self.info("Please Wait", "icon_clock")
         self.m_oWIFIClass.clear()
         self.info("WIFI config cleared", "icon_info")
         time.sleep(2)
         self.info()
 def opt5_datas(self):
     try:
         self.m_oWIFIClass
     except:
         self.m_oWIFIClass = wifi()
     p_lLines = {
         'text': "Password",
         'color_val': "type_color_1",
         'icon': "icon_edit"
     }
     value = '*****'
     p_lLines.update({'value': value})
     return p_lLines
 def opt3(self, p_iJoy=None, p_iLine=None):
     try:
         self.m_oWIFIClass
     except:
         self.m_oWIFIClass = wifi()
     if p_iJoy == None:
         return self.opt3_datas()
     if p_iJoy & CRT_LEFT or p_iJoy & CRT_RIGHT:
         list = self.m_lLines[p_iLine]['options']
         value = self.m_lLines[p_iLine]['value']
         new = explore_list(p_iJoy, value, list)
         if new:
             self.m_oWIFIClass.mode(new)
             self.m_lLines[p_iLine]['value'] = new
 def opt3_datas(self):
     try:
         self.m_oWIFIClass
     except:
         self.m_oWIFIClass = wifi()
     p_lLines = {
         'text': "SSID Input Mode",
         'color_val': "type_color_1",
         'icon': None
     }
     value = self.m_oWIFIClass.get_mode()
     list = self.m_oWIFIClass.get_mode_list()
     p_lLines.update({'value': value})
     p_lLines.update({'options': list})
     return p_lLines
 def opt2_datas(self):
     try:
         self.m_oWIFIClass
     except:
         self.m_oWIFIClass = wifi()
     p_lLines = {
         'text': "WIFI Country",
         'color_val': "type_color_1",
         'icon': None
     }
     value = self.m_oWIFIClass.get_country()
     list = self.m_oWIFIClass.get_country_list()
     p_lLines.update({'value': value})
     p_lLines.update({'options': list})
     return p_lLines
 def opt5(self, p_iJoy=None, p_iLine=None):
     try:
         self.m_oWIFIClass
     except:
         self.m_oWIFIClass = wifi()
     if p_iJoy == None:
         return self.opt5_datas()
     if p_iJoy & CRT_OK:
         new = self._launch_kbd(self.m_oWIFIClass.get_pwd(), 30)
         if new:
             if not self.m_oWIFIClass.pwd(new):
                 self.info([
                     "Password length", "must be between", "8-63 characters"
                 ], "icon_info")
                 time.sleep(2)
                 self.info()
 def opt2(self, p_iJoy=None, p_iLine=None):
     try:
         self.m_oWIFIClass
     except:
         self.m_oWIFIClass = wifi()
     if p_iJoy == None:
         return self.opt2_datas()
     if p_iJoy & CRT_LEFT or p_iJoy & CRT_RIGHT:
         list = self.m_lLines[p_iLine]['options']
         value = self.m_lLines[p_iLine]['value']
         new = explore_list(p_iJoy, value, list)
         if new:
             self.info("Please Wait", "icon_info")
             self.m_oWIFIClass.country(new)
             value = self.m_oWIFIClass.get_country()
             self.m_lLines[p_iLine]['value'] = value
             self.info()
 def opt1_datas(self):
     try:
         self.m_oWIFIClass
     except:
         self.m_oWIFIClass = wifi()
     p_lLines = {'color_val': "type_color_1", 'icon': None}
     value = self.m_oWIFIClass.status()
     if value:
         text = "Connected"
         value = "SSID:" + value
     else:
         text = "Disconnected"
         value = "SSID:N/A"
         p_lLines.update({'color_val': "type_color_7"})
     p_lLines.update({'text': text})
     p_lLines.update({'value': value})
     return p_lLines
 def opt4_datas(self):
     try:
         self.m_oWIFIClass
     except:
         self.m_oWIFIClass = wifi()
     p_lLines = {'text': "SSID", 'color_val': "type_color_1"}
     if self.m_oWIFIClass.get_mode().lower() == "manual":
         value = self.m_oWIFIClass.get_ssid()
         p_lLines.update({'icon': "icon_edit"})
         p_lLines.update({'options': None})
     if self.m_oWIFIClass.get_mode().lower() == "detect":
         list = self.m_oWIFIClass.get_ssid_list()
         value = self.m_oWIFIClass.get_ssid()
         if value == "[A:SCAN]":
             p_lLines.update({'icon': "icon_bin"})
         else:
             p_lLines.update({'icon': None})
         p_lLines.update({'options': list})
     p_lLines.update({'value': value})
     return p_lLines