summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-09-07 02:10:36 +0200
committeremkael <emkael@tlen.pl>2017-09-07 02:10:36 +0200
commit4060fa99c23bca17895029ae1ffad24d0d024269 (patch)
treecf4f322e236d913e238366a2de30727d0d2561cb
parent26f2934bcdfec9b32131ec01bbdd493146b3ad57 (diff)
Moving *.py scripts to separate directory, cleaning things up
-rw-r--r--Makefile6
-rwxr-xr-xbin/build-datafiles.sh2
-rwxr-xr-xbin/build-players.sh2
-rwxr-xr-xbin/build-rankings.sh2
-rwxr-xr-xbin/generate-json.sh2
-rwxr-xr-xbin/generate-statics.sh2
-rwxr-xr-xbin/write-menus.sh2
-rw-r--r--docs/building.md8
-rw-r--r--scripts/datafile.py (renamed from datafile.py)0
-rw-r--r--scripts/editions.py (renamed from editions.py)0
-rw-r--r--scripts/generate-json.py (renamed from generate-json.py)0
-rw-r--r--scripts/players.py (renamed from players.py)0
-rw-r--r--scripts/pyranking/__init__.py (renamed from pyranking/__init__.py)0
-rw-r--r--scripts/pyranking/db.py (renamed from pyranking/db.py)0
-rw-r--r--scripts/pyranking/fetch.py (renamed from pyranking/fetch.py)0
-rw-r--r--scripts/ranking.py (renamed from ranking.py)0
-rw-r--r--scripts/static-menu.py (renamed from static-menu.py)0
-rw-r--r--scripts/static.py (renamed from static.py)0
18 files changed, 13 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 8c952e6..9679512 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ tables:
editions: $(rankfiles)
$(rankfiles):
- python editions.py $(patsubst %.ed,%,$@)
+ python scripts/editions.py $(patsubst %.ed,%,$@)
json:
bin/generate-json.sh config/dates.json http
@@ -30,8 +30,8 @@ menus:
bin/write-menus.sh config/static.json http
group-tools:
- python static.py static/group-intro.html static/group-form-loading.html static/group-form.html > http/ranking-grupowy.html
- python static-menu.py config/static.json http/ranking-grupowy.html http
+ python scripts/static.py static/group-intro.html static/group-form-loading.html static/group-form.html > http/ranking-grupowy.html
+ python scripts/static-menu.py config/static.json http/ranking-grupowy.html http
minimize: $(tmpfiles)
diff --git a/bin/build-datafiles.sh b/bin/build-datafiles.sh
index bde7bc1..82c2e9c 100755
--- a/bin/build-datafiles.sh
+++ b/bin/build-datafiles.sh
@@ -6,6 +6,6 @@ cat $CONFIG |
jq -r '.[] | .date' |
while read DATE
do
- python datafile.py $DATE $PREV_DATE > "$DIR/$DATE.json"
+ python scripts/datafile.py $DATE $PREV_DATE > "$DIR/$DATE.json"
PREV_DATE=$DATE
done
diff --git a/bin/build-players.sh b/bin/build-players.sh
index 3d250b7..3f123bd 100755
--- a/bin/build-players.sh
+++ b/bin/build-players.sh
@@ -1,4 +1,4 @@
#!/bin/bash
DIR=$1
mkdir -p $DIR/players
-python players.py $DIR/players
+python scripts/players.py $DIR/players
diff --git a/bin/build-rankings.sh b/bin/build-rankings.sh
index 1896afb..41e182a 100755
--- a/bin/build-rankings.sh
+++ b/bin/build-rankings.sh
@@ -7,6 +7,6 @@ cat $CONFIG |
xargs -n4 |
while read DATE URL INDEX NAME
do
- python ranking.py "$NAME" $INDEX $DATE $PREV_DATE > $DIR/$URL
+ python scripts/ranking.py "$NAME" $INDEX $DATE $PREV_DATE > $DIR/$URL
PREV_DATE=$DATE
done
diff --git a/bin/generate-json.sh b/bin/generate-json.sh
index 4af0f5a..f1402c6 100755
--- a/bin/generate-json.sh
+++ b/bin/generate-json.sh
@@ -2,4 +2,4 @@
CONFIG=$1
OUTPUT=$2
LAST_DATE=`cat $CONFIG | jq -r '.[] | .date' | sort | tail -n1`
-python generate-json.py $LAST_DATE > $OUTPUT/data/group-data.json
+python scripts/generate-json.py $LAST_DATE > $OUTPUT/data/group-data.json
diff --git a/bin/generate-statics.sh b/bin/generate-statics.sh
index f632d69..bb49671 100755
--- a/bin/generate-statics.sh
+++ b/bin/generate-statics.sh
@@ -10,6 +10,6 @@ cat $1 |
read OUTPUT_FILE
if [ -n "$CONTENT_FILE" ]
then
- python static.py $CONTENT_DIR/$CONTENT_FILE "$HEADER" > $OUTPUT_DIR/$OUTPUT_FILE
+ python scripts/static.py $CONTENT_DIR/$CONTENT_FILE "$HEADER" > $OUTPUT_DIR/$OUTPUT_FILE
fi
done
diff --git a/bin/write-menus.sh b/bin/write-menus.sh
index 56b0929..33ae144 100755
--- a/bin/write-menus.sh
+++ b/bin/write-menus.sh
@@ -1,4 +1,4 @@
#!/bin/bash
CONFIG_FILE=$1
DIRECTORY=$2
-find $DIRECTORY -name \*.html -exec python static-menu.py $CONFIG_FILE {} $DIRECTORY \;
+find $DIRECTORY -name \*.html -exec python scripts/static-menu.py $CONFIG_FILE {} $DIRECTORY \;
diff --git a/docs/building.md b/docs/building.md
index 572764b..d45f7a0 100644
--- a/docs/building.md
+++ b/docs/building.md
@@ -1,24 +1,24 @@
To build initial ranking:
```
-python ranking.py RANKING_NAME RANKING_INDEX DATE > http/FILENAME.html
+python scripts/ranking.py RANKING_NAME RANKING_INDEX DATE > http/FILENAME.html
```
To build subsequent rankings:
```
-python ranking.py RANKING_NAME RANKING_INDEX DATE PREVIOUS_DATE > http/FILENAME.html
+python scripts/ranking.py RANKING_NAME RANKING_INDEX DATE PREVIOUS_DATE > http/FILENAME.html
```
To compile edition list header into ranking:
```
-python editions.py http/FILENAME.html
+python scripts/editions.py http/FILENAME.html
```
To build players' pages:
```
-python players.py http/players/
+python scripts/players.py http/players/
```
Name, surname and club are always used from the current `players` table. Regions, genders and age categories are read per-ranking.
diff --git a/datafile.py b/scripts/datafile.py
index 5cee451..5cee451 100644
--- a/datafile.py
+++ b/scripts/datafile.py
diff --git a/editions.py b/scripts/editions.py
index 42d036f..42d036f 100644
--- a/editions.py
+++ b/scripts/editions.py
diff --git a/generate-json.py b/scripts/generate-json.py
index 54bb26d..54bb26d 100644
--- a/generate-json.py
+++ b/scripts/generate-json.py
diff --git a/players.py b/scripts/players.py
index eddb2e9..eddb2e9 100644
--- a/players.py
+++ b/scripts/players.py
diff --git a/pyranking/__init__.py b/scripts/pyranking/__init__.py
index e69de29..e69de29 100644
--- a/pyranking/__init__.py
+++ b/scripts/pyranking/__init__.py
diff --git a/pyranking/db.py b/scripts/pyranking/db.py
index 16595d3..16595d3 100644
--- a/pyranking/db.py
+++ b/scripts/pyranking/db.py
diff --git a/pyranking/fetch.py b/scripts/pyranking/fetch.py
index 0d301d4..0d301d4 100644
--- a/pyranking/fetch.py
+++ b/scripts/pyranking/fetch.py
diff --git a/ranking.py b/scripts/ranking.py
index 4a16867..4a16867 100644
--- a/ranking.py
+++ b/scripts/ranking.py
diff --git a/static-menu.py b/scripts/static-menu.py
index 9474d12..9474d12 100644
--- a/static-menu.py
+++ b/scripts/static-menu.py
diff --git a/static.py b/scripts/static.py
index 16d82ae..16d82ae 100644
--- a/static.py
+++ b/scripts/static.py