Skip to content

Commit de23151

Browse files
committed
Automatic release of teaching material.
1 parent 12ce25f commit de23151

File tree

4 files changed

+1357
-5
lines changed

4 files changed

+1357
-5
lines changed

sessions/session_01/README_TASKS.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In case you are in doubt about converting a directory of files into a Git reposi
2222

2323
Throughout the semester you will work on your own version of _ITU-MiniTwit_, which will be in many ways similar to the version you just took over. Therefore, it is worth to understand how it is working. Perhaps it is best to start your investigation on the top of the file `minitwit.py`, followed by the function `timeline()`, the functions `before_request()` and `after_request()`, and then all the other functions.
2424

25-
As described in class, _ITU-MiniTwit_ relies on the web-application framework [Flask](https://palletsprojects.com/p/flask/). The [official documentation](https://flask.palletsprojects.com/en/1.1.x/) as well as the book [Flask Web Development](https://www.oreilly.com/library/view/flask-web-development/9781491991725/) might support you in this task. In case you are in doubt about some Python constructs, the free book [Whirlwind Tour of Python](https://jakevdp.github.io/WhirlwindTourOfPython/) might be helpful.
25+
As described in class, _ITU-MiniTwit_ relies on the web-application framework [Flask](https://palletsprojects.com/p/flask/). The [official documentation](https://flask.palletsprojects.com/en/) as well as the book [Flask Web Development](https://www.oreilly.com/library/view/flask-web-development/9781491991725/) might support you in this task. In case you are in doubt about some Python constructs, the free book [Whirlwind Tour of Python](https://jakevdp.github.io/WhirlwindTourOfPython/) might be helpful.
2626

2727

2828
#### Why do we do that? Why do I have to understand other peoples' code?
@@ -46,8 +46,8 @@ By "modern computer", we mean your personal computer running, e.g., Linux.
4646
- via [pyenv](https://github.com/pyenv/pyenv)
4747
- via [Anaconda](https://www.anaconda.com/products/individual)
4848
* The Python dependencies from `itu-minitwit`:
49-
- [Flask](https://flask.palletsprojects.com/en/1.1.x/) >= version 2.0.0
50-
- [Werkzeug](https://palletsprojects.com/p/werkzeug/) >= version 2.0.0
49+
- [Flask](https://flask.palletsprojects.com/en/3.0.x/) >= version 3.0.0
50+
- [Werkzeug](https://palletsprojects.com/p/werkzeug/) >= version 3.0.0
5151
- [Jinja2](https://palletsprojects.com/p/jinja/) >= version 3.0.0
5252
* A current C compiler, e.g., `gcc`
5353
- Likely it is already part of your Linux installation.
@@ -82,10 +82,13 @@ Your task is to modify as few lines as possible in the given sources of _ITU-Min
8282
diff minitwit.py minitwit.py3
8383
```
8484
- Once you are sure that you understand what the `2to3` tool changed, replace the contents of `minitwit.py` with the Python 3 sources.
85-
85+
* After refactoring `minitwit.py` to a modern Python 3 version, do the same refactoring with `minitwit_tests.py`.
86+
That is, make sure that the tests that can be executed against the original version of `minitwit.py` pass against your refactored version of `minitwit.py` too.
87+
**OBS**: Making use of existing test suites during refactoring is one of the most important tasks in software evolution.
8688

8789
* **Hint**:
88-
- When converting `minitwit.py` to Python 3 you might receive an error when reading the SQL script when initializing the database in line: `db.cursor().executescript(f.read())`. Likely decoding of the file contents into `utf-8` has to be declared explicitly.
90+
- When converting `minitwit.py` to Python 3 you might receive an error when reading the SQL script when initializing the database in line: `db.cursor().executescript(f.read())`.
91+
Likely, decoding of the file contents into `utf-8` has to be declared explicitly.
8992
- Make sure to test this code (by running it), which will only be executed when initializing an empty database.
9093
- Also some functions from the `werkzeug` module were moved to another submodule. To resolve the issue Google for the error message and you will find a corresponding change entry.
9194

0 commit comments

Comments
 (0)