From fc600df5f16c25ec768a1412c3a3d73cdf081f31 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Fri, 16 Oct 2020 16:43:12 -0400 Subject: [PATCH] update .gitignore and conf.py --- .gitignore | 3 ++- docs/conf.py | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 9758937..72b31cd 100644 --- a/.gitignore +++ b/.gitignore @@ -55,7 +55,8 @@ coverage.xml # Sphinx documentation docs/_build/ .ipynb_checkpoints -default_sem_eq_weights.rst +graph_default_sem_eq_weights.rst +object_default_sem_eq_weights.rst # PyBuilder target/ diff --git a/docs/conf.py b/docs/conf.py index 8b372d5..9723e39 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -8,7 +8,8 @@ from six import class_types from sphinx.ext.autodoc import ClassDocumenter from stix2.base import _STIXBase -from stix2.environment import WEIGHTS +from stix2.equivalence.graph import GRAPH_WEIGHTS +from stix2.equivalence.object import WEIGHTS from stix2.version import __version__ sys.path.insert(0, os.path.abspath('..')) @@ -62,12 +63,19 @@ latex_documents = [ ] # Add a formatted version of environment.WEIGHTS -default_sem_eq_weights = json.dumps(WEIGHTS, indent=4, default=lambda o: o.__name__) -default_sem_eq_weights = default_sem_eq_weights.replace('\n', '\n ') -default_sem_eq_weights = default_sem_eq_weights.replace(' "', ' ') -default_sem_eq_weights = default_sem_eq_weights.replace('"\n', '\n') -with open('default_sem_eq_weights.rst', 'w') as f: - f.write(".. code-block:: py\n\n {}\n\n".format(default_sem_eq_weights)) +object_default_sem_eq_weights = json.dumps(WEIGHTS, indent=4, default=lambda o: o.__name__) +object_default_sem_eq_weights = object_default_sem_eq_weights.replace('\n', '\n ') +object_default_sem_eq_weights = object_default_sem_eq_weights.replace(' "', ' ') +object_default_sem_eq_weights = object_default_sem_eq_weights.replace('"\n', '\n') +with open('object_default_sem_eq_weights.rst', 'w') as f: + f.write(".. code-block:: python\n\n {}\n\n".format(object_default_sem_eq_weights)) + +graph_default_sem_eq_weights = json.dumps(GRAPH_WEIGHTS, indent=4, default=lambda o: o.__name__) +graph_default_sem_eq_weights = graph_default_sem_eq_weights.replace('\n', '\n ') +graph_default_sem_eq_weights = graph_default_sem_eq_weights.replace(' "', ' ') +graph_default_sem_eq_weights = graph_default_sem_eq_weights.replace('"\n', '\n') +with open('graph_default_sem_eq_weights.rst', 'w') as f: + f.write(".. code-block:: python\n\n {}\n\n".format(graph_default_sem_eq_weights)) def get_property_type(prop):