From 04450112bf7b32dec0d7d56b54cf55acb2623231 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Mon, 11 Sep 2017 10:28:46 -0400 Subject: [PATCH 1/2] Small change to tox.ini --- tox.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index bca18c3..fe4fb01 100644 --- a/tox.ini +++ b/tox.ini @@ -19,10 +19,9 @@ deps = pycodestyle commands = pycodestyle ./stix2 - flake8 --max-line-length=160 + flake8 [pycodestyle] -ignore= max-line-length=160 [flake8] From ec168e7bd022ac606fc8654fe57a09e51eba5469 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Mon, 11 Sep 2017 10:35:28 -0400 Subject: [PATCH 2/2] Update README --- README.rst | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 03c7cc3..17efd8a 100644 --- a/README.rst +++ b/README.rst @@ -49,17 +49,25 @@ not provided as keyword arguments: type. You can also provide the type explicitly, but this is not necessary: -``python indicator = Indicator(type='indicator', ...)`` +.. code:: python + + indicator = Indicator(type='indicator', ...) Passing a value for ``type`` that does not match the class being constructed will cause an error: -``python >>> indicator = Indicator(type='xxx', ...) stix2.exceptions.InvalidValueError: Invalid value for Indicator 'type': must equal 'indicator'.`` +.. code:: python + + >>> indicator = Indicator(type='xxx', ...) + stix2.exceptions.InvalidValueError: Invalid value for Indicator 'type': must equal 'indicator'. - If not provided, ``id`` will be generated randomly. If you provide an ``id`` argument, it must begin with the correct prefix: -``python >>> indicator = Indicator(id="campaign--63ce9068-b5ab-47fa-a2cf-a602ea01f21a") stix2.exceptions.InvalidValueError: Invalid value for Indicator 'id': must start with 'indicator--'.`` +.. code:: python + + >>> indicator = Indicator(id="campaign--63ce9068-b5ab-47fa-a2cf-a602ea01f21a") + stix2.exceptions.InvalidValueError: Invalid value for Indicator 'id': must start with 'indicator--'. - If not provided, ``created`` and ``modified`` will be set to the (same) current time.