simple server-side plugin to allow users to print files
This commit is contained in:
commit
fd42fed19d
4 changed files with 51 additions and 0 deletions
6
install.sh
Executable file
6
install.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
mkdir -p ${HOME}/.nomadnetwork/storage/plugins/print3d/files/
|
||||||
|
mkdir -p ${HOME}/.nomadnetwork/storage/plugins/print3d/printers/
|
||||||
|
mkdir -p ${HOME}/.nomadnetwork/storage/pages/print3d/
|
||||||
|
yes | cp -rf ./pages/* ${HOME}/.nomadnetwork/storage/pages/print3d
|
||||||
|
echo "print3d installed, make sure to make pages/print3d/index.mu accessible!"
|
||||||
38
pages/index.mu
Executable file
38
pages/index.mu
Executable file
|
|
@ -0,0 +1,38 @@
|
||||||
|
#!/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))
|
||||||
|
|
||||||
7
pages/submit.mu
Executable file
7
pages/submit.mu
Executable file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
STORAGEDIR=${var_nomad_dir}/storage/plugins/print3d
|
||||||
|
PCONFIG=${STORAGEDIR}/printers/${field_printer}
|
||||||
|
FILE=${STORAGEDIR}/files/${field_file}
|
||||||
|
|
||||||
|
${var_nomad_dir}/plugins/print3d/prusatool --printer-config ${PCONFIG} load ${FILE} --print-immediately
|
||||||
BIN
prusatool
Executable file
BIN
prusatool
Executable file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue