Total Complexity | 2 |
Total Lines | 17 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
|
|||
2 | |||
3 | class TclEncHeaderMixin: |
||
4 | def do_encrypt_header(self, encslave, address): |
||
5 | params = self.get_creds2() |
||
6 | params[b"address"] = bytes(address, "utf-8") |
||
7 | url = "http://" + encslave + "/encrypt_header.php" |
||
8 | req = self.sess.post(url, data=params, verify=False) |
||
9 | # Expect "HTTP 206 Partial Content" response |
||
10 | if req.status_code == 206: |
||
11 | return req.content |
||
12 | else: |
||
13 | print("ENCRYPT: " + repr(req)) |
||
14 | print(repr(req.headers)) |
||
15 | print(repr(req.text)) |
||
16 | raise SystemExit |
||
17 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.