diff --git a/clim b/clim index 3b7d3bf..22cfd17 100755 --- a/clim +++ b/clim @@ -1,7 +1,6 @@ #!/usr/bin/env python3 -import plotext -from codelimit.Scanner import scan +from codelimit.common.Scanner import scan from codelimit.version import version, release_date print('Code Limit') diff --git a/codelimit/Location.py b/codelimit/common/Location.py similarity index 100% rename from codelimit/Location.py rename to codelimit/common/Location.py diff --git a/codelimit/Report.py b/codelimit/common/Report.py similarity index 100% rename from codelimit/Report.py rename to codelimit/common/Report.py diff --git a/codelimit/Scanner.py b/codelimit/common/Scanner.py similarity index 86% rename from codelimit/Scanner.py rename to codelimit/common/Scanner.py index e281873..7e4b8ca 100644 --- a/codelimit/Scanner.py +++ b/codelimit/common/Scanner.py @@ -2,9 +2,9 @@ from halo import Halo -from codelimit.Python import get_headers, get_blocks -from codelimit.Report import Report, Measurement -from codelimit.Scope import build_scopes +from codelimit.languages.python.Python import get_headers, get_blocks +from codelimit.common.Report import Report, Measurement +from codelimit.common.Scope import build_scopes def is_hidden(root, file): diff --git a/codelimit/Scope.py b/codelimit/common/Scope.py similarity index 94% rename from codelimit/Scope.py rename to codelimit/common/Scope.py index 63760df..96a4f4f 100644 --- a/codelimit/Scope.py +++ b/codelimit/common/Scope.py @@ -1,4 +1,4 @@ -from codelimit.SourceRange import Header, Block +from codelimit.common.SourceRange import Header, Block class Scope: diff --git a/codelimit/Source.py b/codelimit/common/Source.py similarity index 89% rename from codelimit/Source.py rename to codelimit/common/Source.py index ecae449..9110a30 100644 --- a/codelimit/Source.py +++ b/codelimit/common/Source.py @@ -1,5 +1,5 @@ -from codelimit.Location import Location -from codelimit.SourceRange import SourceRange +from codelimit.common.Location import Location +from codelimit.common.SourceRange import SourceRange def index_to_location(code: str, index: int) -> Location: diff --git a/codelimit/SourceRange.py b/codelimit/common/SourceRange.py similarity index 87% rename from codelimit/SourceRange.py rename to codelimit/common/SourceRange.py index 8f15602..0aea8b7 100644 --- a/codelimit/SourceRange.py +++ b/codelimit/common/SourceRange.py @@ -1,4 +1,4 @@ -from codelimit.Location import Location +from codelimit.common.Location import Location class SourceRange: diff --git a/codelimit/common/__init__.py b/codelimit/common/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/codelimit/languages/__init__.py b/codelimit/languages/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/codelimit/Python.py b/codelimit/languages/python/Python.py similarity index 89% rename from codelimit/Python.py rename to codelimit/languages/python/Python.py index d670631..6a5ebbf 100644 --- a/codelimit/Python.py +++ b/codelimit/languages/python/Python.py @@ -1,8 +1,8 @@ from re import finditer -from codelimit.Location import Location -from codelimit.Source import index_to_location -from codelimit.SourceRange import Block, Header +from codelimit.common.Location import Location +from codelimit.common.Source import index_to_location +from codelimit.common.SourceRange import Block, Header def get_indentation(line: str): diff --git a/codelimit/languages/python/__init__.py b/codelimit/languages/python/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/common/__init__.py b/tests/common/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_Block.py b/tests/common/test_Block.py similarity index 60% rename from tests/test_Block.py rename to tests/common/test_Block.py index 1e6fd24..3304e28 100644 --- a/tests/test_Block.py +++ b/tests/common/test_Block.py @@ -1,5 +1,5 @@ -from codelimit.Location import Location -from codelimit.SourceRange import Block +from codelimit.common.Location import Location +from codelimit.common.SourceRange import Block def test_str(): diff --git a/tests/test_Position.py b/tests/common/test_Position.py similarity index 68% rename from tests/test_Position.py rename to tests/common/test_Position.py index d91d9dc..d79b130 100644 --- a/tests/test_Position.py +++ b/tests/common/test_Position.py @@ -1,4 +1,4 @@ -from codelimit.Location import Location +from codelimit.common.Location import Location def test_str(): diff --git a/tests/test_Source.py b/tests/common/test_Source.py similarity index 90% rename from tests/test_Source.py rename to tests/common/test_Source.py index 272ce32..c4d2d4e 100644 --- a/tests/test_Source.py +++ b/tests/common/test_Source.py @@ -1,5 +1,5 @@ -from codelimit.Location import Location -from codelimit.Source import index_to_location, location_to_index +from codelimit.common.Location import Location +from codelimit.common.Source import index_to_location, location_to_index def test_index_to_location_single_line(): diff --git a/tests/languages/__init__.py b/tests/languages/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/languages/python/__init__.py b/tests/languages/python/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_Python.py b/tests/languages/python/test_Python.py similarity index 96% rename from tests/test_Python.py rename to tests/languages/python/test_Python.py index 131f2c6..f926b57 100644 --- a/tests/test_Python.py +++ b/tests/languages/python/test_Python.py @@ -1,4 +1,4 @@ -from codelimit.Python import get_indentation, get_blocks, get_headers +from codelimit.languages.python.Python import get_indentation, get_blocks, get_headers def test_get_indentation():