Skip to content
Snippets Groups Projects
Commit cd35a121 authored by magnus2142's avatar magnus2142
Browse files

Created folder structure

parent 36717acb
No related branches found
No related tags found
No related merge requests found
File moved
from urllib import request
import os
from dotenv import load_dotenv
from RequestData import RequestData
from bbcli.Entities.RequestData import RequestData
import requests
import json
from bs4 import BeautifulSoup
......
"""This module provides the RP To-Do CLI."""
# rptodo/cli.py
from typing import Optional
import typer
from bbcli import __app_name__, __version__, endpoints
from bbcli.Services import AuthorizationService
app = typer.Typer()
app.add_typer(endpoints.app, name='endpoints', help='Call the endpoints')
def _version_callback(value: bool) -> None:
if value:
typer.echo(f"{__app_name__} v{__version__}")
typer.echo(f'{__app_name__} v{__version__}')
raise typer.Exit()
@app.callback()
def main(
version: Optional[bool] = typer.Option(
None,
"--version",
"-v",
help="Show the application's version and exit.",
'--version',
'-v',
help='Show the applications version and exit.',
callback=_version_callback,
is_eager=True,
)
) -> None:
return
#----- AUTHORIZATION MODULE -----#
@app.command(name='login', help='Authorize the user.')
def authorize_user():
AuthorizationService.login()
#----- COURSE MODULE -----#
@app.command(name='course')
def course(
course_id: Optional[str] = typer.Argument(None, help='The id of the course you want.'),
favorites: bool = typer.Option(False, help='List only your favorite courses.')):
if course_id != None and favorites == False:
# CODE FOR GETTING SPESIFIC COURSE
print('getting spesific course...')
elif course_id != None and favorites == True:
# CODE FOR GETTING SPESIFIC FAVORITE COURSE
print('getting spesific favorite course...')
else:
# CODE FOR GETTING ALL COURSES
print('getting all courses...')
\ No newline at end of file
......@@ -7,7 +7,7 @@ import typer
import click
from typing import Optional
from dotenv import load_dotenv
from anytree import Node, RenderTree
# from anytree import Node, RenderTree
import os
......
home = /Library/Frameworks/Python.framework/Versions/3.9/bin
home = /usr/bin
include-system-site-packages = false
version = 3.9.10
version = 3.8.10
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment