summaryrefslogtreecommitdiff
path: root/scripts/menus-write.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-09-08 01:28:21 +0200
committeremkael <emkael@tlen.pl>2017-09-08 01:28:21 +0200
commit8f795b1d445441daab5ffb75060a6dbf8ed0934a (patch)
tree15e55a2a7e03867ac0cccfb8303674d478510503 /scripts/menus-write.py
parent655a9847513332e8e119f37f7ed95f4ab002b1a1 (diff)
Renaming scripts so that their names make sense
Diffstat (limited to 'scripts/menus-write.py')
-rw-r--r--scripts/menus-write.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/menus-write.py b/scripts/menus-write.py
new file mode 100644
index 0000000..e30c702
--- /dev/null
+++ b/scripts/menus-write.py
@@ -0,0 +1,14 @@
+import copy, json, os, sys
+
+from bs4 import BeautifulSoup as bs4
+
+content_file = sys.argv[1]
+menu_content = file(sys.argv[2])
+
+content = bs4(file(content_file), 'lxml')
+
+for menu_container in content.select('.static-menu'):
+ menu_container.clear()
+ menu_container.append(bs4(menu_content, 'html.parser'))
+
+file(content_file, 'w').write(content.prettify().encode('utf-8'))