#!/bin/python3 import sys,os,re from func import * from config import * def add(): args=[] for i in ["Filepath","Category","Title","Source","Tags","Content"]: eingabe = input("Enter {}: ".format(i)) if i in ["Filepath"] and not eingabe: print("{} has to not be empty!".format(i)) return 1 if i in ["Category"] and not eingabe: print("{} set to 'default'".format(i)) eingabe="default" args.append(eingabe) print(args) tb.add_index(args[0],args[1],args[2],args[3],args[4],args[5]) def delete(args): selection=search(args) if selection[0] != ".": try: category=selection[4] filename=selection[0] os.remove("{}/{}".format(category,filename)) except Exception: print("Couldn't delete file!") return 1 tb.delete_index(selection) def help(): print("SYNTAX:\n\t'image-index' displays this text") print("\t'image-index