Skip to content

Commit

Permalink
<Enhancement>[Ogl Xml Version]: <Identify Xml Version>
Browse files Browse the repository at this point in the history
[Not perfect but good enough for now]

[#10]
  • Loading branch information
Humberto Sanchez II committed Feb 13, 2023
1 parent 39656bf commit 0ee8af6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions oglio/OglVersion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

#
# This is the version of the XML that we currently support
#
version: str ='10'
2 changes: 2 additions & 0 deletions oglio/Reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from untanglepyut.UnTangler import Documents
from untanglepyut.UnTangler import UnTangler

from oglio import OglVersion
from oglio.Types import OglActors
from oglio.Types import OglClasses
from oglio.Types import OglDocument
Expand Down Expand Up @@ -110,6 +111,7 @@ def _makeOglProject(self, untangler: UnTangler) -> OglProject:

oglProject.toOglProject(untangler.projectInformation)

assert oglProject.version == OglVersion.version, 'We have mismatched XML versions'
documents: Documents = untangler.documents
for document in documents.values():
self.logger.debug(f'Untangled - {document.documentTitle}')
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name="oglio",
version="0.5.60",
version="0.5.62",
author_email='Humberto.A.Sanchez.II@gmail.com',
maintainer='Humberto A. Sanchez II',
maintainer_email='humberto.a.sanchez.ii@gmail.com',
Expand Down
4 changes: 4 additions & 0 deletions tests/oglio/TestReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from pkg_resources import resource_filename

from oglio import OglVersion
from oglio.Reader import Reader

from oglio.Types import OglClasses
Expand Down Expand Up @@ -50,6 +51,9 @@ def testProjectInformation(self):
oglProject: OglProject = self._reader.readXmlFile(fqFileName=fqFileName)

self.assertEqual(fqFileName, oglProject.fileName, 'Where is my file name')
expectedVersion: str = OglVersion.version
actualVersion: str = oglProject.version
self.assertEqual(expectedVersion, actualVersion, 'Mismatch in support Ogl Xml versions')

def testMultiDocumentRead(self):

Expand Down

0 comments on commit 0ee8af6

Please sign in to comment.