Skip to content

Commit

Permalink
🧹 Remove PROS 4 Prompts (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushuk authored May 7, 2024
1 parent 022dc57 commit 3335d17
Showing 1 changed file with 3 additions and 30 deletions.
33 changes: 3 additions & 30 deletions pros/conductor/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,20 +303,7 @@ def apply_template(self, project: Project, identifier: Union[str, BaseTemplate],
if not confirm:
raise dont_send(
InvalidTemplateException(f'Not downgrading'))
elif not project.use_early_access and template.version[0] == '3' and not self.warn_early_access:
confirm = ui.confirm(f'PROS 4 is now in early access. '
f'Please use the --early-access flag if you would like to use it.\n'
f'Do you want to use PROS 4 instead?')
self.warn_early_access = True
if confirm: # use pros 4
project.use_early_access = True
project.save()
kwargs['version'] = '>=0'
kwargs['early_access'] = True
# Recall the function with early access enabled
return self.apply_template(project, identifier, **kwargs)

self.save()

if not isinstance(template, LocalTemplate):
with ui.Notification():
template = self.fetch_template(self.get_depot(template.metadata['origin']), template, **kwargs)
Expand Down Expand Up @@ -371,22 +358,8 @@ def new_project(self, path: str, no_default_libs: bool = False, **kwargs) -> Pro
else:
use_early_access = self.use_early_access
kwargs["early_access"] = use_early_access
if kwargs["version_source"]: # If true, then the user has not specified a version
if not use_early_access and self.warn_early_access:
ui.echo(f"PROS 4 is now in early access. "
f"If you would like to use it, use the --early-access flag.")
elif not use_early_access and not self.warn_early_access:
confirm = ui.confirm(f'PROS 4 is now in early access. '
f'Please use the --early-access flag if you would like to use it.\n'
f'Do you want to use PROS 4 instead?')
self.warn_early_access = True
if confirm:
use_early_access = True
kwargs['early_access'] = True
elif use_early_access:
ui.echo(f'Early access is enabled. Using PROS 4.')
elif use_early_access:
ui.echo(f'Early access is enabled.')
if use_early_access:
ui.echo(f'Early access is enabled. Experimental features have been applied.')

if not is_pathname_valid(str(Path(path).absolute())):
raise dont_send(ValueError('Project path contains invalid characters.'))
Expand Down

0 comments on commit 3335d17

Please sign in to comment.