adjustments
Christian Fraß

Christian Fraß commited on 2017-04-17 22:19:08
Zeige 420 geänderte Dateien mit 51 Einfügungen und 8 Löschungen.

... ...
@@ -1,5 +1,6 @@
1 1
 temp/
2 2
 db/
3
+concepts/wiki/
3 4
 
4 5
 scripts/__pycache__/
5 6
 tools/__pycache__/
... ...
@@ -0,0 +1,21 @@
1
+#!/usr/bin/env python3
2
+
3
+import os as _os
4
+import json as _json
5
+
6
+
7
+def main():
8
+	data = []
9
+	folder = "concepts/json"
10
+	for name in _os.listdir(folder):
11
+		path = _os.path.join(folder, name)
12
+		handle = open(path, "r")
13
+		content = handle.read()
14
+		handle.close()
15
+		entry = _json.loads(content)
16
+		data.append(entry)
17
+	print(_json.dumps(data))
18
+	
19
+
20
+main()
21
+
... ...
@@ -0,0 +1,17 @@
1
+#!/usr/bin/env sh
2
+
3
+path=words.json
4
+python3 tools/merge.py > ${path}
5
+
6
+destination=mehl:/home/bfadmin/websites/folksprak.org/htdocs
7
+rsync \
8
+	--verbose \
9
+	--archive \
10
+	--compress \
11
+	--recursive \
12
+	--rsh=ssh \
13
+	${path} \
14
+	${destination}/
15
+
16
+rm ${path}
17
+
... ...
@@ -7,8 +7,10 @@ import common as _common
7 7
 
8 8
 def main(args):
9 9
 	_common.filemap(
10
-		"concepts", _common.json_from,
11
-		"temp/dokuwiki", _common.dokuwiki_to,
10
+		"concepts/json",
11
+		_common.json_from,
12
+		"concepts/wiki",
13
+		_common.dokuwiki_to,
12 14
 		lambda name_from: ("concept_%u.txt" % (int(name_from.split(".")[0].split("_")[1])))
13 15
 	)
14 16
 	
... ...
@@ -1,7 +1,7 @@
1 1
 #!/usr/bin/env sh
2 2
 
3 3
 source=mehl:/home/bfadmin/websites/folksprak.org/htdocs/words/data/pages/concepts
4
-destination=temp/dokuwiki
4
+destination=concepts/wiki
5 5
 mkdir --parents ${destination}
6 6
 rsync \
7 7
 	--verbose \
... ...
@@ -1,6 +1,6 @@
1 1
 #!/usr/bin/env sh
2 2
 
3
-source=temp/dokuwiki
3
+source=concepts/wiki
4 4
 destination=mehl:/home/bfadmin/websites/folksprak.org/htdocs/words/data/pages/concepts
5 5
 rsync \
6 6
 	--verbose \
... ...
@@ -1,5 +1,5 @@
1 1
 #!/usr/bin/env sh
2 2
 
3
-tools/in.sh
3
+tools/wiki-in.sh
4 4
 python3 tools/take.py
5 5
 
... ...
@@ -1,5 +1,5 @@
1 1
 #!/usr/bin/env sh
2 2
 
3 3
 python3 tools/give.py
4
-tools/out.sh
4
+tools/wiki-out.sh
5 5
 
... ...
@@ -7,8 +7,10 @@ import common as _common
7 7
 
8 8
 def main(args):
9 9
 	_common.filemap(
10
-		"temp/dokuwiki", _common.dokuwiki_from,
11
-		"concepts", _common.json_to,
10
+		"concepts/wiki",
11
+		_common.dokuwiki_from,
12
+		"concepts/json",
13
+		_common.json_to,
12 14
 		lambda name_from: ("concept_%u.json" % (int(name_from.split(".")[0].split("_")[1])))
13 15
 	)
14 16
 	
15 17