Test Setup Failed
Push — develop ( e459d6...12ef70 )
by Dean
02:19
created

FastPull.start()   A

Complexity

Conditions 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
cc 1
dl 0
loc 10
ccs 0
cts 1
cp 0
crap 2
rs 9.4285
1 1
from plugin.sync.core.enums import SyncMode
2 1
from plugin.sync.modes.core.base import Mode
3 1
from plugin.sync.modes.fast_pull.lists import LikedLists, PersonalLists, Watchlist
4 1
from plugin.sync.modes.fast_pull.movies import Movies
5 1
from plugin.sync.modes.fast_pull.shows import Shows
6
7 1
import elapsed
8 1
import logging
9
10 1
log = logging.getLogger(__name__)
11
12
13 1
class FastPull(Mode):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14 1
    mode = SyncMode.FastPull
15
16 1
    children = [
17
        Movies,
18
        Shows,
19
20
        LikedLists,
21
        PersonalLists,
22
        Watchlist
23
    ]
24
25 1
    @elapsed.clock
26
    def construct(self):
27
        # Start progress tracking
28
        self.current.progress.start()
29
30
        # Construct children
31
        self.execute_children('construct')
32
33
    @elapsed.clock
34
    def start(self):
35
        # Fetch changes from trakt.tv
36
        self.trakt.refresh()
37
38
        # Build key table for lookups
39
        self.trakt.build_table()
40
41
        # Start children
42
        self.execute_children('start')
43
44
    @elapsed.clock
45
    def run(self):
46
        # Run children
47
        self.execute_children('run')
48
49
    @elapsed.clock
50
    def stop(self):
51
        # Stop children
52
        self.execute_children('stop')
53
54
        # Stop progress tracking
55
        self.current.progress.stop()
56