GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#49)
by Gonzalo
01:10
created

qtsass._to_version_info()   A

Complexity

Conditions 3

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 12
rs 9.95
c 0
b 0
f 0
cc 3
nop 1
1
# -*- coding: utf-8 -*-
2
# -----------------------------------------------------------------------------
3
# Copyright (c) 2015 Yann Lanthony
4
# Copyright (c) 2017-2018 Spyder Project Contributors
5
#
6
# Licensed under the terms of the MIT License
7
# (See LICENSE.txt for details)
8
# -----------------------------------------------------------------------------
9
"""
10
The SASS language brings countless amazing features to CSS.
11
12
Besides being used in web development, CSS is also the way to stylize Qt-based
13
desktop applications. However, Qt's CSS has a few variations that prevent the
14
direct use of SASS compiler.
15
16
The purpose of qtsass is to fill the gap between SASS and Qt-CSS by handling
17
those variations.
18
"""
19
20
# yapf: disable
21
22
from __future__ import absolute_import
23
24
# Standard library imports
25
import logging
26
27
# Local imports
28
from qtsass.api import (
0 ignored issues
show
Bug Best Practice introduced by
This seems to re-define the built-in compile.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
29
    compile,
30
    compile_dirname,
31
    compile_filename,
32
    enable_logging,
33
    watch,
34
)
35
36
37
# yapf: enable
38
39
# Setup Logging
40
logging.getLogger(__name__).addHandler(logging.NullHandler())
41
enable_logging()
42
43
# Constants
44
__version__ = '0.2.2.dev0'
45
46
47
def _to_version_info(version):
48
    """Convert a version string to a number and string tuple."""
49
    parts = []
50
    for part in version.split('.'):
51
        try:
52
            part = int(part)
53
        except ValueError:
54
            pass
55
56
        parts.append(part)
57
58
    return tuple(parts)
59
60
61
VERSION_INFO = _to_version_info(__version__)
62