Skip to content

Commit

Permalink
Revert "Merge branch 'develop' of github.com:purduesigbots/pros-cli i…
Browse files Browse the repository at this point in the history
…nto develop"

This reverts commit a3de138, reversing
changes made to d953b0d.
  • Loading branch information
omegaStag committed Oct 30, 2022
1 parent a3de138 commit 0929e41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
18 changes: 2 additions & 16 deletions pros/cli/click_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
from typing import *

import click.decorators
from click import ClickException
from pros.conductor.project import Project as p
from pros.common.utils import get_version


class PROSFormatted(click.BaseCommand):
Expand Down Expand Up @@ -60,6 +57,7 @@ def format_options(self, ctx, formatter):

self.format_commands(ctx, formatter)


class PROSCommand(PROSFormatted, click.Command):
pass

Expand Down Expand Up @@ -150,16 +148,4 @@ class PROSRoot(PROSGroup):


class PROSCommandCollection(PROSFormatted, click.CommandCollection):
def invoke(self, *args, **kwargs):
# should change none of the behavior of invoke / ClientException
# should just sit in the pipeline and do a quick echo before
# letting everything else go through.
try:
super(PROSCommandCollection, self).invoke(*args, **kwargs)
except ClickException as e:
click.echo("PROS-CLI Version: {}".format(get_version()))
isProject = p.find_project("")
if (isProject): #check if there is a project
curr_proj = p()
click.echo("PROS-Kernel Version: {}".format(curr_proj.kernel))
raise e
pass
3 changes: 1 addition & 2 deletions pros/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ def main():
ctx_obj = {}
click_handler = pros.common.ui.log.PROSLogHandler(ctx_obj=ctx_obj)
ctx_obj['click_handler'] = click_handler
formatter = pros.common.ui.log.PROSLogFormatter('%(levelname)s - %(name)s:%(funcName)s - %(message)s - pros-cli version:{version}'
.format(version = get_version()), ctx_obj)
formatter = pros.common.ui.log.PROSLogFormatter('%(levelname)s - %(name)s:%(funcName)s - %(message)s', ctx_obj)
click_handler.setFormatter(formatter)
logging.basicConfig(level=logging.WARNING, handlers=[click_handler])
cli.main(prog_name='pros', obj=ctx_obj)
Expand Down

0 comments on commit 0929e41

Please sign in to comment.