Skip to content

Commit 9962b5b

Browse files
committed
Create odml.tools.converters
- Created the 'odml.tools.converters' directory. - Moved format_converter and version_converter to new directory. - Updated setup.py and imports in all affected files.
1 parent db48012 commit 9962b5b

9 files changed

Lines changed: 14 additions & 12 deletions

odml/scripts/odml_convert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
import odml
3737

38-
from odml.tools.version_converter import VersionConverter as VerConf
38+
from odml.tools.converters.version_converter import VersionConverter as VerConf
3939

4040
try:
4141
unicode = unicode

odml/scripts/odml_to_rdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import odml
3838

3939
from odml.tools.odmlparser import ODMLReader, ODMLWriter
40-
from odml.tools.version_converter import VersionConverter as VerConf
40+
from odml.tools.converters.version_converter import VersionConverter as VerConf
4141

4242
try:
4343
unicode = unicode

odml/tools/converters/__init__.py

Whitespace-only changes.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import sys
55

66
import odml
7-
from .rdf_converter import RDFWriter
7+
from ..rdf_converter import RDFWriter
88
from .version_converter import VersionConverter
9-
from .utils import ConversionFormats
9+
from ..utils import ConversionFormats
1010

1111
try:
1212
unicode = unicode
@@ -21,13 +21,13 @@ def convert(cls, args=None):
2121
"""
2222
Enable usage of the argparse for calling convert_dir(...)
2323
Example:
24-
1) >> python format_converter.py ./..path../input_dir v1_1 -out ./..path../output_dir -r
24+
1) >> python -m odml.tools.converters.format_converter ./..path../input_dir v1_1 -out ./..path../output_dir -r
2525
2626
Convert files from the path <./..path../input_dir> to .xml odml version 1.1,
2727
writes them into <./..path../output_dir> including subdirectories
2828
and its files from the input path.
2929
30-
2) >> python format_converter.py ./..path../input_dir odml
30+
2) >> python -m odml.tools.converters.format_converter ./..path../input_dir odml
3131
3232
Converts files from path <./..path../input_dir> to .odml,
3333
writes them into <./..path../input_dir_odml> not including subdirectories.

odml/tools/version_converter.py renamed to odml/tools/converters/version_converter.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
import yaml
66

77
from lxml import etree as ET
8-
from .. import format
9-
from ..info import FORMAT_VERSION
10-
from ..terminology import Terminologies, REPOSITORY_BASE
8+
9+
from ... import format
10+
from ...info import FORMAT_VERSION
11+
from ...terminology import Terminologies, REPOSITORY_BASE
1112

1213
import uuid
1314

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
packages = [
2323
'odml',
2424
'odml.tools',
25+
'odml.tools.converters',
2526
'odml.scripts'
2627
]
2728

test/test_format_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import unittest
44
from contextlib import contextmanager
55

6-
from odml.tools.format_converter import FormatConverter
6+
from odml.tools.converters.format_converter import FormatConverter
77

88
FC = FormatConverter
99

test/test_version_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from contextlib import contextmanager
1414
from lxml import etree as ET
1515
from odml.terminology import REPOSITORY_BASE
16-
from odml.tools.version_converter import VersionConverter
16+
from odml.tools.converters.version_converter import VersionConverter
1717

1818
try:
1919
unicode = unicode

test/test_version_converter_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import unittest
1010

1111
from odml import load
12-
from odml.tools.version_converter import VersionConverter as VC
12+
from odml.tools.converters.version_converter import VersionConverter as VC
1313

1414

1515
class TestVersionConverterIntegration(unittest.TestCase):

0 commit comments

Comments
 (0)