You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: sessions/session_01/README_TASKS.md
+8-5
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ In case you are in doubt about converting a directory of files into a Git reposi
22
22
23
23
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.
24
24
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.
26
26
27
27
28
28
#### 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.
46
46
- via [pyenv](https://github.com/pyenv/pyenv)
47
47
- via [Anaconda](https://www.anaconda.com/products/individual)
48
48
* 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
51
51
-[Jinja2](https://palletsprojects.com/p/jinja/) >= version 3.0.0
52
52
* A current C compiler, e.g., `gcc`
53
53
- 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
82
82
diff minitwit.py minitwit.py3
83
83
```
84
84
- 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.
86
88
87
89
***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.
89
92
- Make sure to test this code (by running it), which will only be executed when initializing an empty database.
90
93
- 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.
0 commit comments