Skip to content

Commit

Permalink
fix csv course data bundling
Browse files Browse the repository at this point in the history
  • Loading branch information
drewvolz authored May 27, 2024
1 parent bde06ed commit 327ea49
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions bin/github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ fi
git checkout --quiet -B "$PAGES_BRANCH" "$GITHUB_BRANCH" --no-track

# update bundled information for public consumption
# python3 ../bundle.py --out-dir ../course-data --format json --format xml --format csv
python3 ../bundle.py --out-dir ../course-data --format json --format xml
python3 ../bundle.py --out-dir ../course-data --format json --format xml --format csv
python3 ../bundle.py --legacy --out-dir ../course-data/legacy --format json

# remove the source files (quietly)
Expand Down
3 changes: 1 addition & 2 deletions bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ fi
git checkout -B gh-pages master --no-track

# update bundled information for public consumption
# python3 ../bundle.py --out-dir ../course-data --format json --format xml --format csv
python3 ../bundle.py --out-dir ../course-data --format json --format xml
python3 ../bundle.py --out-dir ../course-data --format json --format xml --format csv
python3 ../bundle.py --legacy --out-dir ../course-data/legacy --format json

# remove the source files (quietly)
Expand Down
2 changes: 1 addition & 1 deletion lib/csvify.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def csvify(data):
item.pop('revisions')
for key in item:
if type(item[key]) is list:
item[key] = ';'.join(item[key])
item[key] = ';'.join(str(x) if not isinstance(x, str) else x for x in item[key])
if type(item[key]) is str:
item[key] = item[key].replace('\n', '\\n')
with io.StringIO() as outfile:
Expand Down

0 comments on commit 327ea49

Please sign in to comment.