Skip to content

Commit

Permalink
馃悰Applies liblvgl without experimental features (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
noam987 committed Jun 6, 2024
1 parent f3618f4 commit 6621736
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 26 deletions.
43 changes: 18 additions & 25 deletions pros/conductor/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def __init__(self, file=None):
self.early_access_local_templates: Set[LocalTemplate] = set()
self.depots: Dict[str, Depot] = {}
self.default_target: str = 'v5'
self.default_libraries: Dict[str, List[str]] = None
self.early_access_libraries: Dict[str, List[str]] = None
self.pros_3_default_libraries: Dict[str, List[str]] = None
self.pros_4_default_libraries: Dict[str, List[str]] = None
self.use_early_access = False
self.warn_early_access = False
super(Conductor, self).__init__(file)
Expand All @@ -105,29 +105,29 @@ def __init__(self, file=None):
if self.default_target is None:
self.default_target = 'v5'
needs_saving = True
if self.default_libraries is None:
self.default_libraries = {
'v5': ['okapilib', 'liblvgl'],
if self.pros_3_default_libraries is None:
self.pros_3_default_libraries = {
'v5': ['okapilib'],
'cortex': []
}
needs_saving = True
if self.early_access_libraries is None or len(self.early_access_libraries['v5']) != 2:
self.early_access_libraries = {
'v5': ['liblvgl', 'okapilib'],
if self.pros_4_default_libraries is None:
self.pros_4_default_libraries = {
'v5': ['liblvgl'],
'cortex': []
}
needs_saving = True
if 'v5' not in self.default_libraries:
self.default_libraries['v5'] = []
if 'v5' not in self.pros_3_default_libraries:
self.pros_3_default_libraries['v5'] = ['okapilib']
needs_saving = True
if 'cortex' not in self.default_libraries:
self.default_libraries['cortex'] = []
if 'cortex' not in self.pros_3_default_libraries:
self.pros_3_default_libraries['cortex'] = []
needs_saving = True
if 'v5' not in self.early_access_libraries:
self.early_access_libraries['v5'] = []
if 'v5' not in self.pros_4_default_libraries:
self.pros_4_default_libraries['v5'] = ['liblvgl']
needs_saving = True
if 'cortex' not in self.early_access_libraries:
self.early_access_libraries['cortex'] = []
if 'cortex' not in self.pros_4_default_libraries:
self.pros_4_default_libraries['cortex'] = []
needs_saving = True
if needs_saving:
self.save()
Expand Down Expand Up @@ -381,16 +381,9 @@ def new_project(self, path: str, no_default_libs: bool = False, **kwargs) -> Pro
proj.save()

if not no_default_libs:
libraries = self.early_access_libraries if proj.use_early_access and (kwargs.get("version", ">").startswith("4") or kwargs.get("version", ">").startswith(">")) else self.default_libraries

version = kwargs['version'][0]
major_version = proj.kernel[0]
libraries = self.pros_4_default_libraries if major_version == '4' else self.pros_3_default_libraries
for library in libraries[proj.target]:
if version == '>' or version == '4':
if library == "okapilib":
continue
if version != '>' and version != '4':
if library == "liblvgl":
continue
try:
# remove kernel version so that latest template satisfying query is correctly selected
if 'version' in kwargs:
Expand Down
2 changes: 1 addition & 1 deletion pros/conductor/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, path: str = '.', create: bool = False, raise_on_error: bool =

if defaults is None:
defaults = {}
self.target: str = defaults.get('target', 'cortex').lower() # VEX Hardware target (V5/Cortex)
self.target: str = defaults.get('target', 'v5').lower() # VEX Hardware target (V5/Cortex)
self.templates: Dict[str, Template] = defaults.get('templates', {})
self.upload_options: Dict = defaults.get('upload_options', {})
self.project_name: str = defaults.get('project_name', None)
Expand Down

0 comments on commit 6621736

Please sign in to comment.