Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dababy #2

Open
sam-shridhar1950f opened this issue Feb 1, 2021 · 0 comments
Open

dababy #2

sam-shridhar1950f opened this issue Feb 1, 2021 · 0 comments

Comments

@sam-shridhar1950f
Copy link
Member

Make dis da code dud

import commands
import groups
import rank
import sys
import export
import clear

commands.add("help", "", "displays all cli commands")
commands.add("addgroup", "name, members", "adds a group file to the local database")
commands.add("score", "name", "enters ranking sequence for a given group")
commands.add("rank", "category", "lists groups from highest to lowest score in the given category")
commands.add("export", "", "exports rankings for all categories into a CSV file")
commands.add("clear", "", "clears filetree")


args = sys.argv
if len(args) < 2:
    commands.display()
    exit()

c = args[1].lower()

if c == "help":
    commands.display()

if c == "addgroup":
    name = args[2]
    members = args[3]
    groups.add(name, members)

if c == "score":
    name = args[2]
    groups.rank(name)

if c == "rank":
    category = args[2].lower()
    rank.rank(category)

if c == "export":
    export.exportAll()

if c == "clear":
    clear.clear()

if not commands.commandContains(c):
    print("invalid command: " + c)
    exit()
hershyz added a commit that referenced this issue Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant