diff --git a/Tangled_cables_at_Tokyo_Festival_of_Modular_2013.jpg b/Tangled_cables_at_Tokyo_Festival_of_Modular_2013.jpg new file mode 100644 index 0000000..eac12d3 Binary files /dev/null and b/Tangled_cables_at_Tokyo_Festival_of_Modular_2013.jpg differ diff --git a/cover.jpg b/cover.jpg new file mode 100644 index 0000000..1ac4d84 Binary files /dev/null and b/cover.jpg differ diff --git a/flask_boat.py b/flask_boat.py index 35f8070..770210b 100644 --- a/flask_boat.py +++ b/flask_boat.py @@ -5,6 +5,7 @@ from flask import Flask, render_template, request, url_for, redirect, jsonify, a import markdown import frontmatter from datetime import datetime +import json # FUNCTIONS @@ -118,5 +119,14 @@ def sendStaticFiles(project, filename): return send_from_directory(app.root_path + f'/projects/{project}/', filename, conditional=True) +@app.route(f'/{base_url}/hook/', methods=['GET', 'POST']) +def pull(): + if request.method == 'POST': + post_data = json.loads(request.form['payload']) + stream = os.popen('git pull') + output = stream.read() + return output + return 'GET method not supported' + # RUN app.run(port="3132") diff --git a/projects/soup-to-wiki/log_to_wiki_2.ipynb b/projects/soup-to-wiki/log_to_wiki_2.ipynb index f204814..2704036 100644 --- a/projects/soup-to-wiki/log_to_wiki_2.ipynb +++ b/projects/soup-to-wiki/log_to_wiki_2.ipynb @@ -42,7 +42,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 4, "id": "a7b4d409-d42d-4a74-b093-10ace148cc71", "metadata": {}, "outputs": [], @@ -66,7 +66,7 @@ "projects.sort(reverse=False, key=lambda project: datetime.strptime(\n", " project['date'], '%d %b, %y'))\n", "\n", - "baloons = Template(filename=\"baloons_web.html\")\n", + "baloons = Template(filename=\"baloons.html\")\n", "\n", "with open('output.html', 'w') as f:\n", " f.write(baloons.render(projects=projects))\n", diff --git a/projects/soup-to-wiki/output.html b/projects/soup-to-wiki/output.html index f1adc7f..f0a7e19 100644 --- a/projects/soup-to-wiki/output.html +++ b/projects/soup-to-wiki/output.html @@ -57,270 +57,249 @@ diff --git a/test.ipynb b/test.ipynb new file mode 100644 index 0000000..6bcc02f --- /dev/null +++ b/test.ipynb @@ -0,0 +1,55 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 3, + "id": "8d024ff0-1dc3-4a8a-8974-85665c28e0c1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Already up to date.\n", + "\n" + ] + } + ], + "source": [ + "import os\n", + "stream = os.popen('git pull')\n", + "output = stream.read()\n", + "print(output)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2d5f2527-0865-489b-9ca4-e6a45102211b", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}