コード例 #1
0
ファイル: stix_package.py プロジェクト: shinsec/python-stix
    def to_dict(self):
        d = utils.to_dict(self)

        if 'version' in d:
            d['version'] = STIXPackage._version  # noqa

        return d
コード例 #2
0
    def to_dict(self):
        d = utils.to_dict(self, skip=('item', ))

        if self.item:
            d[self._inner_var.lower()] = self.item.to_dict()

        return d
コード例 #3
0
ファイル: confidence.py プロジェクト: andybarilla/python-stix
    def to_dict(self):
        d = utils.to_dict(self, skip=('timestamp_precision',))

        if self.timestamp_precision != 'second':
            d['timestamp_precision'] = self.timestamp_precision

        return d
コード例 #4
0
ファイル: malware_instance.py プロジェクト: wagner-certat/csp
    def to_dict(self):
        d = utils.to_dict(self)

        if getattr(self, '_XSI_TYPE', None):
            d['xsi:type'] = self._XSI_TYPE

        return d
コード例 #5
0
    def to_dict(self):
        d = utils.to_dict(self)

        if getattr(self, '_XSI_TYPE', None):
            d['xsi:type'] = self._XSI_TYPE

        return d
コード例 #6
0
    def to_dict(self):
        d = utils.to_dict(self, skip=('item',))

        if self.item:
            d[self._inner_var.lower()] = self.item.to_dict()

        return d
コード例 #7
0
ファイル: statement.py プロジェクト: wagner-certat/csp
    def to_dict(self):
        d = utils.to_dict(self, skip=('timestamp_precision',))

        if self.timestamp_precision != 'second':
            d['timestamp_precision'] = self.timestamp_precision

        return d
コード例 #8
0
    def to_dict(self):
        d = utils.to_dict(self)

        if 'version' in d:
            d['version'] = STIXPackage._version  # noqa

        return d
コード例 #9
0
ファイル: confidence.py プロジェクト: dandye/python-stix
    def to_dict(self):
        skip = ("timestamp_precision",)
        d = utils.to_dict(self, skip=skip)

        if self.timestamp_precision != "second":
            d["timestamp_precision"] = self.timestamp_precision

        return d
コード例 #10
0
ファイル: indicator.py プロジェクト: shinsec/python-stix
    def to_dict(self):
        keys = ('observables', 'observable_composition_operator', 'negate')
        d = utils.to_dict(self, skip=keys)

        if self.negate:
            d['negate'] = True

        if self.observables:
            if len(self.observables) == 1:
                d['observable'] = self.observables[0].to_dict()
            else:
                composite_observable = self._merge_observables(self.observables)
                d['observable'] = composite_observable.to_dict()

        return d
コード例 #11
0
ファイル: indicator.py プロジェクト: xakon/python-stix
    def to_dict(self):
        keys = ('observables', 'observable_composition_operator', 'negate')
        d = utils.to_dict(self, skip=keys)

        if self.negate:
            d['negate'] = True

        if self.observables:
            if len(self.observables) == 1:
                d['observable'] = self.observables[0].to_dict()
            else:
                composite_observable = self._merge_observables(
                    self.observables)
                d['observable'] = composite_observable.to_dict()

        return d
コード例 #12
0
ファイル: tools.py プロジェクト: xakon/python-stix
 def to_dict(self):
     return utils.to_dict(self)
コード例 #13
0
 def to_dict(self):
     d = utils.to_dict(self)
     return d
コード例 #14
0
ファイル: coa.py プロジェクト: ExodusIntelligence/python-stix
 def to_dict(self):
     d = utils.to_dict(self)
     return d
コード例 #15
0
 def to_dict(self):
     return utils.to_dict(self)