File tree Expand file tree Collapse file tree 10 files changed +207
-227
lines changed
Expand file tree Collapse file tree 10 files changed +207
-227
lines changed Original file line number Diff line number Diff line change 44
55import requests
66import superannotate .lib .core as constances
7- from packaging .version import parse
87from superannotate .lib import get_default_controller
8+ from packaging .version import parse
99from superannotate .lib .app .analytics .class_analytics import class_distribution
1010from superannotate .lib .app .exceptions import AppException
1111from superannotate .lib .app .input_converters .conversion import convert_json_version
107107)
108108from superannotate .lib .app .interface .sdk_interface import validate_annotations
109109from superannotate .logger import get_default_logger
110+ from superannotate .lib .infrastructure .controller import Controller
110111from superannotate .version import __version__
111112
112113
113114controller = get_default_controller ()
114115
116+
115117__all__ = [
116118 "__version__" ,
117119 "controller" ,
Original file line number Diff line number Diff line change 55sys .path .append (os .path .dirname (os .path .abspath (__file__ )))
66sys .path .append (os .path .dirname (os .path .dirname (os .path .abspath (__file__ ))))
77
8- controller = None
9-
108
119def get_default_controller ():
1210 from lib .infrastructure .controller import Controller
11+ return Controller .get_default ()
1312
14- global controller
15- controller = Controller ()
16- return controller
Original file line number Diff line number Diff line change 1- from lib . infrastructure . controller import Controller
1+ from lib import get_default_controller
22from lib .infrastructure .repositories import ConfigRepository
33
44
55class BaseInterfaceFacade :
66 def __init__ (self ):
77 self ._config_path = None
8+ self ._controller = get_default_controller ()
89
910 @property
1011 def controller (self ):
1112 if not ConfigRepository ().get_one ("token" ):
1213 raise Exception ("Config does not exists!" )
13- controller = Controller ()
14- if self ._config_path :
15- controller .init (config_path = self ._config_path )
16- return controller
14+ return self ._controller
Original file line number Diff line number Diff line change 1212from lib .app .interface .sdk_interface import attach_document_urls_to_project
1313from lib .app .interface .sdk_interface import attach_image_urls_to_project
1414from lib .app .interface .sdk_interface import attach_video_urls_to_project
15- from lib .app .interface .sdk_interface import controller
1615from lib .app .interface .sdk_interface import create_folder
1716from lib .app .interface .sdk_interface import create_project
1817from lib .app .interface .sdk_interface import upload_annotations_from_folder_to_project
2120from lib .app .interface .sdk_interface import upload_videos_from_folder_to_project
2221from lib .core .entities import ConfigEntity
2322from lib .infrastructure .repositories import ConfigRepository
23+ from lib .infrastructure .controller import Controller
24+
25+
26+ controller = Controller .get_default ()
2427
2528
2629class CLIFacade (BaseInterfaceFacade ):
You can’t perform that action at this time.
0 commit comments