Skip to content

Commit

Permalink
style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rpiazza committed Apr 10, 2024
1 parent 11f4495 commit d5b68a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion observed-string-8b1/src/observed_string/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
from .observed_string import ObservedString
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
import stix2.exceptions
import stix2.properties

from stix2.properties import (OpenVocabProperty,
StringProperty)
from stix2.exceptions import MissingPropertiesError

from observed_string.observed_string import ObservedString, OBSERVED_STRING_EXTENSION_ID
from observed_string.observed_string import ObservedString

def test_parse_all_props():
obs_dict = {
Expand Down
12 changes: 4 additions & 8 deletions pap-marking-definition-f8d/src/pap/pap.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import stix2
from collections import OrderedDict
from stix2.v21.base import _STIXBase21
from stix2.v21 import MarkingDefinition
from stix2.properties import StringProperty, DictionaryProperty, EnumProperty
from stix2.properties import EnumProperty
from stix2.exceptions import ObjectConfigurationError

PAP_MARKING_EXTENSION_ID = 'extension-definition--f8d78575-edfd-406e-8e84-6162a8450f5b'
Expand All @@ -22,7 +20,7 @@
]

PAP_AMBER = {
'id':'marking-definition--60f8932b-e51e-4458-b265-a2e8be9a80ab',
'id': 'marking-definition--60f8932b-e51e-4458-b265-a2e8be9a80ab',
'created': '2022-10-02T00:00:00.000Z',
'name': 'PAP:AMBER',
'extensions': {
Expand All @@ -32,23 +30,20 @@
}
}

def check_pap_marking(pap_marking):
pass

@stix2.v21.CustomExtension(
PAP_MARKING_EXTENSION_ID, [
('pap', EnumProperty(PAP_COLORS, required=True))
]
)

class PAPExtension:
extension_type = 'property-extension'


class PAPMarkingDefinitionError(ObjectConfigurationError):

def __str__(self):
msg = "The only instances of PAP marking definitions permitted are those defined in the PAP Extension Specification"
return "The only instances of PAP marking definitions permitted are those defined in the PAP Extension Specification"


class PAPMarkingDefinition(MarkingDefinition):
Expand Down Expand Up @@ -119,6 +114,7 @@ def _check_object_constraints(self):
}
)


def check_pap_marking(pap_marking):
pap_objects = [PAP_AMBER, PAP_GREEN, PAP_RED, PAP_WHITE]
if pap_marking not in pap_objects:
Expand Down

0 comments on commit d5b68a1

Please sign in to comment.