Passed
Push — master ( 9e646b...3ccee6 )
by dai
01:34
created

school_api.client.api.utils.get_tip()   A

Complexity

Conditions 2

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
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
import re
3
4
5
def get_tip(html):
6
    ''' 获取页面提示信息 '''
7
    tips = re.findall(r">alert\(\'(.*?)\'", html)
8
    if tips:
9
        return tips[0]
10