Skip to content

Commit

Permalink
added cli args
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalkrishnads committed Jul 1, 2024
1 parent 7caf25d commit aef7dcb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
9 changes: 5 additions & 4 deletions malformer/__main__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
from utils.downloader import Downloader
from utils.ui import UI
from utils.args import get_cli_args
from verify import Verifier
from corrupter import Corrupter

def main():

ui = UI()

account = ui.get_account()
device = ui.get_device()
route = ui.get_route(device)
if not account or not device or not route: quit()
account, device, route = get_cli_args()
account = account if account else ui.get_account()
device = device if device else ui.get_device()
route = route if route else ui.get_route(device)

print(f'\n-------- Downloading raw driving files of {route} -----------')
downloader = Downloader(account=account, dongleId=device, route=route)
Expand Down
12 changes: 12 additions & 0 deletions malformer/utils/args.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import argparse

def get_cli_args():
parser = argparse.ArgumentParser(description="A script to corrupt openpilot routes for comma connect")

parser.add_argument('-a', '--account', type=str, help="JWT access token for comma account")
parser.add_argument('-d', '--device', type=str, help="dongleId of the device from which route was uploaded")
parser.add_argument('-r', '--route', type=str, help="Unique ID of the route to be corrupted")

args = parser.parse_args()

return args.account, args.device, args.route

0 comments on commit aef7dcb

Please sign in to comment.