#!/bin/python

import os
from os import listdir
from os.path import isfile, join

userdir = os.path.expanduser("~")
nomaddir = userdir+"/.nomadnetwork"


print("> PRINTERS")
printers = [f for f in listdir(nomaddir+'/storage/plugins/print3d/printers')]
if len(printers) == 0:
	print("no printer config files available :(")
	print("add printer config files to: ~/.nomadnetwork/storage/plugins/print3d/printers/")

else:
	for p in printers:
		print("""`<^|printer|{p}`>`b {p}""".format(p=p))

print("\n")
print("> FILES")
files = [f for f in listdir(nomaddir+'/storage/plugins/print3d/files')]
if len(files) == 0:
	print("no print files available :(")
	print("add print files to: ~/.nomadnetwork/storage/plugins/print3d/files/")

else:
	for f in files:
		# print(f)
	    print("""`<^|file|{f}`>`b {f}""".format(f=f))


print("\n")
print("> SUBMIT")
# print("test:  `B444`<test`>`b")
print("""`!`[>SUBMIT<`:/page/print3d/submit.mu`test|printer|file|nomad_dir={ndir}]`!""".format(ndir=nomaddir))

