added a gemini.md file, added some commands to main.py modified readme
and made a forensiscs page
This commit is contained in:
@@ -19,6 +19,30 @@ def write_config(data: dict, config = f"{user_config_dir()}/ctf"):
|
||||
with open(config, "w") as f:
|
||||
toml.dump(data, f)
|
||||
|
||||
# return a list of path objects for each catagory in a competition
|
||||
def active_categories(p: Path) -> list:
|
||||
cats = []
|
||||
if not p.exists(): return []
|
||||
for cat in p.iterdir():
|
||||
cats.append(cat)
|
||||
return cats
|
||||
|
||||
#return a lsit of Path objects of competitions in the base directory
|
||||
def active_competitions(dir: str) -> dict:
|
||||
comps = {}
|
||||
p = Path(dir)
|
||||
if not p.exists(): return {}
|
||||
for item in p.iterdir():
|
||||
if item.name == "tools": continue
|
||||
comps[item] = active_categories(item)
|
||||
print(item.name)
|
||||
print(comps[item])
|
||||
return comps
|
||||
|
||||
# Class for a competition, defining active catagories, challenges completed, etc
|
||||
class competition():
|
||||
def __init__(self, p: Path):
|
||||
pass
|
||||
|
||||
config = load_config("/home/venus/code/ctf/config.toml")
|
||||
competition = config["Competition"]
|
||||
|
||||
Reference in New Issue
Block a user