Skip to content

Commit

Permalink
change beta to early_access
Browse files Browse the repository at this point in the history
  • Loading branch information
BennyBot committed Feb 23, 2024
1 parent 6893be8 commit 9493d9d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pros/cli/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def add_depot(name: str, url: str, early_access: bool):
Visit https://pros.cs.purdue.edu/v5/cli/conductor.html to learn more
"""
_conductor = c.Conductor()
_conductor.add_depot(name, url, beta=early_access)
_conductor.add_depot(name, url, early_access=early_access)

ui.echo(f"Added depot {name} from {url}")

Expand Down
14 changes: 7 additions & 7 deletions pros/conductor/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ def __init__(self, file=None):
if MAINLINE_NAME not in self.depots or \
not isinstance(self.depots[MAINLINE_NAME], HttpDepot) or \
self.depots[MAINLINE_NAME].location != MAINLINE_URL:
self.depots[MAINLINE_NAME] = HttpDepot(MAINLINE_NAME, MAINLINE_URL, beta=False)
self.depots[MAINLINE_NAME] = HttpDepot(MAINLINE_NAME, MAINLINE_URL, early_access=False)
needs_saving = True
# add early access depot as another remote depot
if EARLY_ACCESS_NAME not in self.depots or \
not isinstance(self.depots[EARLY_ACCESS_NAME], HttpDepot) or \
self.depots[EARLY_ACCESS_NAME].location != EARLY_ACCESS_URL:
self.depots[EARLY_ACCESS_NAME] = HttpDepot(EARLY_ACCESS_NAME, EARLY_ACCESS_URL, beta=True)
self.depots[EARLY_ACCESS_NAME] = HttpDepot(EARLY_ACCESS_NAME, EARLY_ACCESS_URL, early_access=True)
needs_saving = True
if self.default_target is None:
self.default_target = 'v5'
Expand Down Expand Up @@ -154,7 +154,7 @@ def fetch_template(self, depot: Depot, template: BaseTemplate, **kwargs) -> Loca
local_template = LocalTemplate(orig=template, location=destination)
local_template.metadata['origin'] = depot.name
click.echo(f'Adding {local_template.identifier} to registry...', nl=False)
if depot.config.get("beta",False): # check for early access
if depot.config.get("early_access",False): # check for early access
self.early_access_local_templates.add(local_template)
else:
self.local_templates.add(local_template)
Expand Down Expand Up @@ -207,7 +207,7 @@ def resolve_templates(self, identifier: Union[str, BaseTemplate], allow_online:
if allow_online:
for depot in self.depots.values():
# EarlyAccess depot will only be accessed when the --early-access flag is true
if not depot.config.get("beta", False) or (depot.config.get("beta", False) and use_early_access):
if not depot.config.get("early_access", False) or (depot.config.get("early_access", False) and use_early_access):
remote_templates = depot.get_remote_templates(force_check=force_refresh, **kwargs)
online_results = list(filter(lambda t: t.satisfies(query, kernel_version=kernel_version),
remote_templates))
Expand Down Expand Up @@ -403,13 +403,13 @@ def new_project(self, path: str, no_default_libs: bool = False, **kwargs) -> Pro
logger(__name__).exception(e)
return proj

def add_depot(self, name: str, url: str, beta: bool):
self.depots[name] = HttpDepot(name, url, beta=beta)
def add_depot(self, name: str, url: str, early_access: bool):
self.depots[name] = HttpDepot(name, url, early_access=early_access)
self.save()

def remove_depot(self, name: str):
del self.depots[name]
self.save()

def query_depots(self, url: bool):
return [(' BETA -- ' if depot.config.get("beta", False) else 'STABLE -- ') + name + ((' -- ' + depot.location) if url else '') for name, depot in self.depots.items()]
return [(' BETA -- ' if depot.config.get("early_access", False) else 'STABLE -- ') + name + ((' -- ' + depot.location) if url else '') for name, depot in self.depots.items()]
2 changes: 1 addition & 1 deletion pros/conductor/depots/http_depot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class HttpDepot(Depot):
def __init__(self, name: str, location: str, beta: bool = False):
# Note: If update_frequency = timedelta(minutes=1) isn't included as a parameter,
# the beta depot won't be saved in conductor.json correctly
super().__init__(name, location, config={"beta": beta}, config_schema={}, update_frequency = timedelta(minutes=1))
super().__init__(name, location, config={"early_access": beta}, config_schema={}, update_frequency = timedelta(minutes=1))

def fetch_template(self, template: BaseTemplate, destination: str, **kwargs):
import requests
Expand Down

0 comments on commit 9493d9d

Please sign in to comment.