Example #1
0
 def get_domain_properties(self, domain):
     """
     get_domain_properties()
     """
     self.logger.debug('called get_domain_properties()')
     self.domain = domain
     prop = WhoisSearch(dname=self.domain)
     prop.whois_search()
     cdate = prop.creation_date()
     edate = prop.expiry_date()
     udate = prop.update_date()
     email = prop.emails()
     reg = prop.registrant()
     return cdate, edate, udate, email, reg
Example #2
0
    def run(self):

        self.logger.debug('called MultiSearchThread().run')

        search = WhoisSearch()
        search.wordlist = self._window_obj.m_list_multi_list.GetItems()

        #TODO If multi list box has values use it else get file from file textbox
        #Disabled....
        # if len(self._window_obj.m_list_multi_list.GetItems()):
        #     self.logger.debug('using mutil gui listbox')
        #     search.wordlist = self._window_obj.m_list_multi_list.GetItems()
        # else:
        #     self.logger.debug('using mutil word file textbox')
        #     search.wordlist = self._window_obj.m_textctrl_file.GetValue()

        tld = self._window_obj.m_combo_tld.GetValue()
        cctld = self._window_obj.m_combo_cctld.GetValue()
        gtld = self._window_obj.m_combo_gtld.GetValue()

        if tld != '' and cctld != '': search.tld = tld + "." + cctld
        elif tld != '': search.tld = tld
        elif cctld != '': search.tld = cctld
        elif gtld != '': search.tld = gtld
        #else:search.tld = 'com'

        if self._window_obj.m_checkbox_dead.GetValue() is True:
            search.deadonly = True

        if not len(self._window_obj.m_textctrl_sleep.GetValue()):
            self._window_obj.m_textctrl_sleep.SetValue('0')

        search.sleep = float(self._window_obj.m_textctrl_sleep.GetValue())

        try:

            proxy_enabled = bool(
                GUIEvent(self).check_bool_settings('proxy_enabled'))

            if proxy_enabled is True:
                search.connection.proxy = True
                search.connection.proxy_host = str(
                    GUIEvent(self).check_settings('proxy_host'))
                search.connection.proxy_port = int(
                    GUIEvent(self).check_settings('proxy_port'))
                search.connection.proxy_type = int(
                    GUIEvent(self).check_settings('proxy_type'))
            else:
                search.connection.proxy = False

            search.connection.timeout = int(
                GUIEvent(self).check_settings('connection_timeout'))

            multi = search.whois_multi_search()

            for multi_list in multi:

                status = multi_list[0]
                domain = multi_list[1]
                whois_server = search.whois_server
                creation_date = search.creation_date()
                expiry_date = search.expiry_date()
                update_date = search.update_date()

                if self._want_abort is 0:
                    wx.PostEvent(
                        self._window_obj,
                        ResultEvent(
                            self._window_obj.MULTI_SEARCH_EVT_RESULT_ID,
                            status, domain, creation_date, expiry_date,
                            update_date, whois_server))
                else:
                    self.logger.debug('aborted MultiSearchThread()')
                    break

        except Exception, e:

            self.logger.debug('error in MultiSearchThread() %s' % e)
            wx.PostEvent(
                self._window_obj,
                ResultEvent(self._window_obj.MULTI_SEARCH_EVT_ERROR_ID, e))
            raise exception.GUIException(self._window_obj,
                                         traceback.format_exc())