Passed
Push — master ( 2f86f7...74d48b )
by Markus
01:48
created

tcllib.tclencheader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A TclEncHeaderMixin.do_encrypt_header() 0 13 2
1
# -*- coding: utf-8 -*-
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
3
class TclEncHeaderMixin:
0 ignored issues
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
4
    def do_encrypt_header(self, encslave, address):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
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