Skip to content

Commit b24e4ca

Browse files
committed
pnl2html: Check params and run panela render
ag -l | entr pipenv run ./pnl2html.py ../share/firstpage-v2.pnl
1 parent b15ecad commit b24e4ca

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

lib/pnl2html.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,18 @@
1616
if __name__ == '__main__':
1717
if not sys.argv[1:]:
1818
sys.exit('usage: pnl2html.py <filename.pnl>')
19+
pnlfile = sys.argv[1]
20+
if not os.path.isfile(pnlfile):
21+
sys.exit("error: " + pnlfile + " does not exist")
1922

20-
from panela import panela_colors
23+
from panela.panela_colors import Template
2124

22-
with open(sys.argv[1], 'rb') as pnlfile:
23-
print(head)
24-
print("... TODO panela html render ...")
25-
print(foot)
25+
print(head)
26+
27+
pnl = Template()
28+
pnl.read(pnlfile)
29+
pnl.apply_mask()
30+
print(pnl.show())
31+
32+
print(foot)
2633

0 commit comments

Comments
 (0)