From: Plamen Dimitrov Date: Sat, 16 Apr 2022 15:12:05 +0000 (+0300) Subject: Fix inconsistent cnf structure method naming X-Git-Tag: v1.7.1~4^2~5 X-Git-Url: http://developer.intra2net.com/git/?p=pyi2ncommon;a=commitdiff_plain;h=42c1b1d10c6ada308d75e2f57f0eacc25508a61c Fix inconsistent cnf structure method naming Part of the API methods were using "from/to_cnfvar_dict" while the other part were using "from/to_cnf_structure". --- diff --git a/src/cnfvar/model.py b/src/cnfvar/model.py index 168f5db..aff7c38 100644 --- a/src/cnfvar/model.py +++ b/src/cnfvar/model.py @@ -494,7 +494,7 @@ class CnfListSerializationMixin(BaseCnfList): """ if renumber: self.renumber() - return {"cnf": [x.to_cnfvar_dict() for x in self]} + return {"cnf": [x.to_cnf_structure() for x in self]} def to_cnf_file(self, path, renumber=True, encoding=ENCODING): """ @@ -612,7 +612,7 @@ class CnfListSerializationMixin(BaseCnfList): class CnfSerializationMixin(BaseCnf): """Add serialization support to BaseCnf.""" - def to_cnfvar_dict(self): + def to_cnf_structure(self): """ Convert this instance to dictionary from the :py:mod:`cnfvar` module. @@ -633,7 +633,7 @@ class CnfSerializationMixin(BaseCnf): if self.comment is not None: d["comment"] = self.comment if len(self.children) > 0: - d["children"] = [c.to_cnfvar_dict() for c in self.children] + d["children"] = [c.to_cnf_structure() for c in self.children] return d def to_json_string(self, renumber=True):