コード例 #1
0
    def add_whois(self, data, analyst, date=None, editable=True):
        """
        Add whois information to the domain.

        :param data: The contents of the whois.
        :type data: str
        :param analyst: The user adding the whois.
        :type analyst: str
        :param date: The date for this whois entry.
        :type date: datetime.datetime
        :param editable: If this entry can be modified.
        :type editable: boolean
        :returns: :class:`crits.core.domains.domain.WhoisEntry`
        """

        if not date:
            date = datetime.datetime.now()
        whois_entry = WhoisEntry(data).to_dict()

        e = EmbeddedWhoIs()
        e.date = date
        e.analyst = analyst
        e.editable = editable
        e.text = data
        e.data = whois_entry
        self.whois.append(e)
        return whois_entry
コード例 #2
0
ファイル: domain.py プロジェクト: puhley/crits
    def edit_whois(self, data, date=None):
        """
        Edit whois information for the domain.

        :param data: The contents of the whois.
        :type data: str
        :param date: The date for this whois entry.
        :type date: datetime.datetime
        """

        if not date:
            return

        for w in self.whois:
            if w.date == date:
                whois_entry = WhoisEntry(data).to_dict()
                w.data = whois_entry
                w.text = data