Skip to content

Commit

Permalink
Wrap everything except tests in prusaerrors package
Browse files Browse the repository at this point in the history
This allows for easier installation.
  • Loading branch information
vladamatena committed Jul 9, 2020
1 parent 6c46250 commit 598d892
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
__pycache__
.coverage
*.egg-info
build
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ pylint:
stage: test
script:
- python3 -m pylint --version
- python3 -m pylint --persistent=n --jobs 0 --max-line-length=120 shared sl1 tests
- python3 -m pylint --persistent=n --jobs 0 --max-line-length=120 prusaerrors
File renamed without changes.
Empty file added prusaerrors/shared/__init__.py
Empty file.
11 changes: 10 additions & 1 deletion shared/codes.py → prusaerrors/shared/codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,16 @@ def code(self) -> str:
:return: Error code
"""
return f"#{self._printer.value:02}{self._category.value}{self._error:02}"
return f"#{self.raw_code}"

@property
def raw_code(self) -> str:
"""
Get raw code without "#" at the beginning
:return: Error code without "#"
"""
return f"{self._printer.value:02}{self._category.value}{self._error:02}"

@property
def printer(self) -> Printer:
Expand Down
Empty file added prusaerrors/sl1/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion sl1/codes.py → prusaerrors/sl1/codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"""


from shared.codes import Code, Category, unique_codes, Codes, Printer
from prusaerrors.shared.codes import Code, Category, unique_codes, Codes, Printer


@unique_codes
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from setuptools import setup, find_packages

setup(
name="sl1-errors",
name="prusa_errors",
version="2020.4.21",
packages=find_packages(exclude=["tests"]),
url="https://gitlab.com/prusa3d/sl1/sl1-errors",
url="https://github.com/prusa3d/Prusa-Error-Codes",
license="GNU General Public License v3 or later (GPLv3+)",
classifiers=["License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"],
)
2 changes: 1 addition & 1 deletion tests/test_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import unittest
from io import StringIO

from shared.codes import Codes, unique_codes, Printer, Code, Category
from prusaerrors.shared.codes import unique_codes, Codes, Printer, Code, Category


@unique_codes
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sl1.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import unittest

from sl1.codes import Sl1Codes
from prusaerrors.sl1.codes import Sl1Codes


class TestErrors(unittest.TestCase):
Expand Down

0 comments on commit 598d892

Please sign in to comment.