Completed
Push — master ( 3bad9e...b519e1 )
by Andrii
19:09
created

idnLang   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 17
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render_tag() 0 3 1
A parse_msg() 0 4 2
1
from ..Module import Module
2
3
class idnLang(Module):
4
    opmap = {
5
        'nsExtErrData': 'descend',
6
    }
7
8
### RESPONSE parsing
9
10
    def parse_msg(self, response, tag):
11
        if 'code' in tag.attrib:
12
            response.set('nsExtErr.code', tag.attrib['code'])
13
        response.set('nsExtErr.msg', tag.text)
14
15
### REQUEST rendering
16
17
    def render_tag(self, request):
18
        extension = self.render_extension(request, 'tag')
19
        extension.text = request.get('idnLang:tag')
20
21