18 lines
582 B
Python
18 lines
582 B
Python
from helpers.either import Either, Left, Right
|
|
from repository.freecad_repository import (
|
|
FreeCadRepository,
|
|
)
|
|
|
|
|
|
class OpenFreeCadDocumentUseCase:
|
|
"""A class that checks open documents, closes them and opens the one with which the program will work"""
|
|
|
|
def call(path: str) -> Either:
|
|
try:
|
|
FreeCadRepository().closeIfOpenDocument()
|
|
FreeCadRepository().openDocument(path)
|
|
return Left(None)
|
|
except Exception as e:
|
|
print(e)
|
|
print("OpenFreeCadDocumentUseCase error")
|
|
return Right(None)
|