def save_file(): print(divider) print("SAVING FILE") print("-----------") print("current file list:") i = 0 for x in files: util.setrandcolor() print("\t[ " + str(i) + " ] " + x, end="") if i == working: print(" (loaded)") else: print("") i += 1 util.resetcolor() print("\t[ a ] (other)") print("\nwhere do you want to save? (q to cancel) ", end="") save = "" choice = input() if choice == 'q': return quickrel if choice == "a": print("enter new filename: ", end="") save = input() load_dir() # refresh file list! else: save = files[int(choice)] #qmis_html.sortable(datafile) write(save) return "\nsaved to " + save
def edit_item(itemID): raw = core.get_by_id(datafile, itemID)[itemID] fields = [] print("") print(single_item(itemID)) print("\nEDITING DEETS") i = 0 for x in sorted(raw.keys()): #for x in iter(raw): util.setrandcolor() print("\t[ ", end="") if i < 10: print(" ", end="") print(str(i) + " ] " + x + ": " + str(raw.get(x))) i += 1 fields.append(x) util.resetcolor() print("\n\t[ a ] (add new field)") print("what do you want to edit? (q to cancel) ", end="") choice = input() if choice == 'q': return quickrel if choice == "a": print("whatcha calling this new 'field'? ", end="") key = input() else: key = fields[int(choice)] raw.update(edit_field(key)) return edit_item(itemID)
def save_file(): print(divider) print("SAVING FILE") print("-----------") print("current file list:") i = 0 for x in files: util.setrandcolor() print("\t[ "+str(i)+" ] "+x, end="") if i == working: print(" (loaded)") else: print("") i += 1 util.resetcolor() print("\t[ a ] (other)") print("\nwhere do you want to save? (q to cancel) ", end="") save = "" choice = input() if choice =='q': return quickrel if choice == "a": print("enter new filename: ", end="") save = input() load_dir() # refresh file list! else: save = files[int(choice)] qmis_html.sortable(datafile) write(save) return "\nsaved to "+save
def edit_item(itemID): raw = core.get_by_id(datafile, itemID)[itemID] fields = [] print("") print(single_item(itemID)) print("\nEDITING DEETS") i = 0 for x in sorted(raw.keys()): #for x in iter(raw): util.setrandcolor() print("\t[ ", end="") if i < 10: print(" ", end="") print(str(i)+" ] "+x+": "+str(raw.get(x))) i += 1 fields.append(x) util.resetcolor() print("\n\t[ a ] (add new field)") print("what do you want to edit? (q to cancel) ", end="") choice = input() if choice =='q': return quickrel if choice == "a": print("whatcha calling this new 'field'? ", end="") key = input() else: key = fields[int(choice)] raw.update(edit_field(key)) return edit_item(itemID)
def print_menu(menu): print("OPTIONS!") i = 0 for x in menu: util.setrandcolor() print("\t[ ", end="") if i < 10: print(" ", end="") print(str(i)+" ] "+x) i += 1 util.resetcolor()
def start(): os.system("clear") util.setrandcolor() print(header) util.resetcolor() print("") load_dir() #set_dir() try: print(main_menu()) except ValueError: print("!!VOMIT!!\nthat was unexpected i'm starting over") print(main_menu()) except KeyboardInterrupt: print("?PANIC?") print(main_menu()) print(footer)